From: Hans de Goede Date: Thu, 25 Sep 2014 14:50:44 +0000 (+0200) Subject: touchpad: Add a test for 2fg tap-n-drag release on a 3th finger down X-Git-Tag: 0.7.0~67^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6699d1b637e67780fb5034e2648f492a8440b21b;p=platform%2Fupstream%2Flibinput.git touchpad: Add a test for 2fg tap-n-drag release on a 3th finger down Signed-off-by: Hans de Goede --- diff --git a/test/touchpad.c b/test/touchpad.c index fba1d58..f9031dd 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);