blob: 36dd09be8943f0ec192363d8075a50a0bef5c151 [file] [log] [blame] [edit]
# -*- 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
'''
import trackpad_util
''' Path definitions '''
# trackpad_test_data: specifies the top directory for whole trackpad test data
trackpad_test_data = '/var/tmp/trackpad_test_data'
# gesture_files_path_root: specifies the root directory saving the test files
gesture_files_path_root = trackpad_test_data + '/test_files'
# gesture_files_path: specifies the path (symbolic link) for autotest
gesture_files_path = gesture_files_path_root + '/work'
# gesture_files_path_latest: specifies the latest path (symbolic link)
# When performing gesture recording, this link points to the latest created
# user gesture file path. This symbolic is updated whenver there is a new user
# gesture file path created.
gesture_files_path_latest = gesture_files_path_root + '/latest'
# gesture_files_path_autotest: specifies the autotest path (symbolic link)
# used when performing autotest. As default, it points to the same directory
# as latest; however, it could be overwritten dynamically in order to run
# autotest on different user file path.
gesture_files_path_autotest = gesture_files_path_root + '/autotest'
# gesture_files_subpath_regression: specifies the relative subpath
# to the hardware_Trackpad directory for regresion test
# The regression test could be either a short or long test.
model = trackpad_util.get_model()
gesture_files_subpath = 'data/gestures'
gesture_files_subpath_regression = os.path.join(gesture_files_subpath, model)
regression_subset_list = ['short', 'long']
regression_default_subset = 'short'
# Define the gesture sets for 'long' and 'short' regression test on various
# platforms. For now, the two sets are the same. The short regression gesture
# set is a subset of the long one.
regression_gesture_sets = {
'long': {'mario': 'user_20120425_071603',
'zgb': 'user_20120426_124823',
'alex': 'user_20120430_114727',
'lumpy': 'user_20120426_071316',
},
'short': {'mario': 'user_20120425_071603',
'zgb': 'user_20120426_124823',
'alex': 'trackpad_user_study_short',
'lumpy': 'user_20120426_071316',
},
}
# Define the file to look up the gestures used in short/long regression test
regression_gestures_dict = {
'long': None,
'short': os.path.join(gesture_files_subpath, 'regression_gestures_short'),
}
# gesture_files_path_work: specifies the working path used for downloading
# files from storage server
gesture_files_path_work= gesture_files_path_root + '/work'
# gesture_files_path_results: path of the test results
gesture_files_path_results = trackpad_test_data + '/results'
# 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 to find trackpad device in xinput '''
xinput_trackpad_string = ('touchpad', 'trackpad', 'cyapa')
''' Parameters for Xcapture '''
xcapture_timeout = 1
xcapture_max_post_replay_time = 20
mtplot_gui = False
''' 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 = 100
# 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 = 20
# max accumulated button wheel events allowed
max_button_wheel_mixed = 15
# the min distance of finger tracking
tracking_distance = 20
# motion trace buffer for clicks
motion_trace_before = 6
motion_trace_after = 6
TRACE_FOR_10_MINS = 80 * 60 * 10
LONG_MOTION_TRACE = TRACE_FOR_10_MINS
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),
#
# Mark off the following two new rules. Enable them when the
# new method button_dev is stable.
#
# Criteria for physical_click
#'button_dev(physical_click)': (
# ('NOP', ('Finger On', True)),
# ('NOP', ('Device Mouse Click Press', True)),
# ('NOP', ('Device Mouse Click Release', True)),
# ('NOP', ('One Finger On', True)),
# ('NOP', ('Two Fingers On', False)),
# ('NOP', ('Three Fingers On', False)),
# ('NOP', ('Four Fingers On', False)),
# ('Motion', '<=', 0),
# ('Button', 'Button Left'),
# ('NOP', ('Finger Off', 'DONTCARE')),
#),
#
# Criteria for tap: using the old method
#'total_movement(tap)': ('Motion', '==', 0),
#'button(tap)': ('Button Left', '==', 5),
#
# button_dev method for tap is not supported yet.
# Uncomment the following rules when it is ready.
#
#'button_dev(tap)': (
# ('NOP', ('Finger On', True)),
# ('NOP', ('Device Mouse Click Press', False)),
# ('NOP', ('Device Mouse Click Release', False)),
# ('NOP', ('One Finger On', True)),
# ('NOP', ('Two Fingers On', False)),
# ('NOP', ('Three Fingers On', False)),
# ('NOP', ('Four Fingers On', False)),
# ('Motion', '<=', 0),
# ('Button', 'Button Left'),
# ('NOP', ('Finger Off', 'DONTCARE')),
#),
},
weight=1,
enabled=True,
files=('*',
),
),
TrackpadTestFunctionality(
name='drum_roll',
subname=(('click', 'tap',),
('l1r1',),
),
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='Alternate {0} with {1} for about 5 seconds.',
subprompt={
'click': ('clicking',),
'tap': ('tapping',),
'l1r1': ('2 different fingers',),
},
area=area[0],
criteria={
'total_movement': ('Motion', '==', 0),
},
weight=1,
enabled=True,
files=('*',
),
),
TrackpadTestFunctionality(
name='drum_roll0',
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),
},
weight=1,
enabled=False,
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'),
),
},
#
# Mark off the follow new rules. Enable them when they are stable.
#
#criteria={
# 'button_segment(physical_click)': (
# ('accept_1st_gesture_only', False),
# ('NOP', ('Device Mouse Click Press', 'before', True)),
# ('NOP', ('Device Mouse Click Release', 'between', True)),
# ('Button', 'Button Left'),
# ('Motion', '>=', select_drag_distance),
# ),
# 'button_segment(tap_and_half)': (
# ('accept_1st_gesture_only', False),
# ('Button', 'Button Left'),
# ('Motion', '>=', select_drag_distance),
# ),
#},
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=False,
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=False,
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=False,
files=('*',
),
),
TrackpadTestFunctionality(
name='two_fingers_lifted_2d',
subname=('physical_click', 'tap_and_half'),
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 in '
'some direction without the finger leaving the trackpad. '
'Lift your 2nd finger for a while and then use your 2nd finger '
'to drag one more time. Lift both fingers when finished.',
subprompt={
'physical_click': ('physical click',),
'tap_and_half': ('tap & a half',),
},
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'),
),
},
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=False,
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=('1',),
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. Click with those fingers. '
'Lift the fingers together. ',
subprompt={
'1': ('1',),
},
area=area[2],
criteria={
'total_movement': ('Motion', '<=', click_movement),
'button': ('Button Right', '==', 1),
},
weight=1,
enabled=True,
files=('*',
),
),
TrackpadTestFunctionality(
name='x_seconds_interval3',
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 and makes a physical click. 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=False,
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 moves 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_finger0',
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=False,
files=('*',
),
),
TrackpadTestFunctionality(
name='basic_two_finger',
subname=('up', 'down', 'left', 'right'),
description='Basic two-finger scroll should work.',
prompt='Use two finger to scroll {0}.',
subprompt={
'up': ('from bottom to top',),
'down': ('from top to bottom',),
'left': ('from right to left',),
'right': ('from left to right',),
},
area=area[3],
criteria={
'total_movement': ('Motion', '==', 0),
'button': ('Button Wheel', '>=', 10),
},
weight=1,
enabled=False,
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=False,
files=('*',
),
),
TrackpadTestFunctionality(
name='2nd_finger_vertical',
subname=(('up', 'down'),
('above', 'same_y', 'below'),
),
description='1st finger contacts trackpad, 2nd finger '
'moves vertically and scroll mirrors that movement',
prompt='Touch the trackpad with one finger, and move 2nd finger '
'from {1} the 1st finger to move {0} to the edge.',
subprompt={
'up': ('up',),
'down': ('down',),
'above': ('above',),
'same_y': ('the same y (row) as',),
'below': ('below',),
},
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'),
('left_of', 'same_x', 'right_of'),
),
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 '
'from {1} the 1st finger to move {0} to the edge.',
subprompt={
'left': ('left',),
'right': ('right',),
'left_of': ('the left of',),
'same_x': ('the same x (column) as',),
'right_of': ('the right of',),
},
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',),
),
description='1st: Two fingers moving near parallel result in scroll',
prompt='Use two fingers spacing naturally {1} to scroll {0}. ',
subprompt={
'up': ('from bottom to top',),
'down': ('from top to bottom',),
'left': ('from right to left',),
'right': ('from left to right',),
'parallel': ('in parallel',),
},
area=area[3],
criteria={
'total_movement': ('Motion', '==', 0),
'button': ('Button Wheel', '>=', 10),
},
weight=1,
enabled=True,
files=('*',
),
),
TrackpadTestFunctionality(
name='near_parallel0',
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=False,
files=('*',
),
),
TrackpadTestFunctionality(
name='2nd_finger_vertical0',
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={
# TODO(josephsih): Before 2nd finger touching, there could be some
# movements generated by first finger. Detect the movement only
# after 2nd finger touching.
# Same for '2nd_finger_horizontal' below.
'total_movement': ('Motion', '==', 0),
'button': ('Button Wheel', '>=', 10),
},
weight=1,
enabled=False,
files=('*',
),
),
TrackpadTestFunctionality(
name='2nd_finger_horizontal0',
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=False,
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=False,
files=('*',
),
),
TrackpadTestFunctionality(
name='finger_spacing',
subname=(('up', 'down'),
('close', 'proper'),
('parallel', 'inline'),
),
description='Scroll should occur regardless of spacing '
'(close or distant) between fingers',
prompt='Use two fingers {1} {2} to scroll {0}.',
subprompt={
'up': ('from bottom to top',),
'down': ('from top to bottom',),
'close': ('contacting together',),
'proper': ('spacing naturally',),
'parallel': ('in parallel',),
'inline': ('in a vertical line',),
},
area=area[3],
criteria={
'total_movement': ('Motion', '==', 0),
'button': ('Button Wheel', '>=', 10),
},
weight=1,
enabled=True,
files=('*',
),
),
TrackpadTestFunctionality(
name='finger_spacing0',
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=False,
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 3~4 '
'seconds. Lift the fingers.\n '
'(2) Use two fingers to scroll {0} again at a fast speed '
'for about 1 second. Then lift fingers.\n ',
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_vertical0',
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=False,
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 3~4 '
'seconds. Lift the fingers.\n '
'(2) Use two fingers to scroll {0} again at a fast speed '
'for about 1 second. Then lift fingers.\n ',
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='reflect_horizontal0',
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=False,
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 steadily {0} to the bezel edge.',
subprompt={
'up': ('from bottom to top',),
'down': ('from top to bottom',),
'left': ('from right to left',),
'right': ('from left to right',),
},
area=area[3],
# TODO(josephsih): there are no proper criteria yet.
# The idea is that it at least needs to meet two criteria:
# (1) the scroll valuators divided by interarrival times should be
# consistent.
# (2) The interarrival times should be consistent.
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': ('hovering above',),
},
area=area[4],
criteria={
'total_movement': ('Motion', '<=', palm_movement),
'button': None,
},
weight=1,
enabled=True,
files=('*',
),
),
TrackpadTestFunctionality(
name='hovering_thumb2',
subname=('click',),
description='A thumb is used as an additional finger to make an '
'unintended gesture. The most basic example is a thumb '
'resting on the bottom quarter of a trackpad and a '
'pointer finger tracking resulting in an unwanted 2 '
'finger scroll. The most common way to force reproduction '
'of this case is to put users in the scenario that many '
'fall into - thumb clicking followed by a gesture '
'(1f tracking or 2f scrolling).',
prompt='Use thumb to click on the Chrome logo, then use your index '
'finger to move to the blue square and then move to the '
'yellow diamond.',
subprompt=None,
area=area[4],
criteria={
'total_movement': ('Motion', '>=', tracking_distance),
'button': ('Button Left', '==', 1),
},
weight=1,
enabled=False,
files=('*',
),
),
TrackpadTestFunctionality(
name='palm_pointing',
subname=(('upper', 'lower'),
('left', 'right',),
),
description='Example: Palm sitting on any part of '
'trackpad, primary finger comes in contact with '
'and moves on trackpad: Pointing should occur rather '
'than scrolling or clicking.',
prompt='Place your {1} palm on the {0} part of trackpad. Use primary '
'finger of the other hand to move in arbitrary directions for a '
'few second. Then lift the finger and palm.',
subprompt={
'upper': ('upper',),
'lower': ('lower',),
'left': ('left',),
'right': ('right',),
},
area=area[4],
criteria={
'total_movement': ('Motion', '>=', tracking_distance),
'button': None,
},
weight=1,
enabled=True,
files=('*',
),
),
TrackpadTestFunctionality(
name='thumb_pointing',
subname=('left', 'right',),
description='Example: thumb sitting on bottom edge of '
'trackpad, primary finger comes in contact with '
'and moves on trackpad: Pointing should occur rather '
'than scrolling or clicking.',
prompt='Place your {0} thumb on the bottom ¼ of trackpad. Use primary '
'finger to move in arbitrary directions for a few second. '
'Then lift both fingers.',
subprompt={
'left': ('left',),
'right': ('right',),
},
area=area[4],
criteria={
'total_movement': ('Motion', '>=', tracking_distance),
'button': None,
},
weight=1,
enabled=True,
files=('*',
),
),
TrackpadTestFunctionality(
name='pointing0',
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=False,
files=('*',
),
),
TrackpadTestFunctionality(
name='palm_scroll',
subname=(('upper', 'lower'),
('left', 'right',),
('up', 'down',),
),
description='Example: Palm/thumb sitting on bottom edge of '
'trackpad while two fingers move in parallel on '
'trackpad: Scroll should result',
prompt='Place your {1} palm on the {0} part of trackpad. Use two '
'fingers to scroll {2}. Then lift both fingers and palm.',
subprompt={
'upper': ('upper',),
'lower': ('lower',),
'left': ('left',),
'right': ('right',),
'up': ('up',),
'down': ('down',),
},
area=area[4],
criteria={
'total_movement': ('Motion', '<=', palm_movement),
'button': ('Button Wheel', '>=', 10),
},
weight=1,
enabled=True,
files=('*',
),
),
TrackpadTestFunctionality(
name='thumb_scroll',
subname=(('left', 'right',),
('up', 'down',),
),
description='Example: Palm/thumb sitting on bottom edge of '
'trackpad while two fingers move in parallel on '
'trackpad: Scroll should result',
prompt='Place your {0} thumb on the bottom ¼ of trackpad. Use two '
'fingers to scroll {1}. Then lift all fingers.',
subprompt={
'left': ('left',),
'right': ('right',),
'up': ('up',),
'down': ('down',),
},
area=area[4],
criteria={
'total_movement': ('Motion', '<=', palm_movement),
'button': ('Button Wheel', '>=', 10),
},
weight=1,
enabled=True,
files=('*',
),
),
TrackpadTestFunctionality(
name='scroll0',
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=False,
files=('*',
),
),
TrackpadTestFunctionality(
name='palm_click',
subname=(('upper', 'lower'),
('left', 'right',),
),
description='Example: Palm/thumb sitting on bottom edge of trackpad '
'while primary finger clicks: Primary click results '
'rather than alternate click',
prompt='Place your {1} palm on the {0} part of trackpad. Use primary '
'finger to make 5 clicks without lifting the palm.',
subprompt={
'upper': ('upper',),
'lower': ('lower',),
'left': ('left',),
'right': ('right',),
},
area=area[4],
criteria={
'total_movement': ('Motion', '<=', palm_movement),
'button': ('Button Left', '==', 5),
},
weight=1,
enabled=True,
files=('*',
),
),
TrackpadTestFunctionality(
name='thumb_click',
subname=('left', 'right',),
description='Example: Palm/thumb sitting on bottom edge of trackpad '
'while primary finger clicks: Primary click results '
'rather than alternate click',
prompt='Place your {0} thumb on the bottom ¼ of trackpad. Use primary '
'finger to make 5 clicks without lifting the thumb.',
subprompt={
'left': ('left',),
'right': ('right',),
},
area=area[4],
criteria={
'total_movement': ('Motion', '<=', palm_movement),
'button': ('Button Left', '==', 5),
},
weight=1,
enabled=True,
files=('*',
),
),
TrackpadTestFunctionality(
name='click0',
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=False,
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']
]