blob: 8374c00b8e8baacc913ada0d154251f824854a5f [file] [log] [blame]
# 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: specify the directory of the test files
gesture_files_path = '/var/tmp/trackpad_test_data/test_files'
# 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) Using the tradpad device if specified on trackpad_record command line
# (2) Probing the trackpad device in the system.
# (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 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
''' 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'),
5: ('settings', 'Settings'),
6: ('requirements', 'Requirements across all Chrome OS components'),
}
''' functionality_list: the list of test functionalities
A functionality is a TrackpadTestFunctionality class 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 as
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 ratio between the movement of the two axises
# E.g., if your finger is tracking left, y_move / x_move <= move_ratio.
move_ratio = 0.15
functionality_list = [
### Area 0: 1 finger point & click
TrackpadTestFunctionality(
name='any_finger_click',
subname=(('physical_click', 'tap'),
('left', 'right'),
('0', '1', '2', '3', '4'),
),
description='Any finger, including thumb, can click',
prompt='{0} exactly one time using the {2} of your {1} hand.',
subprompt={
'physical_click': ('Make a physical click',),
'tap': ('Make a tap to click',),
'left': ('left',),
'right': ('right',),
'0': ('thumb',),
'1': ('index finger',),
'2': ('middle finger',),
'3': ('ring finger',),
'4': ('pinky',),
},
area=area[0],
criteria={
'max_movement': click_movement,
'button': ('Button Left', 1),
},
weight=1,
enabled=True,
files=('*',
),
),
TrackpadTestFunctionality(
name='any_angle_click',
subname=(('physical_click', 'tap'),
('left', 'right'),
('0', '45', '90', '135', '180'),
),
description='Finger can be oriented at any angle relative to ' \
'trackpad',
prompt='{0} exactly one time using any finger of your {1} hand ' \
'at {2} degree with the horizontal axis.',
subprompt={
'physical_click': ('Make a physical click',),
'tap': ('Make a tap to click',),
'left': ('left',),
'right': ('right',),
'0': (0,),
'45': (45,),
'90': (90,),
'135': (135,),
'180': (180,),
},
area=area[0],
criteria={
'max_movement': click_movement,
'button': ('Button Left', 1),
},
weight=1,
enabled=True,
files=('*',
),
),
TrackpadTestFunctionality(
name='any_location_click',
subname=(('physical_click', 'tap'),
('left', 'right'),
('up', 'middle', 'bottom'),
),
description='Click can occur at any location on trackpad ' \
'(no hot zones)',
prompt='{0} exactly one time using any finger of your {1} hand ' \
'in the {2} part of the trackpad.',
subprompt={
'physical_click': ('Make a physical click',),
'tap': ('Make a tap to click',),
'left': ('left',),
'right': ('right',),
'up': ('upper',),
'middle': ('middle',),
'bottom': ('bottom',),
},
area=area[0],
criteria={
'max_movement': click_movement,
'button': ('Button Left', 1),
},
weight=1,
enabled=True,
files=('*',
),
),
TrackpadTestFunctionality(
name='no_min_width_click',
subname=(('physical_click', 'tap'),
('left', 'right'),
),
description='First finger should not have any minimum width ' \
'defined for it (i.e., point and/or click with ' \
'finger tip. E.g., click with fingernail)',
prompt='{0} exactly one time using the finger tip (fingernail) of ' \
'your {1} hand.',
subprompt={
'physical_click': ('Make a physical click',),
'tap': ('Make a tap to click',),
'left': ('left',),
'right': ('right',),
},
area=area[0],
criteria={
'max_movement': click_movement,
'button': ('Button Left', 1),
},
weight=1,
enabled=True,
files=('*',
),
),
TrackpadTestFunctionality(
name='no_cursor_wobble',
subname=(('physical_click', 'tap'),
('left', 'right'),
('5times',),
),
description='No cursor wobble, creep, or jumping (or jump back) ' \
'during clicking',
prompt='{0} using any finger of your {1} hand {2} times.',
subprompt={
'physical_click': ('Make a physical click',),
'tap': ('Make tap to clicks',),
'left': ('left',),
'right': ('right',),
'5times': (5,),
},
area=area[0],
criteria={
'max_movement': 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='Use the {0} of your {1} hand touching trackpad followed ' \
'shortly (<500ms) by the {2} of your {3} hand touching trackpad',
subprompt={
'l0r1': ('thumb', 'left', 'first finger', 'right'),
'l1r1': ('first finger', 'left', 'first finger', 'right'),
'r0r1': ('thumb', 'right', 'first finger', 'right'),
'r1r2': ('first finger', 'right', 'middle finger', 'right'),
},
area=area[0],
criteria={
'max_movement': 0,
'button': None,
},
weight=1,
enabled=True,
files=('*',
),
),
### Area 1: Click & select/drag
TrackpadTestFunctionality(
name='single_finger_select',
subname=(('physical_click', 'tap_and_half'),
('left', 'right', 'up', 'down'),
),
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} along half of the ' \
'surface of the trackpad.',
subprompt={
'physical_click': ('physical click',),
'tap_and_half': ('tap & a half',),
'left': ('left',),
'right': ('right',),
'up': ('up',),
'down': ('down',),
},
area=area[1],
criteria={
'sequence': (('Motion', '<=', click_movement),
('ButtonPress', 'Button Left'),
('Motion_x_or_y', '>=', select_drag_distance),
('ButtonRelease', 'Button Left'),
('Motion', '<=', click_movement),
),
'move_ratio': move_ratio,
},
weight=1,
enabled=True,
files=('*',
),
),
TrackpadTestFunctionality(
name='single_finger_lifted',
subname=(('left', 'right', 'up', 'down'),
),
description='(Single finger) If finger leaves trackpad for only ' \
'800ms-1s (Synaptics UX should know value), ' \
'select/drag should continue',
prompt='Use any finger to make tap & a half and drag {0} along ' \
'half of the surface of the trackpad. Lift your finger ' \
'no more than 800ms-1s and drag {0} again along half of ' \
'the surface.',
subprompt={
'left': ('left',),
'right': ('right',),
'up': ('up',),
'down': ('down',),
},
area=area[1],
criteria={
'sequence': (('Motion', '<=', click_movement),
('ButtonPress', 'Button Left'),
('Motion_x_or_y', '>=', select_drag_distance),
('NOP', 'Finger Lifted'),
('Motion_x_or_y', '>=', select_drag_distance),
('ButtonRelease', 'Button Left'),
('Motion', '<=', click_movement),
),
'move_ratio': move_ratio,
},
weight=1,
enabled=True,
files=('*',
),
),
TrackpadTestFunctionality(
name='two_fingers_select',
subname=(('physical_click', 'tap_and_half'),
('left', 'right', 'up', 'down'),
),
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} along ' \
'half of the surface of the trackpad.',
subprompt={
'physical_click': ('physical click',),
'tap_and_half': ('tap & a half',),
'left': ('left',),
'right': ('right',),
'up': ('up',),
'down': ('down',),
},
area=area[1],
criteria={
'sequence': (('Motion', '<=', click_movement),
('ButtonPress', 'Button Left'),
('Motion_x_or_y', '>=', select_drag_distance),
('ButtonRelease', 'Button Left'),
('Motion', '<=', click_movement),
),
'move_ratio': move_ratio,
},
weight=1,
enabled=True,
files=('*',
),
),
TrackpadTestFunctionality(
name='two_fingers_lifted',
subname=(('physical_click', 'tap_and_half'),
('left', 'right', 'up', 'down'),
),
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} along ' \
'half of the surface of the trackpad. Lift your finger for ' \
'a while and then drag {1} again along half of the surface.',
subprompt={
'physical_click': ('physical click',),
'tap_and_half': ('tap & a half',),
'left': ('left',),
'right': ('right',),
'up': ('up',),
'down': ('down',),
},
area=area[1],
criteria={
'sequence': (('Motion', '<=', click_movement),
('ButtonPress', 'Button Left'),
('Motion_x_or_y', '>=', select_drag_distance),
('NOP', '2nd Finger Lifted'),
('Motion_x_or_y', '>=', select_drag_distance),
('ButtonRelease', 'Button Left'),
('Motion', '<=', click_movement),
),
'move_ratio': move_ratio,
},
weight=1,
enabled=True,
files=('*',
),
),
TrackpadTestFunctionality(
name='two_fingers_no_delay',
subname=('left', 'right', 'up', 'down'),
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 {0}, and then release two fingers.',
subprompt={
'left': ('left',),
'right': ('right',),
'up': ('up',),
'down': ('down',),
},
area=area[1],
criteria={
'sequence': (('Motion', '<=', click_movement),
('ButtonPress', 'Button Left'),
('Motion_x_or_y', '>=', select_drag_distance),
('ButtonRelease', 'Button Left'),
('Motion', '<=', click_movement),
),
'delay': 0.2,
'move_ratio': move_ratio,
},
weight=1,
enabled=True,
files=('*',
),
),
### Area 2: 2 finger alternate/right click
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.',
subprompt={
'0.3': ('0.3',),
'1': ('1',),
'3': ('3',),
},
area=area[2],
criteria={
'max_movement': click_movement,
'button': ('Button Right', 1),
},
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 ' \
'(again, rely on Synaptics UX to know value), ' \
'an alternate/right click results',
prompt='1st finger generates a click, and 2nd finger rolls on' \
'within {0} seconds. Lift two fingers together.',
subprompt={
'300': ('300',),
},
area=area[2],
criteria={
'max_movement': click_movement,
'button': ('Button Right', 1),
},
weight=1,
enabled=True,
files=('*',
),
),
TrackpadTestFunctionality(
name='one_finger_tracking',
subname=('left', 'right', 'up', 'down'),
description='1 finger tracking, never leaves trackpad, 2f ' \
'arrives and there is a click. Right click results.',
prompt='1st finger drags {0} along half of the surface of trackpad, ' \
'never leaves trackpad, and then the 2nd finger arrives and ' \
'make a click. Lift two fingers together.',
subprompt={
'left': ('left',),
'right': ('right',),
'up': ('up',),
'down': ('down',),
},
area=area[2],
criteria={
'sequence': (('Motion', '>=', select_drag_distance),
('ButtonPress', 'Button Right'),
('Motion', '<=', click_movement),
('ButtonRelease', 'Button Right'),
('Motion', '<=', click_movement),
),
'move_ratio': move_ratio,
},
weight=1,
enabled=True,
files=('*',
),
),
### Area 3: 2 finger scroll
TrackpadTestFunctionality(
name='two_finger_scroll',
subname=('up', 'down'),
description='Vertical scroll, reflecting movement of finger(s)',
prompt='Use two fingers to scroll {0} exactly once.',
subprompt={
'up': ('up',),
'down': ('down',),
},
area=area[3],
criteria={
'max_movement': 0,
'button': (('Button Wheel Up', 10),
('Button Wheel Down', 10)), # up and down respectively
},
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 can be
generally omitted if any updated trackpad firmware provided by the
trackpad manufacturer does not affect the performance of the trackpad.
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:
two_finger_scroll.down-mario-john-20110407_185746.dat
'''
filename_attr = [
['prefix', 'DEFAULT'],
['model', 'DEFAULT'],
['firmware_version', None],
['tester', None],
['ext', 'dat']
]