[PATCH libinput 2/3] test: add one more test for two-finger tapping

Peter Hutterer peter.hutterer at who-t.net
Sun Jun 22 16:36:33 PDT 2014


Inverted order of release from the other test

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 test/touchpad.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/test/touchpad.c b/test/touchpad.c
index 690e105..ca0a700 100644
--- a/test/touchpad.c
+++ b/test/touchpad.c
@@ -210,6 +210,30 @@ START_TEST(touchpad_2fg_tap)
 }
 END_TEST
 
+START_TEST(touchpad_2fg_tap_inverted)
+{
+	struct litest_device *dev = litest_current_device();
+	struct libinput *li = dev->libinput;
+
+	litest_drain_events(dev->libinput);
+
+	litest_touch_down(dev, 0, 50, 50);
+	litest_touch_down(dev, 1, 70, 70);
+	litest_touch_up(dev, 1);
+	litest_touch_up(dev, 0);
+
+	libinput_dispatch(li);
+
+	assert_button_event(li, BTN_RIGHT,
+			    LIBINPUT_BUTTON_STATE_PRESSED);
+	msleep(300); /* tap-n-drag timeout */
+	assert_button_event(li, BTN_RIGHT,
+			    LIBINPUT_BUTTON_STATE_RELEASED);
+
+	litest_assert_empty_queue(li);
+}
+END_TEST
+
 START_TEST(touchpad_1fg_tap_click)
 {
 	struct litest_device *dev = litest_current_device();
@@ -1010,6 +1034,7 @@ int main(int argc, char **argv) {
 	litest_add("touchpad:tap", touchpad_1fg_tap, LITEST_TOUCHPAD, LITEST_ANY);
 	litest_add("touchpad:tap", touchpad_1fg_tap_n_drag, LITEST_TOUCHPAD, LITEST_ANY);
 	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_ANY);
 	litest_add("touchpad:tap", touchpad_2fg_tap_click, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH|LITEST_APPLE_CLICKPAD);
 	litest_add("touchpad:tap", touchpad_2fg_tap_click_apple, LITEST_APPLE_CLICKPAD, LITEST_ANY);
-- 
1.9.3



More information about the wayland-devel mailing list