summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-09-25 16:50:44 +0200
committerHans de Goede <hdegoede@redhat.com>2014-11-06 11:04:17 +0100
commit6699d1b637e67780fb5034e2648f492a8440b21b (patch)
tree5905086567b39fea7c8f776df6878bcd864a8cea /test
parent23031c8fd70a98ef32a80ded6299010ea5e732c2 (diff)
downloadlibinput-6699d1b637e67780fb5034e2648f492a8440b21b.tar.gz
touchpad: Add a test for 2fg tap-n-drag release on a 3th finger down
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/touchpad.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/test/touchpad.c b/test/touchpad.c
index fba1d58b..f9031dd9 100644
--- a/test/touchpad.c
+++ b/test/touchpad.c
@@ -239,6 +239,54 @@ START_TEST(touchpad_2fg_tap_n_drag)
}
END_TEST
+START_TEST(touchpad_2fg_tap_n_drag_3fg_btntool)
+{
+ struct litest_device *dev = litest_current_device();
+ struct libinput *li = dev->libinput;
+ struct libinput_event *event;
+
+ libinput_device_config_tap_set_enabled(dev->libinput_device,
+ LIBINPUT_CONFIG_TAP_ENABLED);
+
+ litest_drain_events(li);
+
+ litest_touch_down(dev, 0, 50, 50);
+ litest_touch_up(dev, 0);
+ litest_touch_down(dev, 0, 50, 50);
+ litest_touch_down(dev, 1, 60, 50);
+ litest_touch_move_to(dev, 0, 50, 50, 80, 80, 5, 40);
+ libinput_dispatch(li);
+
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+
+ while (libinput_next_event_type(li) == LIBINPUT_EVENT_POINTER_MOTION) {
+ event = libinput_get_event(li);
+ libinput_event_destroy(event);
+ libinput_dispatch(li);
+ }
+ litest_assert_empty_queue(li);
+
+ /* Putting down a third finger should end the drag */
+ litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 1);
+ litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 0);
+ litest_event(dev, EV_SYN, SYN_REPORT, 0);
+ libinput_dispatch(li);
+
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+
+ /* Releasing the fingers should not cause any events */
+ litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 0);
+ litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 1);
+ litest_event(dev, EV_SYN, SYN_REPORT, 0);
+ litest_touch_up(dev, 1);
+ litest_touch_up(dev, 0);
+
+ litest_assert_empty_queue(li);
+}
+END_TEST
+
START_TEST(touchpad_2fg_tap)
{
struct litest_device *dev = litest_current_device();
@@ -1974,6 +2022,7 @@ int main(int argc, char **argv) {
litest_add("touchpad:tap", touchpad_1fg_tap_n_drag, LITEST_TOUCHPAD, LITEST_ANY);
litest_add("touchpad:tap", touchpad_1fg_tap_n_drag_timeout, LITEST_TOUCHPAD, LITEST_ANY);
litest_add("touchpad:tap", touchpad_2fg_tap_n_drag, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
+ litest_add("touchpad:tap", touchpad_2fg_tap_n_drag_3fg_btntool, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH|LITEST_APPLE_CLICKPAD);
litest_add("touchpad:tap", touchpad_2fg_tap, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
litest_add("touchpad:tap", touchpad_2fg_tap_inverted, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
litest_add("touchpad:tap", touchpad_1fg_tap_click, LITEST_TOUCHPAD, LITEST_CLICKPAD);