| # -*- coding: utf-8 -*- |
| # |
| # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| ''' This configuration file consists of: |
| |
| Some path definitions and parameters: |
| gesture_files_path: the path of the gesture files |
| trackpad_device_file: the trackpad device file |
| trackpad_drivers: possible trackpad drivers that may be used |
| xorg_log: the xorg log file |
| xcapture_timeout: the timeout if there are no more X events coming in |
| xcapture_max_post_replay_time: the max allowable duration after |
| the completion of device file playback |
| |
| functionality_list: details the specific functionalities to be tested. |
| |
| filename_attr: specifies the components to generate test file names |
| ''' |
| |
| |
| ''' Path definitions ''' |
| # gesture_files_path_saved: specify the directory saving the test files |
| gesture_files_path_saved = '/var/tmp/trackpad_test_data/test_files' |
| # gesture_files_path: specify the path (symbolic link) for autotest |
| gesture_files_path = gesture_files_path_saved + '/latest' |
| |
| # The device file is used to record/replay trackpad device events. |
| # The device file is created by evdev. |
| # Priority about which trackpad device file to use: |
| # (1) Use trackpad device specified on trackpad_record command line. |
| # (2) Probe /dev/input/event* for trackpad device. |
| # TODO(josephsih): get rid of (3) and (4) below |
| # (3) Using the trackpad device specified in the config file here. |
| # (4) Using the trackpad device hardcoded in trackpad_util module. |
| # Note that the path of the device file may vary from model to model. |
| trackpad_device_file = '/dev/input/event6' |
| |
| |
| ''' Parameters to find trackpad X input driver ''' |
| trackpad_drivers = ('cmt', 'multitouch', 'synaptics') |
| xorg_log = '/var/log/Xorg.0.log' |
| |
| |
| ''' Parameters for Xcapture ''' |
| xcapture_timeout = 1 |
| xcapture_max_post_replay_time = 20 |
| mtplot_gui = True |
| |
| |
| ''' area: a broader category that several functionalities belong to. |
| E.g., area[0]: 1 finger point & click. |
| It consists of a short name and a long name. |
| ''' |
| |
| area = { |
| 0: ('click', '1 finger point & click'), |
| 1: ('select', 'Click & select/drag'), |
| 2: ('right_click', '2 finger alternate/right click'), |
| 3: ('scroll', '2 finger scroll'), |
| 4: ('palm', 'Palm/thumb detection'), |
| } |
| |
| |
| ''' functionality_list: the list of test functionalities |
| |
| A functionality is a TrackpadTestFunctionality object and has the |
| following attributes: |
| |
| TrackpadTestFunctionality( |
| |
| name: the name of the functionality, |
| e.g., any_finger_click, any_angle_click |
| |
| subname: specifying variations of a particular functionality |
| e.g., physical means a physical click |
| tap means a tap to click |
| left means the left hand |
| right means the right hand |
| Note: a subname of the functionality no_min_width_click looks like |
| subname=(('physical', 'tap'), |
| ('left', 'right'), |
| ), |
| In this case, the variations of the file name include |
| no_min_width_click.physical.left-... |
| no_min_width_click.physical.right-... |
| no_min_width_click.tap.left-... |
| no_min_width_click.tap.right-... |
| |
| description: the description of the functionality |
| |
| prompt, subprompt: Prompt messages about a functionality and its |
| subname when recording |
| |
| area: the area to which the functionality belongs, |
| e.g., '2 finger scroll' |
| |
| criteria: configurable criteria associated with a functionality. |
| It includes |
| 'max_movement': the max cursor movement allowed |
| examples 1: To specify movement no more than 5 pixels |
| 'max_movement': 5, |
| examples 2: To specify no movement allowed |
| 'max_movement': 0, |
| 'button': the count of button events specified. |
| examples 1: To specify one left button click: |
| 'button': ('Button Left', '==', 1), |
| examples 2: To specify five left button click: |
| 'button': ('Button Left', '==', 5), |
| examples 3: To specify no button events at all: |
| 'button': None, |
| |
| weight: the weight of each functionality, used to calculate how well |
| a driver performs. This attribute is for future use. |
| |
| enabled: True or False to indicate whether this functionality will be |
| used during recording or during the autotest. |
| |
| files: the list of test files. Can be specific file names, or '*', or |
| something like 'two_finger_scroll.down-*' |
| e.g., for the functionality of 'any_finger_click', |
| Some possible specifications are: |
| - '*': matches all files 'any_finger_click*': |
| - 'any_finger_click.tap.*' |
| - 'any_finger_click.physical.left.*' |
| - 'any_finger_click.physical.right.4-alex-john-*.dat' |
| ), |
| ''' |
| |
| # the min distance of single drag gesture |
| select_drag_distance = 20 |
| # the allowable max cursor movement during a click |
| click_movement = 5 |
| # the allowable max cursor movement during palm contact |
| palm_movement = 5 |
| # the ratio between the movement of the two axes |
| # E.g., if your finger is tracking left, y_move / x_move <= move_ratio. |
| move_ratio = 0.15 |
| # max accumulated motion allowed in between button events |
| max_motion_mixed = 10 |
| # max accumulated button wheel events allowed |
| max_button_wheel_mixed = 15 |
| |
| functionality_list = [ |
| |
| ### Area 0: 1 finger point & click |
| TrackpadTestFunctionality( |
| name='any_finger_click', |
| subname=('physical_click', 'tap'), |
| description='Any finger, including thumb, can click', |
| prompt='Make a {0} with every finger of either hand starting from ' |
| 'thumb to pinky. Repeat the procedure {1} to make {2} in total.', |
| subprompt={ |
| 'physical_click': ('physical click', 'twice', '10 clicks'), |
| 'tap': ('soft tap', 'twice', '10 taps'), |
| }, |
| area=area[0], |
| criteria={ |
| 'total_movement': ('Motion', '<=', click_movement), |
| 'button': ('Button Left', '==', 10), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='any_angle_click', |
| subname=('physical_click', 'tap'), |
| description='Finger can be oriented at any angle relative to ' |
| 'trackpad', |
| prompt='Make a {0} with any finger of either hand at 0, 45, 90, ' |
| '135, 180 degrees with the horizontal axis respectively. ' |
| 'Repeat the procedure {1} to make {2} in total.', |
| subprompt={ |
| 'physical_click': ('physical click', 'twice', '10 clicks'), |
| 'tap': ('soft tap', 'twice', '10 taps'), |
| }, |
| area=area[0], |
| criteria={ |
| 'total_movement': ('Motion', '<=', click_movement), |
| 'button': ('Button Left', '==', 10), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='any_location_click', |
| subname=('physical_click', 'tap'), |
| description='Click can occur at any location on trackpad ' |
| '(no hot zones)', |
| prompt='Make a {0} with any finger of either hand in the upper, ' |
| 'middle, and bottom parts of the trackpad respectively. ' |
| 'Repeat the procedure {1} to make {2} in total.', |
| subprompt={ |
| 'physical_click': ('physical click', '3 times', '9 clicks'), |
| 'tap': ('soft tap', '3 times', '9 taps'), |
| }, |
| area=area[0], |
| criteria={ |
| 'total_movement': ('Motion', '<=', click_movement), |
| 'button': ('Button Left', '==', 9), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='no_min_width_click', |
| subname=('physical_click', 'tap'), |
| description='Single finger click should not have a defined minimum ' |
| 'width (i.e. click possible with finger tip and/or ' |
| 'fingernail)', |
| prompt='Make {0} using any finger tip {1} of either hand.', |
| subprompt={ |
| 'physical_click': ('physical clicks 5 times', '(fingernail)'), |
| 'tap': ('soft tap 5 times', ''), |
| }, |
| area=area[0], |
| criteria={ |
| 'total_movement': ('Motion', '<=', click_movement), |
| 'button': ('Button Left', '==', 5), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='no_cursor_wobble', |
| subname=('physical_click', 'tap'), |
| description='No cursor wobble, creep, or jumping (or jump back) ' |
| 'during clicking', |
| prompt='Make {0} using any finger of either hand.', |
| subprompt={ |
| 'physical_click': ('physical clicks 5 times',), |
| 'tap': ('soft tap 5 times',), |
| }, |
| area=area[0], |
| criteria={ |
| 'total_movement': ('Motion', '==', 0), |
| 'button': ('Button Left', '==', 5), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='drum_roll', |
| subname=('l0r1', 'l1r1', 'r0r1', 'r1r2'), |
| description='Drum roll: One finger (including thumb) touches ' |
| 'trackpad followed shortly (<500ms) by a second finger ' |
| 'touching trackpad should not result in cursor jumping', |
| prompt='Drum roll: use the {0} of your {1} hand touching trackpad ' |
| 'followed shortly (<500ms) by the {2} of your {3} hand ' |
| 'touching trackpad. Repeat the gesture for about {4}.', |
| subprompt={ |
| 'l0r1': ('thumb', 'left', 'first finger', 'right', '5 times'), |
| 'l1r1': ('first finger', 'left', 'first finger', 'right', |
| '5 times'), |
| 'r0r1': ('thumb', 'right', 'first finger', 'right', '5 times'), |
| 'r1r2': ('first finger', 'right', 'middle finger', 'right', |
| '5 times'), |
| }, |
| area=area[0], |
| criteria={ |
| 'total_movement': ('Motion', '==', 0), |
| 'button': None, |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='2fscroll_1fclick', |
| subname=('vert', 'horiz',), |
| description='2f scroll. Stop scrolling, then raise one finger. Click ' |
| 'with finger remaining on trackpad. Single finger click ' |
| 'should result.', |
| prompt='Two finger scroll {0} several times for about 3 seconds ' |
| 'without the fingers leaving the trackpad. Lift one of the ' |
| 'finger. The other finger make a physical click.', |
| subprompt={ |
| 'vert': ('up and down',), |
| 'horiz': ('left and right',), |
| }, |
| area=area[0], |
| criteria={ |
| 'sequence': (('*'), |
| ('ButtonPress', 'Button Left'), |
| ('ButtonRelease', 'Button Left'), |
| ), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| ### Area 1: Click & select/drag |
| TrackpadTestFunctionality( |
| name='single_finger_select_2d', |
| subname=('physical_click', 'tap_and_half'), |
| description='(Single finger) Finger physical click or ' |
| 'tap & a half, then finger - remaining in contact ' |
| 'with trackpad - drags along surface of trackpad', |
| prompt='Use any finger to make {0} and drag in arbitrary ' |
| 'directions for about a few seconds without the finger ' |
| 'leaving the trackpad.', |
| subprompt={ |
| 'physical_click': ('physical click',), |
| 'tap_and_half': ('tap & a half',), |
| }, |
| area=area[1], |
| criteria={ |
| 'sequence': (('ButtonPress', 'Button Left'), |
| ('Motion', '>=', select_drag_distance), |
| ('ButtonRelease', 'Button Left'), |
| ), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='single_finger_select', |
| subname=(('physical_click', 'tap_and_half'), |
| ('vert', 'horiz'), |
| ), |
| description='(Single finger) Finger physical click or ' |
| 'tap & a half, then finger - remaining in contact ' |
| 'with trackpad - drags along surface of trackpad', |
| prompt='Use any finger to make {0} and drag {1} for a few times ' |
| 'without the finger leaving the trackpad.', |
| subprompt={ |
| 'physical_click': ('physical click',), |
| 'tap_and_half': ('tap & a half',), |
| 'vert': ('up and down',), |
| 'horiz': ('left and right',), |
| }, |
| area=area[1], |
| criteria={ |
| 'sequence': (('ButtonPress', 'Button Left'), |
| ('Motion_x_or_y', '>=', select_drag_distance), |
| ('ButtonRelease', 'Button Left'), |
| ), |
| 'move_ratio': move_ratio, |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='single_finger_lifted_2d', |
| subname=None, |
| description='(Single finger) If finger leaves trackpad for only ' |
| '800ms-1s, select/drag should continue', |
| prompt='Use any finger to make tap & a half and drag in arbitrary ' |
| 'directions on the trackpad for a few seconds. Lift your ' |
| 'finger no more than 800ms-1s and then drag again in ' |
| 'arbitrary directions for a few seconds.', |
| subprompt=None, |
| area=area[1], |
| criteria={ |
| 'sequence': (('ButtonPress', 'Button Left'), |
| ('Motion', '>=', select_drag_distance), |
| ('NOP', '1st Finger Lifted'), |
| ('Motion', '>=', select_drag_distance), |
| ('ButtonRelease', 'Button Left'), |
| ), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='single_finger_lifted', |
| subname=('vert', 'horiz'), |
| description='(Single finger) If finger leaves trackpad for only ' |
| '800ms-1s, select/drag should continue', |
| prompt='Use any finger to make tap & a half and drag {0} for a' |
| 'few times without the finger leaving the trackpad. ' |
| 'Lift your finger no more than 800ms-1s and drag {0} again ' |
| 'for a few times without the finger leaving the trackpad. ' |
| 'Lift your finger when finished.', |
| subprompt={ |
| 'vert': ('up and down',), |
| 'horiz': ('left and right',), |
| }, |
| area=area[1], |
| criteria={ |
| 'sequence': (('ButtonPress', 'Button Left'), |
| ('Motion_x_or_y', '>=', select_drag_distance), |
| ('NOP', '1st Finger Lifted'), |
| ('Motion_x_or_y', '>=', select_drag_distance), |
| ('ButtonRelease', 'Button Left'), |
| ), |
| 'move_ratio': move_ratio, |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='two_fingers_select_2d', |
| subname=('physical_click', 'tap_and_half'), |
| description="(Two fingers) 1st finger click or tap & a half, " |
| "2nd finger's movement selects/drags", |
| prompt='Use 1st finger to make {0}, and 2nd finger to drag in ' |
| 'arbitrary directions for a few seconds.', |
| subprompt={ |
| 'physical_click': ('physical click',), |
| 'tap_and_half': ('tap & a half',), |
| }, |
| area=area[1], |
| criteria={ |
| 'sequence': (('ButtonPress', 'Button Left'), |
| ('Motion', '>=', select_drag_distance), |
| ('ButtonRelease', 'Button Left'), |
| ), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='two_fingers_select', |
| subname=(('physical_click', 'tap_and_half'), |
| ('vert', 'horiz'), |
| ), |
| description="(Two fingers) 1st finger click or tap & a half, " |
| "2nd finger's movement selects/drags", |
| prompt='Use 1st finger to make {0}, and 2nd finger to drag {1} a ' |
| 'few times without the finger leaving the trackpad.', |
| subprompt={ |
| 'physical_click': ('physical click',), |
| 'tap_and_half': ('tap & a half',), |
| 'vert': ('up and down',), |
| 'horiz': ('left and right',), |
| }, |
| area=area[1], |
| criteria={ |
| 'sequence': (('ButtonPress', 'Button Left'), |
| ('Motion_x_or_y', '>=', select_drag_distance), |
| ('ButtonRelease', 'Button Left'), |
| ), |
| 'move_ratio': move_ratio, |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='two_fingers_lifted', |
| subname=(('physical_click', 'tap_and_half'), |
| ('vert', 'horiz'), |
| ), |
| description='(Two fingers) Continues to drag when second finger ' |
| 'is lifted then placed again.', |
| prompt='Use 1st finger to make {0}, and 2nd finger to drag {1} for ' |
| 'a few times without the finger leaving the trackpad. ' |
| 'Lift your finger for a while and then drag {1} again for a ' |
| 'few times without the finger leaving the trackpad. ' |
| 'Lift both fingers when finished.', |
| subprompt={ |
| 'physical_click': ('physical click',), |
| 'tap_and_half': ('tap & a half',), |
| 'vert': ('up and down',), |
| 'horiz': ('left and right',), |
| }, |
| area=area[1], |
| criteria={ |
| 'sequence': (('ButtonPress', 'Button Left'), |
| ('Motion_x_or_y', '>=', select_drag_distance), |
| ('NOP', '2nd Finger Lifted'), |
| ('Motion_x_or_y', '>=', select_drag_distance), |
| ('ButtonRelease', 'Button Left'), |
| ), |
| 'move_ratio': move_ratio, |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='two_fingers_no_delay_2d', |
| subname=None, |
| description='(Two fingers) Drag should be immediate (no delay between ' |
| 'movement of finger and movement of selection/drag)', |
| prompt='Use 1st finger to click and hold. Use 2nd finger to drag in ' |
| 'arbitrary directions for a few seconds without leaving the ' |
| 'trackpad. Then release two fingers.', |
| subprompt=None, |
| area=area[1], |
| criteria={ |
| 'sequence': (('ButtonPress', 'Button Left'), |
| ('Motion', '>=', select_drag_distance), |
| ('ButtonRelease', 'Button Left'), |
| ), |
| 'delay': 0.2, |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| ### Area 2: 2 finger alternate/right click |
| TrackpadTestFunctionality( |
| name='basic_right_click', |
| subname=('physical_click', 'tap'), |
| description='Basic two-finger clicks should work.', |
| prompt='Use two fingers together to make {0} 5 times. Right ' |
| 'clicks should results.', |
| subprompt={ |
| 'physical_click': ('physical clicks',), |
| 'tap': ('taps',), |
| }, |
| area=area[2], |
| criteria={ |
| 'total_movement': ('Motion', '<=', click_movement), |
| 'button': ('Button Right', '==', 5), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='x_seconds_interval', |
| subname=(('0.3', '1', '3'), |
| ), |
| description='1st use case: 1st finger touches trackpad, ' |
| 'X seconds pass, 2nd finger touches trackpad, ' |
| 'physical click = right click, where X is any ' |
| 'number of seconds', |
| prompt='1st finger touches trackpad, wait {0} seconds, and then ' |
| '2nd finger touches trackpad. Lift two fingers together. ' |
| 'Repeat this procedure 3 times.', |
| subprompt={ |
| '0.3': ('0.3',), |
| '1': ('1',), |
| '3': ('3',), |
| }, |
| area=area[2], |
| criteria={ |
| 'total_movement': ('Motion', '<=', click_movement), |
| 'button': ('Button Right', '==', 3), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='roll_case', |
| subname=('300',), |
| description='2nd use case ("roll case"): If first finger generates a ' |
| 'click and second finger "rolls on" within 300ms of first ' |
| 'finger click, an alternate/right click results.', |
| prompt='1st finger generates a click, and 2nd finger rolls on ' |
| 'within {0} milliseconds. Lift two fingers together. ' |
| 'Repeat this procedure 3 times.', |
| subprompt={ |
| '300': ('300',), |
| }, |
| area=area[2], |
| criteria={ |
| 'total_movement': ('Motion', '<=', click_movement), |
| 'button': ('Button Right', '==', 3), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='one_finger_tracking_2d', |
| subname=None, |
| description='1 finger tracking, never leaves trackpad, 2f ' |
| 'arrives and there is a click. Right click results.', |
| prompt='1st finger drags in arbitrary directions for a few seconds, ' |
| 'never leaves trackpad, and then the 2nd finger arrives and ' |
| 'make a click. Lift two fingers together. ' |
| 'Repeat this procedure 3 times.', |
| subprompt=None, |
| area=area[2], |
| criteria={ |
| 'sequence': (('Motion', '>=', select_drag_distance), |
| ('ButtonPress', 'Button Right'), |
| ('ButtonRelease', 'Button Right'), |
| ('Motion', '>=', select_drag_distance), |
| ('ButtonPress', 'Button Right'), |
| ('ButtonRelease', 'Button Right'), |
| ('Motion', '>=', select_drag_distance), |
| ('ButtonPress', 'Button Right'), |
| ('ButtonRelease', 'Button Right'), |
| ), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| ### Area 3: 2 finger scroll |
| |
| TrackpadTestFunctionality( |
| name='basic_two_finger', |
| subname=('vert', 'horiz'), |
| description='Basic two-finger scroll should work.', |
| prompt='Use two finger to scroll {0} continuously for a few seconds.', |
| subprompt={ |
| 'vert': ('up and down',), |
| 'horiz': ('left and right',), |
| }, |
| area=area[3], |
| criteria={ |
| 'total_movement': ('Motion', '==', 0), |
| 'button': ('Button Wheel', '>=', 10), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='basic_2nd_finger', |
| subname=('vert', 'horiz'), |
| description='1st finger contacts trackpad, 2nd finger ' |
| 'moves vertically and scroll mirrors that movement', |
| prompt='Touch the trackpad with one finger, and use 2nd finger ' |
| 'to move {0} continuously for a few seconds.', |
| subprompt={ |
| 'vert': ('up and down',), |
| 'horiz': ('left and right',), |
| }, |
| area=area[3], |
| criteria={ |
| 'total_movement': ('Motion', '==', 0), |
| 'button': ('Button Wheel', '>=', 10), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='near_parallel', |
| subname=(('up', 'down', 'left', 'right'), |
| ('parallel', '45',), |
| ), |
| description='1st: Two fingers moving near parallel result in scroll', |
| prompt='Use a finger of your left hand and a finger of your right ' |
| 'hand with two fingers about 1 cm apart. Scroll {0} across ' |
| 'half of the trackpad with two fingers moving {1}', |
| subprompt={ |
| 'up': ('up',), |
| 'down': ('down',), |
| 'left': ('left',), |
| 'right': ('right',), |
| 'parallel': ('in parallel',), |
| '45': ('far away with an angle about 45 degrees.',), |
| }, |
| area=area[3], |
| criteria={ |
| 'total_movement': ('Motion', '==', 0), |
| 'button': ('Button Wheel', '>=', 10), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='2nd_finger_vertical', |
| subname=('up', 'down'), |
| description='2nd: 1st finger contacts trackpad, 2nd finger ' |
| 'moves vertically and scroll mirrors that movement', |
| prompt='Touch the trackpad with one finger, and use 2nd finger ' |
| 'to move {0} across half of the trackpad.', |
| subprompt={ |
| 'up': ('up',), |
| 'down': ('down',), |
| }, |
| area=area[3], |
| criteria={ |
| 'total_movement': ('Motion', '==', 0), |
| 'button': ('Button Wheel', '>=', 10), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='2nd_finger_horizontal', |
| subname=('left', 'right'), |
| description='2nd: 1st finger contacts trackpad, 2nd finger ' |
| 'moves horizontally and scroll mirrors that movement', |
| prompt='Use a finger contacts the trackpad, and use 2nd finger ' |
| 'to move {0} across half of the trackpad.', |
| subprompt={ |
| 'left': ('left',), |
| 'right': ('right',), |
| }, |
| area=area[3], |
| criteria={ |
| 'total_movement': ('Motion', '==', 0), |
| 'button': ('Button Wheel', '>=', 10), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='exclude_thumb', |
| subname=('vert', 'horiz'), |
| description='Test that finger exclude thumb in scroll', |
| prompt='Use the thumb of either hand contacts the bottom of the ' |
| 'trackpad, and then use two other fingers to scroll {0} for a ' |
| 'few times.', |
| subprompt={ |
| 'vert': ('up and down',), |
| 'horiz': ('left and right',), |
| }, |
| area=area[3], |
| criteria={ |
| 'total_movement': ('Motion', '==', 0), |
| 'button': ('Button Wheel', '>=', 10), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='finger_spacing', |
| subname=(('vert',), |
| ('close', 'proper', 'distant'), |
| ), |
| description='Scroll should occur regardless of spacing ' |
| '(close or distant) between fingers', |
| prompt='Use two fingers {1} to scroll {0} for a few times.', |
| subprompt={ |
| 'vert': ('up and down',), |
| 'close': ('contacting together',), |
| 'proper': ('spacing naturally in your own way',), |
| 'distant': ('spacing far on two sides of the trackpad',), |
| }, |
| area=area[3], |
| criteria={ |
| 'total_movement': ('Motion', '==', 0), |
| 'button': ('Button Wheel', '>=', 10), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='reflect_vertical', |
| subname=('up', 'down',), |
| description='Vertical scroll, reflecting movement of finger(s)', |
| prompt='(1) Use two fingers to scroll {0} slowly for about 4 ' |
| 'seconds. Lift the fingers.\n ' |
| '(2) Use two fingers to scroll {0} again at a medium speed ' |
| 'for about 1~2 seconds. Then lift fingers.\n ' |
| '(3) Use two fingers to scroll {0} again at a fast speed ' |
| 'for less than 0.5 seconds. Then lift fingers. ', |
| subprompt={ |
| 'up': ('up',), |
| 'down': ('down',), |
| }, |
| area=area[3], |
| criteria={ |
| 'button': ('Button Wheel', '>=', 10), |
| 'wheel_speed': ('Wheel Speed Multiplier', '>=', 1.5), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='reflect_horizontal', |
| subname=('left', 'right',), |
| description='Horizontal scroll, reflecting movement of finger(s)', |
| prompt='(1) Use two fingers to scroll {0} slowly for about 4 ' |
| 'seconds. Lift the fingers.\n ' |
| '(2) Use two fingers to scroll {0} again at a medium speed ' |
| 'for about 1~2 seconds. Then lift fingers.\n ' |
| '(3) Use two fingers to scroll {0} again at a fast speed ' |
| 'for less than 0.5 seconds. Then lift fingers. ', |
| subprompt={ |
| 'left': ('left',), |
| 'right': ('right',), |
| }, |
| area=area[3], |
| criteria={ |
| 'button': ('Button Wheel', '>=', 10), |
| 'wheel_speed': ('Wheel Speed Multiplier', '>=', 1.5), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='no_sudden_jump', |
| subname=('up', 'down', 'left', 'right'), |
| description='Consistent scrolling with two fingers ' |
| '(no sudden jumps)', |
| prompt='Use two fingers to scroll {0} steadily to the bezel edge.', |
| subprompt={ |
| 'up': ('up',), |
| 'down': ('down',), |
| 'left': ('left',), |
| 'right': ('right',), |
| }, |
| area=area[3], |
| criteria={ |
| 'button': ('Button Wheel', '>=', 10), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='regardless_prior_state', |
| subname=(('up', 'down',), |
| ('single_finger_movement', |
| 'right_click', |
| 'click_and_drag', |
| 'three_finger_contact',), |
| ), |
| description='Scroll occurs whenever the requirements are met, ' |
| 'regardless of prior state (e.g. single finger ' |
| 'movement, right click, click & drag, three finger ' |
| 'contact with trackpad)', |
| prompt='{1} Use the two fingers to scroll {0}.', |
| subprompt={ |
| 'up': ('up',), |
| 'down': ('down',), |
| 'single_finger_movement': ('Use a finger tracking arbitrarily. ' |
| 'Without the finger leaving the pad, ' |
| 'a 2nd finger touches the trackpad.',), |
| 'right_click': ('Use two fingers to make a right click. ' |
| 'All fingers leave the trackpad. ' |
| 'Within 300ms, two fingers touch the ' |
| 'trackpad again.',), |
| 'click_and_drag': ('Make a click and drag gesture in any ' |
| 'direction. All fingers leave the trackpad. ' |
| 'Within 300ms, two fingers touch the trackpad ' |
| 'again.',), |
| 'three_finger_contact': ('Use two fingers to scroll in any ' |
| 'direction. Have a 3rd finger in ' |
| 'contact. Then go back to two fingers.',), |
| }, |
| area=area[3], |
| criteria={ |
| 'sequence': (('*'), |
| ('Button Wheel', '>=', 10), |
| ('Motion', '==', 0), |
| ), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| ### Area 4: Palm/thumb detection |
| |
| TrackpadTestFunctionality( |
| name='palm_presence', |
| subname=(('static', 'moving'), |
| ('left', 'right', 'both'), |
| ), |
| description='No unintended cursor movement, click, scroll due to ' |
| 'presence of palm', |
| prompt='Place {1} on the trackpad {0} for about 5 seconds. ' |
| 'Then lift the palm(s).', |
| subprompt={ |
| 'static': ('statically in the way as your are typing',), |
| 'moving': ('and move continuously in arbitrary directions',), |
| 'left': ('your left palm',), |
| 'right': ('your right palm',), |
| 'both': ('both palms',), |
| }, |
| area=area[4], |
| criteria={ |
| 'total_movement': ('Motion', '<=', palm_movement), |
| 'button': None, |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='hovering_thumb', |
| subname=(('left', 'right'), |
| ('contact', 'above',), |
| ), |
| description='No unintended cursor movement, click, scroll due ' |
| 'to presence of "hovering thumb" (Hovering thumb ' |
| 'defined as Thumb above, or in contact with, bottom ' |
| '¼ of pad; thumb in any orientation)', |
| prompt='Place and move your {0} thumb (in any orientation) {1} ' |
| 'bottom ¼ of pad for about 5 seconds.', |
| subprompt={ |
| 'left': ('left',), |
| 'right': ('right',), |
| 'contact': ('in contact with',), |
| 'above': ('slightly above',), |
| }, |
| area=area[4], |
| criteria={ |
| 'total_movement': ('Motion', '<=', palm_movement), |
| 'button': None, |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='pointing', |
| subname=None, |
| description='Example: Palm/thumb sitting on bottom edge of ' |
| 'trackpad, primary finger comes in contact with ' |
| 'and moves on trackpad: Pointing should occur rather ' |
| 'than scrolling', |
| prompt='Place any thumb on the bottom edge of trackpad. ' |
| 'Use primary finger to move in arbitrary directions for a few ' |
| 'second. Then lift both fingers.', |
| subprompt=None, |
| area=area[4], |
| criteria={ |
| 'sequence': (('Motion', '<=', palm_movement), |
| ('NOP', '2nd Finger Landed'), |
| ('Motion', '>=', select_drag_distance), |
| ('NOP', '2nd Finger Lifted'), |
| ('Motion', '<=', palm_movement), |
| ), |
| 'button': None, |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='scroll', |
| subname=('vert', 'horiz'), |
| description='Example: Palm/thumb sitting on bottom edge of ' |
| 'trackpad while two fingers move in parallel on ' |
| 'trackpad: Scroll should result', |
| prompt='Place any thumb on the bottom edge of trackpad. ' |
| 'Use two fingers to scroll {0} for a few times. ' |
| 'Then lift all fingers.', |
| subprompt={ |
| 'vert': ('up and down',), |
| 'horiz': ('left and right',), |
| }, |
| area=area[4], |
| criteria={ |
| 'total_movement': ('Motion', '<=', palm_movement), |
| 'button': ('Button Wheel', '>=', 10), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| TrackpadTestFunctionality( |
| name='click', |
| subname=None, |
| description='Example: Palm/thumb sitting on bottom edge of trackpad ' |
| 'while primary finger clicks: Primary click results ' |
| 'rather than alternate click', |
| prompt='Place any thumb on the trackpad. Use primary finger to ' |
| 'make a click. Primary click should result. Repeat 5 times.', |
| subprompt=None, |
| area=area[4], |
| criteria={ |
| 'total_movement': ('Motion', '<=', palm_movement), |
| 'button': ('Button Left', '==', 5), |
| }, |
| weight=1, |
| enabled=True, |
| files=('*', |
| ), |
| ), |
| |
| ] |
| |
| |
| ''' filename_attr: A test file name is composed of the following attributes |
| |
| functionality name and subname: This prefix is generated automatically for |
| each functionality. E.g., two_finger_scroll.down |
| |
| prefix: the prefix string before the functionality in the file name. |
| If you want the area name of each functionality to be used as the |
| prefix string in the file name automatically, specify 'DEFAULT' as |
| ['prefix', 'DEFAULT'], |
| |
| You can give a prefix name here as an area name |
| ['prefix', 'click'], |
| |
| If you do not want a prefix string to show up before the |
| functionality name in the file name, you can assign None. |
| ['prefix', None], |
| |
| model: the model of the machine. |
| To let the system figure out the model automatically, |
| specify 'DEFAULT', as in: |
| ['model', 'DEFAULT'], |
| Note: Currently, the model name is looked up in '/etc/lsb-release' |
| as CHROMEOS_RELEASE_BOARD. For systems that do not support it, |
| a model name such as 'alex' below or None must be explicitly |
| given. |
| |
| You can specify a specific model name. E.g., |
| ['model', 'alex'], |
| |
| If you do not want the model name to show up in the file name, |
| you can just assign None. |
| ['model', None], |
| |
| firmware_version: the firmware version of the trackpad. This field is |
| generally omitted if any updated trackpad firmware does not affect |
| the characteristics of the touch data. When the firmware version |
| needs to be specified, do it like: |
| ['firmware_version', 'v8.5'], |
| |
| [other custom attributes come in here]: e.g., 'kernel_driver_version', |
| 'trackpad_material', etc. |
| |
| tester: the tester name is to be shown on the file name. Different testers |
| might have different ways of making gestures. If the tester is None, |
| trackpad record program will prompt the user to enter the name when |
| capturing gesture data files. To specify the name: |
| ['tester', 'tom'], |
| |
| timestamp: the timestamp when the file is captured. UTC time is employed. |
| It is generated automatically. The format is composed of year, month, |
| day, hour, minute, and second. E.g., 20110407_185746 |
| |
| ext: the extension of the data file. E.g., |
| ['ext', 'dat'] |
| |
| The name of a test file looks as: |
| scroll-basic_two_finger.vert-mario-john-20110916_000219.dat |
| ''' |
| |
| filename_attr = [ |
| ['prefix', 'DEFAULT'], |
| ['model', 'DEFAULT'], |
| ['firmware_version', None], |
| ['tester', None], |
| ['ext', 'dat'] |
| ] |