[PATCH libinput 2/6] test: split 1fg touchpad tap tests into a separate binary
Peter Hutterer
peter.hutterer at who-t.net
Tue Jul 19 03:18:53 UTC 2016
This is one of the longest-running test suites, split it out so we can run it
in parallel with the other tap tests.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
test/Makefile.am | 5 +
test/touchpad-tap-1fg.c | 965 ++++++++++++++++++++++++++++++++++++++++++++++++
test/touchpad-tap.c | 924 ----------------------------------------------
3 files changed, 970 insertions(+), 924 deletions(-)
create mode 100644 test/touchpad-tap-1fg.c
diff --git a/test/Makefile.am b/test/Makefile.am
index f2c09bf..be9c1df 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -80,6 +80,7 @@ endif
run_tests = \
touchpad.test \
touchpad-tap.test \
+ touchpad-tap-1fg.test \
touchpad-buttons.test \
pad.test \
tablet.test \
@@ -144,6 +145,10 @@ touchpad_tap_test_SOURCES = touchpad-tap.c
touchpad_tap_test_LDADD = $(TEST_LIBS)
touchpad_tap_test_LDFLAGS = -no-install
+touchpad_tap_1fg_test_SOURCES = touchpad-tap-1fg.c
+touchpad_tap_1fg_test_LDADD = $(TEST_LIBS)
+touchpad_tap_1fg_test_LDFLAGS = -no-install
+
touchpad_buttons_test_SOURCES = touchpad-buttons.c
touchpad_buttons_test_LDADD = $(TEST_LIBS)
touchpad_buttons_test_LDFLAGS = -no-install
diff --git a/test/touchpad-tap-1fg.c b/test/touchpad-tap-1fg.c
new file mode 100644
index 0000000..5886c3a
--- /dev/null
+++ b/test/touchpad-tap-1fg.c
@@ -0,0 +1,965 @@
+/*
+ * Copyright © 2014-2015 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <config.h>
+
+#include <check.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <libinput.h>
+#include <unistd.h>
+
+#include "libinput-util.h"
+#include "litest.h"
+
+START_TEST(touchpad_1fg_tap)
+{
+ struct litest_device *dev = litest_current_device();
+ struct libinput *li = dev->libinput;
+ struct libinput_event *event;
+
+ litest_enable_tap(dev->libinput_device);
+
+ litest_drain_events(li);
+
+ litest_touch_down(dev, 0, 50, 50);
+ litest_touch_up(dev, 0);
+
+ libinput_dispatch(li);
+
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ litest_timeout_tap();
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+
+ libinput_dispatch(li);
+ event = libinput_get_event(li);
+ ck_assert(event == NULL);
+}
+END_TEST
+
+START_TEST(touchpad_1fg_doubletap)
+{
+ struct litest_device *dev = litest_current_device();
+ struct libinput *li = dev->libinput;
+ struct libinput_event *event;
+ struct libinput_event_pointer *ptrev;
+ uint32_t oldtime, curtime;
+
+ litest_enable_tap(dev->libinput_device);
+
+ 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_up(dev, 0);
+ libinput_dispatch(li);
+
+ litest_timeout_tap();
+
+ libinput_dispatch(li);
+ event = libinput_get_event(li);
+ ptrev = litest_is_button_event(event,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ oldtime = libinput_event_pointer_get_time(ptrev);
+ libinput_event_destroy(event);
+
+ event = libinput_get_event(li);
+ ptrev = litest_is_button_event(event,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+ curtime = libinput_event_pointer_get_time(ptrev);
+ libinput_event_destroy(event);
+ ck_assert_int_le(oldtime, curtime);
+
+ event = libinput_get_event(li);
+ ptrev = litest_is_button_event(event,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ curtime = libinput_event_pointer_get_time(ptrev);
+ libinput_event_destroy(event);
+ ck_assert_int_lt(oldtime, curtime);
+ oldtime = curtime;
+
+ event = libinput_get_event(li);
+ ptrev = litest_is_button_event(event,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+ curtime = libinput_event_pointer_get_time(ptrev);
+ libinput_event_destroy(event);
+ ck_assert_int_le(oldtime, curtime);
+
+ litest_assert_empty_queue(li);
+}
+END_TEST
+
+START_TEST(touchpad_1fg_multitap)
+{
+ struct litest_device *dev = litest_current_device();
+ struct libinput *li = dev->libinput;
+ struct libinput_event *event;
+ struct libinput_event_pointer *ptrev;
+ uint32_t oldtime = 0,
+ curtime;
+ int range = _i, /* looped test */
+ ntaps;
+
+ litest_enable_tap(dev->libinput_device);
+
+ litest_drain_events(li);
+
+ for (ntaps = 0; ntaps <= range; ntaps++) {
+ litest_touch_down(dev, 0, 50, 50);
+ litest_touch_up(dev, 0);
+ libinput_dispatch(li);
+ msleep(10);
+ }
+
+ litest_timeout_tap();
+ libinput_dispatch(li);
+
+ for (ntaps = 0; ntaps <= range; ntaps++) {
+ event = libinput_get_event(li);
+ ptrev = litest_is_button_event(event,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ curtime = libinput_event_pointer_get_time(ptrev);
+ libinput_event_destroy(event);
+ ck_assert_int_gt(curtime, oldtime);
+
+ event = libinput_get_event(li);
+ ptrev = litest_is_button_event(event,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+ curtime = libinput_event_pointer_get_time(ptrev);
+ libinput_event_destroy(event);
+ ck_assert_int_ge(curtime, oldtime);
+ oldtime = curtime;
+ }
+ litest_timeout_tap();
+ litest_assert_empty_queue(li);
+}
+END_TEST
+
+START_TEST(touchpad_1fg_multitap_n_drag_move)
+{
+ struct litest_device *dev = litest_current_device();
+ struct libinput *li = dev->libinput;
+ struct libinput_event *event;
+ struct libinput_event_pointer *ptrev;
+ uint32_t oldtime = 0,
+ curtime;
+ int range = _i, /* looped test */
+ ntaps;
+
+ litest_enable_tap(dev->libinput_device);
+
+ litest_drain_events(li);
+
+ for (ntaps = 0; ntaps <= range; ntaps++) {
+ litest_touch_down(dev, 0, 50, 50);
+ litest_touch_up(dev, 0);
+ libinput_dispatch(li);
+ msleep(10);
+ }
+
+ libinput_dispatch(li);
+ litest_touch_down(dev, 0, 50, 50);
+ litest_touch_move_to(dev, 0, 50, 50, 70, 50, 10, 4);
+ libinput_dispatch(li);
+
+ for (ntaps = 0; ntaps < range; ntaps++) {
+ event = libinput_get_event(li);
+ ptrev = litest_is_button_event(event,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ curtime = libinput_event_pointer_get_time(ptrev);
+ libinput_event_destroy(event);
+ ck_assert_int_gt(curtime, oldtime);
+
+ event = libinput_get_event(li);
+ ptrev = litest_is_button_event(event,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+ curtime = libinput_event_pointer_get_time(ptrev);
+ libinput_event_destroy(event);
+ ck_assert_int_ge(curtime, oldtime);
+ oldtime = curtime;
+ }
+
+ event = libinput_get_event(li);
+ ptrev = litest_is_button_event(event,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ curtime = libinput_event_pointer_get_time(ptrev);
+ libinput_event_destroy(event);
+ ck_assert_int_gt(curtime, oldtime);
+
+ litest_assert_only_typed_events(li,
+ LIBINPUT_EVENT_POINTER_MOTION);
+
+ litest_touch_up(dev, 0);
+ litest_assert_button_event(li,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+
+ litest_assert_empty_queue(li);
+}
+END_TEST
+
+START_TEST(touchpad_1fg_multitap_n_drag_2fg)
+{
+ struct litest_device *dev = litest_current_device();
+ struct libinput *li = dev->libinput;
+ struct libinput_event *event;
+ struct libinput_event_pointer *ptrev;
+ uint32_t oldtime = 0,
+ curtime;
+ int range = _i,
+ ntaps;
+
+ if (libevdev_has_property(dev->evdev, INPUT_PROP_SEMI_MT))
+ return;
+
+ litest_enable_tap(dev->libinput_device);
+
+ litest_drain_events(li);
+
+ for (ntaps = 0; ntaps <= range; ntaps++) {
+ litest_touch_down(dev, 0, 50, 50);
+ litest_touch_up(dev, 0);
+ libinput_dispatch(li);
+ msleep(10);
+ }
+
+ libinput_dispatch(li);
+ litest_touch_down(dev, 0, 50, 50);
+ msleep(10);
+ litest_touch_down(dev, 1, 70, 50);
+ libinput_dispatch(li);
+
+ for (ntaps = 0; ntaps < range; ntaps++) {
+ event = libinput_get_event(li);
+ ptrev = litest_is_button_event(event,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ curtime = libinput_event_pointer_get_time(ptrev);
+ libinput_event_destroy(event);
+ ck_assert_int_gt(curtime, oldtime);
+
+ event = libinput_get_event(li);
+ ptrev = litest_is_button_event(event,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+ curtime = libinput_event_pointer_get_time(ptrev);
+ libinput_event_destroy(event);
+ ck_assert_int_ge(curtime, oldtime);
+ oldtime = curtime;
+ }
+
+ event = libinput_get_event(li);
+ ptrev = litest_is_button_event(event,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ curtime = libinput_event_pointer_get_time(ptrev);
+ libinput_event_destroy(event);
+ ck_assert_int_gt(curtime, oldtime);
+
+ litest_touch_move_to(dev, 1, 70, 50, 90, 50, 10, 4);
+
+ litest_assert_only_typed_events(li,
+ LIBINPUT_EVENT_POINTER_MOTION);
+
+ litest_touch_up(dev, 1);
+ litest_touch_up(dev, 0);
+ litest_timeout_tap();
+ litest_assert_button_event(li,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+
+ litest_assert_empty_queue(li);
+}
+END_TEST
+
+START_TEST(touchpad_1fg_multitap_n_drag_click)
+{
+ struct litest_device *dev = litest_current_device();
+ struct libinput *li = dev->libinput;
+ struct libinput_event *event;
+ struct libinput_event_pointer *ptrev;
+ uint32_t oldtime = 0,
+ curtime;
+ int range = _i, /* looped test */
+ ntaps;
+
+ litest_enable_tap(dev->libinput_device);
+
+ litest_drain_events(li);
+
+ for (ntaps = 0; ntaps <= range; ntaps++) {
+ litest_touch_down(dev, 0, 50, 50);
+ litest_touch_up(dev, 0);
+ libinput_dispatch(li);
+ msleep(10);
+ }
+
+ litest_touch_down(dev, 0, 50, 50);
+ libinput_dispatch(li);
+ litest_button_click(dev, BTN_LEFT, true);
+ litest_button_click(dev, BTN_LEFT, false);
+ libinput_dispatch(li);
+
+ for (ntaps = 0; ntaps <= range; ntaps++) {
+ event = libinput_get_event(li);
+ ptrev = litest_is_button_event(event,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ curtime = libinput_event_pointer_get_time(ptrev);
+ libinput_event_destroy(event);
+ ck_assert_int_gt(curtime, oldtime);
+
+ event = libinput_get_event(li);
+ ptrev = litest_is_button_event(event,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+ curtime = libinput_event_pointer_get_time(ptrev);
+ libinput_event_destroy(event);
+ ck_assert_int_ge(curtime, oldtime);
+ oldtime = curtime;
+ }
+
+ litest_assert_button_event(li,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ litest_assert_button_event(li,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+ litest_touch_up(dev, 0);
+ litest_timeout_tap();
+
+ litest_assert_empty_queue(li);
+}
+END_TEST
+
+START_TEST(touchpad_1fg_multitap_n_drag_timeout)
+{
+ struct litest_device *dev = litest_current_device();
+ struct libinput *li = dev->libinput;
+ struct libinput_event *event;
+ struct libinput_event_pointer *ptrev;
+ uint32_t oldtime = 0,
+ curtime;
+ int range = _i, /* looped test */
+ ntaps;
+
+ litest_enable_tap(dev->libinput_device);
+
+ litest_drain_events(li);
+
+ for (ntaps = 0; ntaps <= range; ntaps++) {
+ litest_touch_down(dev, 0, 50, 50);
+ litest_touch_up(dev, 0);
+ libinput_dispatch(li);
+ msleep(10);
+ }
+
+ libinput_dispatch(li);
+ litest_touch_down(dev, 0, 50, 50);
+ libinput_dispatch(li);
+
+ litest_timeout_tap();
+ libinput_dispatch(li);
+
+ for (ntaps = 0; ntaps < range; ntaps++) {
+ event = libinput_get_event(li);
+ ptrev = litest_is_button_event(event,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ curtime = libinput_event_pointer_get_time(ptrev);
+ libinput_event_destroy(event);
+ ck_assert_int_gt(curtime, oldtime);
+
+ event = libinput_get_event(li);
+ ptrev = litest_is_button_event(event,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+ curtime = libinput_event_pointer_get_time(ptrev);
+ libinput_event_destroy(event);
+ ck_assert_int_ge(curtime, oldtime);
+ oldtime = curtime;
+ }
+
+ event = libinput_get_event(li);
+ ptrev = litest_is_button_event(event,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ curtime = libinput_event_pointer_get_time(ptrev);
+ libinput_event_destroy(event);
+ ck_assert_int_gt(curtime, oldtime);
+
+ litest_touch_move_to(dev, 0, 50, 50, 70, 50, 10, 4);
+
+ litest_assert_only_typed_events(li,
+ LIBINPUT_EVENT_POINTER_MOTION);
+
+ litest_touch_up(dev, 0);
+ litest_assert_button_event(li,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+
+ litest_assert_empty_queue(li);
+}
+END_TEST
+
+START_TEST(touchpad_1fg_multitap_n_drag_tap)
+{
+ struct litest_device *dev = litest_current_device();
+ struct libinput *li = dev->libinput;
+ struct libinput_event *event;
+ struct libinput_event_pointer *ptrev;
+ uint32_t oldtime = 0,
+ curtime;
+ int range = _i, /* looped test */
+ ntaps;
+
+ litest_enable_tap(dev->libinput_device);
+ litest_enable_drag_lock(dev->libinput_device);
+
+ litest_drain_events(li);
+
+ for (ntaps = 0; ntaps <= range; ntaps++) {
+ litest_touch_down(dev, 0, 50, 50);
+ litest_touch_up(dev, 0);
+ libinput_dispatch(li);
+ msleep(10);
+ }
+
+ libinput_dispatch(li);
+ litest_touch_down(dev, 0, 50, 50);
+ libinput_dispatch(li);
+
+ litest_timeout_tap();
+ libinput_dispatch(li);
+
+ for (ntaps = 0; ntaps < range; ntaps++) {
+ event = libinput_get_event(li);
+ ptrev = litest_is_button_event(event,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ curtime = libinput_event_pointer_get_time(ptrev);
+ libinput_event_destroy(event);
+ ck_assert_int_gt(curtime, oldtime);
+
+ event = libinput_get_event(li);
+ ptrev = litest_is_button_event(event,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+ curtime = libinput_event_pointer_get_time(ptrev);
+ libinput_event_destroy(event);
+ ck_assert_int_ge(curtime, oldtime);
+ oldtime = curtime;
+ }
+
+ event = libinput_get_event(li);
+ ptrev = litest_is_button_event(event,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ curtime = libinput_event_pointer_get_time(ptrev);
+ libinput_event_destroy(event);
+ ck_assert_int_gt(curtime, oldtime);
+
+ litest_touch_move_to(dev, 0, 50, 50, 70, 50, 10, 4);
+
+ litest_assert_only_typed_events(li,
+ LIBINPUT_EVENT_POINTER_MOTION);
+
+ litest_touch_up(dev, 0);
+ litest_touch_down(dev, 0, 70, 50);
+ litest_touch_up(dev, 0);
+ litest_assert_button_event(li,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+
+ litest_assert_empty_queue(li);
+}
+END_TEST
+
+START_TEST(touchpad_1fg_multitap_n_drag_tap_click)
+{
+ struct litest_device *dev = litest_current_device();
+ struct libinput *li = dev->libinput;
+ struct libinput_event *event;
+ struct libinput_event_pointer *ptrev;
+ uint32_t oldtime = 0,
+ curtime;
+ int range = _i, /* looped test */
+ ntaps;
+
+ litest_enable_tap(dev->libinput_device);
+ litest_enable_drag_lock(dev->libinput_device);
+
+ litest_drain_events(li);
+
+ for (ntaps = 0; ntaps <= range; ntaps++) {
+ litest_touch_down(dev, 0, 50, 50);
+ litest_touch_up(dev, 0);
+ libinput_dispatch(li);
+ msleep(10);
+ }
+
+ libinput_dispatch(li);
+ litest_touch_down(dev, 0, 50, 50);
+ libinput_dispatch(li);
+
+ litest_timeout_tap();
+ libinput_dispatch(li);
+
+ for (ntaps = 0; ntaps < range; ntaps++) {
+ event = libinput_get_event(li);
+ ptrev = litest_is_button_event(event,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ curtime = libinput_event_pointer_get_time(ptrev);
+ libinput_event_destroy(event);
+ ck_assert_int_gt(curtime, oldtime);
+
+ event = libinput_get_event(li);
+ ptrev = litest_is_button_event(event,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+ curtime = libinput_event_pointer_get_time(ptrev);
+ libinput_event_destroy(event);
+ ck_assert_int_ge(curtime, oldtime);
+ oldtime = curtime;
+ }
+
+ event = libinput_get_event(li);
+ ptrev = litest_is_button_event(event,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ curtime = libinput_event_pointer_get_time(ptrev);
+ libinput_event_destroy(event);
+ ck_assert_int_gt(curtime, oldtime);
+
+ litest_touch_move_to(dev, 0, 50, 50, 70, 50, 10, 4);
+
+ litest_assert_only_typed_events(li,
+ LIBINPUT_EVENT_POINTER_MOTION);
+
+ litest_touch_up(dev, 0);
+ litest_touch_down(dev, 0, 70, 50);
+ litest_button_click(dev, BTN_LEFT, true);
+ litest_button_click(dev, BTN_LEFT, false);
+ libinput_dispatch(li);
+
+ litest_assert_button_event(li,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+
+ /* the physical click */
+ litest_assert_button_event(li,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ litest_assert_button_event(li,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+ litest_touch_up(dev, 0);
+
+ litest_assert_empty_queue(li);
+}
+END_TEST
+
+START_TEST(touchpad_1fg_tap_n_drag)
+{
+ struct litest_device *dev = litest_current_device();
+ struct libinput *li = dev->libinput;
+ struct libinput_event *event;
+ struct libinput_event_pointer *ptrev __attribute__((unused));
+
+ litest_enable_tap(dev->libinput_device);
+ litest_disable_drag_lock(dev->libinput_device);
+
+ 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_move_to(dev, 0, 50, 50, 80, 80, 5, 40);
+
+ libinput_dispatch(li);
+
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+
+ libinput_dispatch(li);
+
+ litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
+
+ litest_touch_up(dev, 0);
+
+ /* don't use helper functions here, we expect the event be available
+ * immediately, not after a timeout that the helper functions may
+ * trigger.
+ */
+ libinput_dispatch(li);
+ event = libinput_get_event(li);
+ ck_assert_notnull(event);
+ ptrev = litest_is_button_event(event,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+ libinput_event_destroy(event);
+
+ litest_assert_empty_queue(li);
+}
+END_TEST
+
+START_TEST(touchpad_1fg_tap_n_drag_draglock)
+{
+ struct litest_device *dev = litest_current_device();
+ struct libinput *li = dev->libinput;
+
+ litest_enable_tap(dev->libinput_device);
+ litest_enable_drag_lock(dev->libinput_device);
+
+ 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_move_to(dev, 0, 50, 50, 80, 80, 5, 40);
+ litest_touch_up(dev, 0);
+
+ libinput_dispatch(li);
+
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+
+ libinput_dispatch(li);
+
+ litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
+
+ /* lift finger, set down again, should continue dragging */
+ litest_touch_down(dev, 0, 50, 50);
+ litest_touch_move_to(dev, 0, 50, 50, 80, 80, 5, 40);
+ litest_touch_up(dev, 0);
+
+ litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
+
+ litest_timeout_tap();
+
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+
+ litest_assert_empty_queue(li);
+}
+END_TEST
+
+START_TEST(touchpad_1fg_tap_n_drag_draglock_tap)
+{
+ struct litest_device *dev = litest_current_device();
+ struct libinput *li = dev->libinput;
+
+ litest_enable_tap(dev->libinput_device);
+ litest_enable_drag_lock(dev->libinput_device);
+
+ 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_move_to(dev, 0, 50, 50, 80, 80, 5, 40);
+ litest_touch_up(dev, 0);
+
+ libinput_dispatch(li);
+
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+
+ libinput_dispatch(li);
+
+ litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
+
+ /* lift finger, set down again, should continue dragging */
+ litest_touch_down(dev, 0, 50, 50);
+ litest_touch_move_to(dev, 0, 50, 50, 80, 80, 5, 40);
+
+ litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
+
+ litest_touch_up(dev, 0);
+ litest_touch_down(dev, 0, 50, 50);
+ litest_touch_up(dev, 0);
+
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+
+ litest_assert_empty_queue(li);
+}
+END_TEST
+
+START_TEST(touchpad_1fg_tap_n_drag_draglock_tap_click)
+{
+ struct litest_device *dev = litest_current_device();
+ struct libinput *li = dev->libinput;
+
+ litest_enable_tap(dev->libinput_device);
+ litest_enable_drag_lock(dev->libinput_device);
+
+ 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_move_to(dev, 0, 50, 50, 80, 80, 5, 40);
+ libinput_dispatch(li);
+
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+
+ libinput_dispatch(li);
+
+ litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
+
+ litest_touch_up(dev, 0);
+ litest_touch_down(dev, 0, 50, 50);
+ litest_button_click(dev, BTN_LEFT, true);
+ litest_button_click(dev, BTN_LEFT, false);
+ libinput_dispatch(li);
+
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+
+ /* the physical click */
+ litest_assert_button_event(li,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ litest_assert_button_event(li,
+ BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+ litest_touch_up(dev, 0);
+
+ litest_assert_empty_queue(li);
+}
+END_TEST
+
+START_TEST(touchpad_1fg_tap_n_drag_draglock_timeout)
+{
+ struct litest_device *dev = litest_current_device();
+ struct libinput *li = dev->libinput;
+
+ litest_enable_tap(dev->libinput_device);
+ litest_enable_drag_lock(dev->libinput_device);
+
+ litest_drain_events(li);
+
+ litest_touch_down(dev, 0, 50, 50);
+ litest_touch_up(dev, 0);
+ litest_touch_down(dev, 0, 50, 50);
+ libinput_dispatch(li);
+ litest_timeout_tap();
+
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+
+ litest_assert_empty_queue(li);
+ litest_touch_up(dev, 0);
+ libinput_dispatch(li);
+
+ litest_timeout_tapndrag();
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+
+ litest_assert_empty_queue(li);
+}
+END_TEST
+
+START_TEST(touchpad_1fg_tap_click)
+{
+ struct litest_device *dev = litest_current_device();
+ struct libinput *li = dev->libinput;
+
+ litest_enable_tap(dev->libinput_device);
+
+ litest_drain_events(dev->libinput);
+
+ /* Finger down, finger up -> tap button press
+ * Physical button click -> no button press/release
+ * Tap timeout -> tap button release */
+ litest_touch_down(dev, 0, 50, 50);
+ litest_touch_up(dev, 0);
+ litest_event(dev, EV_KEY, BTN_LEFT, 1);
+ litest_event(dev, EV_SYN, SYN_REPORT, 0);
+ litest_event(dev, EV_KEY, BTN_LEFT, 0);
+ litest_event(dev, EV_SYN, SYN_REPORT, 0);
+ libinput_dispatch(li);
+ litest_timeout_tap();
+
+ libinput_dispatch(li);
+
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+
+ litest_assert_empty_queue(li);
+}
+END_TEST
+
+START_TEST(touchpad_1fg_double_tap_click)
+{
+ struct litest_device *dev = litest_current_device();
+ struct libinput *li = dev->libinput;
+
+ litest_enable_tap(dev->libinput_device);
+
+ litest_drain_events(dev->libinput);
+
+ /* one finger down, up, down, button click, finger up
+ -> two button left event pairs */
+ litest_touch_down(dev, 0, 50, 50);
+ litest_touch_up(dev, 0);
+ litest_touch_down(dev, 0, 50, 50);
+ litest_event(dev, EV_KEY, BTN_LEFT, 1);
+ litest_event(dev, EV_SYN, SYN_REPORT, 0);
+ litest_event(dev, EV_KEY, BTN_LEFT, 0);
+ litest_event(dev, EV_SYN, SYN_REPORT, 0);
+ litest_touch_up(dev, 0);
+
+ libinput_dispatch(li);
+
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+
+ litest_assert_empty_queue(li);
+}
+END_TEST
+
+START_TEST(touchpad_1fg_tap_n_drag_click)
+{
+ struct litest_device *dev = litest_current_device();
+ struct libinput *li = dev->libinput;
+
+ litest_enable_tap(dev->libinput_device);
+
+ litest_drain_events(dev->libinput);
+
+ /* one finger down, up, down, move, button click, finger up
+ -> two button left event pairs, motion allowed */
+ litest_touch_down(dev, 0, 50, 50);
+ litest_touch_up(dev, 0);
+ litest_touch_down(dev, 0, 50, 50);
+ litest_touch_move_to(dev, 0, 50, 50, 80, 50, 10, 0);
+
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+
+ litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
+
+ litest_event(dev, EV_KEY, BTN_LEFT, 1);
+ litest_event(dev, EV_SYN, SYN_REPORT, 0);
+
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+
+ litest_event(dev, EV_KEY, BTN_LEFT, 0);
+ litest_event(dev, EV_SYN, SYN_REPORT, 0);
+ litest_touch_up(dev, 0);
+
+ libinput_dispatch(li);
+
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+
+ litest_assert_empty_queue(li);
+}
+END_TEST
+
+START_TEST(clickpad_1fg_tap_click)
+{
+ struct litest_device *dev = litest_current_device();
+ struct libinput *li = dev->libinput;
+
+ litest_enable_tap(dev->libinput_device);
+
+ litest_drain_events(dev->libinput);
+
+ /* finger down, button click, finger up
+ -> only one button left event pair */
+ litest_touch_down(dev, 0, 50, 50);
+ litest_event(dev, EV_KEY, BTN_LEFT, 1);
+ litest_event(dev, EV_SYN, SYN_REPORT, 0);
+ litest_event(dev, EV_KEY, BTN_LEFT, 0);
+ litest_event(dev, EV_SYN, SYN_REPORT, 0);
+ litest_touch_up(dev, 0);
+ libinput_dispatch(li);
+ litest_timeout_tap();
+
+ libinput_dispatch(li);
+
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_PRESSED);
+ litest_assert_button_event(li, BTN_LEFT,
+ LIBINPUT_BUTTON_STATE_RELEASED);
+
+ litest_assert_empty_queue(li);
+}
+END_TEST
+
+void
+litest_setup_tests(void)
+{
+ struct range multitap_range = {3, 8};
+
+ litest_add("tap:1fg", touchpad_1fg_tap, LITEST_TOUCHPAD, LITEST_ANY);
+ litest_add("tap:1fg", touchpad_1fg_doubletap, LITEST_TOUCHPAD, LITEST_ANY);
+ litest_add_ranged("tap:1fg", touchpad_1fg_multitap, LITEST_TOUCHPAD, LITEST_ANY, &multitap_range);
+ litest_add_ranged("tap:1fg", touchpad_1fg_multitap_n_drag_timeout, LITEST_TOUCHPAD, LITEST_ANY, &multitap_range);
+ litest_add_ranged("tap:1fg", touchpad_1fg_multitap_n_drag_tap, LITEST_TOUCHPAD, LITEST_ANY, &multitap_range);
+ litest_add_ranged("tap:1fg", touchpad_1fg_multitap_n_drag_move, LITEST_TOUCHPAD, LITEST_ANY, &multitap_range);
+ litest_add_ranged("tap:1fg", touchpad_1fg_multitap_n_drag_2fg, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH, &multitap_range);
+ litest_add_ranged("tap:1fg", touchpad_1fg_multitap_n_drag_click, LITEST_CLICKPAD, LITEST_ANY, &multitap_range);
+ litest_add("tap:1fg", touchpad_1fg_tap_n_drag, LITEST_TOUCHPAD, LITEST_ANY);
+ litest_add("tap:1fg", touchpad_1fg_tap_n_drag_draglock, LITEST_TOUCHPAD, LITEST_ANY);
+ litest_add("tap:1fg", touchpad_1fg_tap_n_drag_draglock_tap, LITEST_TOUCHPAD, LITEST_ANY);
+ litest_add("tap:1fg", touchpad_1fg_tap_n_drag_draglock_timeout, LITEST_TOUCHPAD, LITEST_ANY);
+ litest_add("tap:1fg", touchpad_1fg_tap_click, LITEST_TOUCHPAD|LITEST_BUTTON, LITEST_CLICKPAD);
+
+ /* Real buttons don't interfere with tapping, so don't run those for
+ pads with buttons */
+ litest_add("tap:1fg", touchpad_1fg_double_tap_click, LITEST_CLICKPAD, LITEST_ANY);
+ litest_add("tap:1fg", touchpad_1fg_tap_n_drag_click, LITEST_CLICKPAD, LITEST_ANY);
+ litest_add_ranged("tap:1fg", touchpad_1fg_multitap_n_drag_tap_click, LITEST_CLICKPAD, LITEST_ANY, &multitap_range);
+ litest_add("tap:1fg", touchpad_1fg_tap_n_drag_draglock_tap_click, LITEST_CLICKPAD, LITEST_ANY);
+
+ litest_add("tap:1fg", clickpad_1fg_tap_click, LITEST_CLICKPAD, LITEST_ANY);
+}
diff --git a/test/touchpad-tap.c b/test/touchpad-tap.c
index 8383aa9..b34bfaf 100644
--- a/test/touchpad-tap.c
+++ b/test/touchpad-tap.c
@@ -32,769 +32,6 @@
#include "libinput-util.h"
#include "litest.h"
-START_TEST(touchpad_1fg_tap)
-{
- struct litest_device *dev = litest_current_device();
- struct libinput *li = dev->libinput;
- struct libinput_event *event;
-
- litest_enable_tap(dev->libinput_device);
-
- litest_drain_events(li);
-
- litest_touch_down(dev, 0, 50, 50);
- litest_touch_up(dev, 0);
-
- libinput_dispatch(li);
-
- litest_assert_button_event(li, BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
- litest_timeout_tap();
- litest_assert_button_event(li, BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
-
- libinput_dispatch(li);
- event = libinput_get_event(li);
- ck_assert(event == NULL);
-}
-END_TEST
-
-START_TEST(touchpad_1fg_doubletap)
-{
- struct litest_device *dev = litest_current_device();
- struct libinput *li = dev->libinput;
- struct libinput_event *event;
- struct libinput_event_pointer *ptrev;
- uint32_t oldtime, curtime;
-
- litest_enable_tap(dev->libinput_device);
-
- 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_up(dev, 0);
- libinput_dispatch(li);
-
- litest_timeout_tap();
-
- libinput_dispatch(li);
- event = libinput_get_event(li);
- ptrev = litest_is_button_event(event,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
- oldtime = libinput_event_pointer_get_time(ptrev);
- libinput_event_destroy(event);
-
- event = libinput_get_event(li);
- ptrev = litest_is_button_event(event,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
- curtime = libinput_event_pointer_get_time(ptrev);
- libinput_event_destroy(event);
- ck_assert_int_le(oldtime, curtime);
-
- event = libinput_get_event(li);
- ptrev = litest_is_button_event(event,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
- curtime = libinput_event_pointer_get_time(ptrev);
- libinput_event_destroy(event);
- ck_assert_int_lt(oldtime, curtime);
- oldtime = curtime;
-
- event = libinput_get_event(li);
- ptrev = litest_is_button_event(event,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
- curtime = libinput_event_pointer_get_time(ptrev);
- libinput_event_destroy(event);
- ck_assert_int_le(oldtime, curtime);
-
- litest_assert_empty_queue(li);
-}
-END_TEST
-
-START_TEST(touchpad_1fg_multitap)
-{
- struct litest_device *dev = litest_current_device();
- struct libinput *li = dev->libinput;
- struct libinput_event *event;
- struct libinput_event_pointer *ptrev;
- uint32_t oldtime = 0,
- curtime;
- int range = _i, /* looped test */
- ntaps;
-
- litest_enable_tap(dev->libinput_device);
-
- litest_drain_events(li);
-
- for (ntaps = 0; ntaps <= range; ntaps++) {
- litest_touch_down(dev, 0, 50, 50);
- litest_touch_up(dev, 0);
- libinput_dispatch(li);
- msleep(10);
- }
-
- litest_timeout_tap();
- libinput_dispatch(li);
-
- for (ntaps = 0; ntaps <= range; ntaps++) {
- event = libinput_get_event(li);
- ptrev = litest_is_button_event(event,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
- curtime = libinput_event_pointer_get_time(ptrev);
- libinput_event_destroy(event);
- ck_assert_int_gt(curtime, oldtime);
-
- event = libinput_get_event(li);
- ptrev = litest_is_button_event(event,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
- curtime = libinput_event_pointer_get_time(ptrev);
- libinput_event_destroy(event);
- ck_assert_int_ge(curtime, oldtime);
- oldtime = curtime;
- }
- litest_timeout_tap();
- litest_assert_empty_queue(li);
-}
-END_TEST
-
-START_TEST(touchpad_1fg_multitap_n_drag_move)
-{
- struct litest_device *dev = litest_current_device();
- struct libinput *li = dev->libinput;
- struct libinput_event *event;
- struct libinput_event_pointer *ptrev;
- uint32_t oldtime = 0,
- curtime;
- int range = _i, /* looped test */
- ntaps;
-
- litest_enable_tap(dev->libinput_device);
-
- litest_drain_events(li);
-
- for (ntaps = 0; ntaps <= range; ntaps++) {
- litest_touch_down(dev, 0, 50, 50);
- litest_touch_up(dev, 0);
- libinput_dispatch(li);
- msleep(10);
- }
-
- libinput_dispatch(li);
- litest_touch_down(dev, 0, 50, 50);
- litest_touch_move_to(dev, 0, 50, 50, 70, 50, 10, 4);
- libinput_dispatch(li);
-
- for (ntaps = 0; ntaps < range; ntaps++) {
- event = libinput_get_event(li);
- ptrev = litest_is_button_event(event,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
- curtime = libinput_event_pointer_get_time(ptrev);
- libinput_event_destroy(event);
- ck_assert_int_gt(curtime, oldtime);
-
- event = libinput_get_event(li);
- ptrev = litest_is_button_event(event,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
- curtime = libinput_event_pointer_get_time(ptrev);
- libinput_event_destroy(event);
- ck_assert_int_ge(curtime, oldtime);
- oldtime = curtime;
- }
-
- event = libinput_get_event(li);
- ptrev = litest_is_button_event(event,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
- curtime = libinput_event_pointer_get_time(ptrev);
- libinput_event_destroy(event);
- ck_assert_int_gt(curtime, oldtime);
-
- litest_assert_only_typed_events(li,
- LIBINPUT_EVENT_POINTER_MOTION);
-
- litest_touch_up(dev, 0);
- litest_assert_button_event(li,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
-
- litest_assert_empty_queue(li);
-}
-END_TEST
-
-START_TEST(touchpad_1fg_multitap_n_drag_2fg)
-{
- struct litest_device *dev = litest_current_device();
- struct libinput *li = dev->libinput;
- struct libinput_event *event;
- struct libinput_event_pointer *ptrev;
- uint32_t oldtime = 0,
- curtime;
- int range = _i,
- ntaps;
-
- if (libevdev_has_property(dev->evdev, INPUT_PROP_SEMI_MT))
- return;
-
- litest_enable_tap(dev->libinput_device);
-
- litest_drain_events(li);
-
- for (ntaps = 0; ntaps <= range; ntaps++) {
- litest_touch_down(dev, 0, 50, 50);
- litest_touch_up(dev, 0);
- libinput_dispatch(li);
- msleep(10);
- }
-
- libinput_dispatch(li);
- litest_touch_down(dev, 0, 50, 50);
- msleep(10);
- litest_touch_down(dev, 1, 70, 50);
- libinput_dispatch(li);
-
- for (ntaps = 0; ntaps < range; ntaps++) {
- event = libinput_get_event(li);
- ptrev = litest_is_button_event(event,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
- curtime = libinput_event_pointer_get_time(ptrev);
- libinput_event_destroy(event);
- ck_assert_int_gt(curtime, oldtime);
-
- event = libinput_get_event(li);
- ptrev = litest_is_button_event(event,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
- curtime = libinput_event_pointer_get_time(ptrev);
- libinput_event_destroy(event);
- ck_assert_int_ge(curtime, oldtime);
- oldtime = curtime;
- }
-
- event = libinput_get_event(li);
- ptrev = litest_is_button_event(event,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
- curtime = libinput_event_pointer_get_time(ptrev);
- libinput_event_destroy(event);
- ck_assert_int_gt(curtime, oldtime);
-
- litest_touch_move_to(dev, 1, 70, 50, 90, 50, 10, 4);
-
- litest_assert_only_typed_events(li,
- LIBINPUT_EVENT_POINTER_MOTION);
-
- litest_touch_up(dev, 1);
- litest_touch_up(dev, 0);
- litest_timeout_tap();
- litest_assert_button_event(li,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
-
- litest_assert_empty_queue(li);
-}
-END_TEST
-
-START_TEST(touchpad_1fg_multitap_n_drag_click)
-{
- struct litest_device *dev = litest_current_device();
- struct libinput *li = dev->libinput;
- struct libinput_event *event;
- struct libinput_event_pointer *ptrev;
- uint32_t oldtime = 0,
- curtime;
- int range = _i, /* looped test */
- ntaps;
-
- litest_enable_tap(dev->libinput_device);
-
- litest_drain_events(li);
-
- for (ntaps = 0; ntaps <= range; ntaps++) {
- litest_touch_down(dev, 0, 50, 50);
- litest_touch_up(dev, 0);
- libinput_dispatch(li);
- msleep(10);
- }
-
- litest_touch_down(dev, 0, 50, 50);
- libinput_dispatch(li);
- litest_button_click(dev, BTN_LEFT, true);
- litest_button_click(dev, BTN_LEFT, false);
- libinput_dispatch(li);
-
- for (ntaps = 0; ntaps <= range; ntaps++) {
- event = libinput_get_event(li);
- ptrev = litest_is_button_event(event,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
- curtime = libinput_event_pointer_get_time(ptrev);
- libinput_event_destroy(event);
- ck_assert_int_gt(curtime, oldtime);
-
- event = libinput_get_event(li);
- ptrev = litest_is_button_event(event,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
- curtime = libinput_event_pointer_get_time(ptrev);
- libinput_event_destroy(event);
- ck_assert_int_ge(curtime, oldtime);
- oldtime = curtime;
- }
-
- litest_assert_button_event(li,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
- litest_assert_button_event(li,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
- litest_touch_up(dev, 0);
- litest_timeout_tap();
-
- litest_assert_empty_queue(li);
-}
-END_TEST
-
-START_TEST(touchpad_1fg_multitap_n_drag_timeout)
-{
- struct litest_device *dev = litest_current_device();
- struct libinput *li = dev->libinput;
- struct libinput_event *event;
- struct libinput_event_pointer *ptrev;
- uint32_t oldtime = 0,
- curtime;
- int range = _i, /* looped test */
- ntaps;
-
- litest_enable_tap(dev->libinput_device);
-
- litest_drain_events(li);
-
- for (ntaps = 0; ntaps <= range; ntaps++) {
- litest_touch_down(dev, 0, 50, 50);
- litest_touch_up(dev, 0);
- libinput_dispatch(li);
- msleep(10);
- }
-
- libinput_dispatch(li);
- litest_touch_down(dev, 0, 50, 50);
- libinput_dispatch(li);
-
- litest_timeout_tap();
- libinput_dispatch(li);
-
- for (ntaps = 0; ntaps < range; ntaps++) {
- event = libinput_get_event(li);
- ptrev = litest_is_button_event(event,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
- curtime = libinput_event_pointer_get_time(ptrev);
- libinput_event_destroy(event);
- ck_assert_int_gt(curtime, oldtime);
-
- event = libinput_get_event(li);
- ptrev = litest_is_button_event(event,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
- curtime = libinput_event_pointer_get_time(ptrev);
- libinput_event_destroy(event);
- ck_assert_int_ge(curtime, oldtime);
- oldtime = curtime;
- }
-
- event = libinput_get_event(li);
- ptrev = litest_is_button_event(event,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
- curtime = libinput_event_pointer_get_time(ptrev);
- libinput_event_destroy(event);
- ck_assert_int_gt(curtime, oldtime);
-
- litest_touch_move_to(dev, 0, 50, 50, 70, 50, 10, 4);
-
- litest_assert_only_typed_events(li,
- LIBINPUT_EVENT_POINTER_MOTION);
-
- litest_touch_up(dev, 0);
- litest_assert_button_event(li,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
-
- litest_assert_empty_queue(li);
-}
-END_TEST
-
-START_TEST(touchpad_1fg_multitap_n_drag_tap)
-{
- struct litest_device *dev = litest_current_device();
- struct libinput *li = dev->libinput;
- struct libinput_event *event;
- struct libinput_event_pointer *ptrev;
- uint32_t oldtime = 0,
- curtime;
- int range = _i, /* looped test */
- ntaps;
-
- litest_enable_tap(dev->libinput_device);
- litest_enable_drag_lock(dev->libinput_device);
-
- litest_drain_events(li);
-
- for (ntaps = 0; ntaps <= range; ntaps++) {
- litest_touch_down(dev, 0, 50, 50);
- litest_touch_up(dev, 0);
- libinput_dispatch(li);
- msleep(10);
- }
-
- libinput_dispatch(li);
- litest_touch_down(dev, 0, 50, 50);
- libinput_dispatch(li);
-
- litest_timeout_tap();
- libinput_dispatch(li);
-
- for (ntaps = 0; ntaps < range; ntaps++) {
- event = libinput_get_event(li);
- ptrev = litest_is_button_event(event,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
- curtime = libinput_event_pointer_get_time(ptrev);
- libinput_event_destroy(event);
- ck_assert_int_gt(curtime, oldtime);
-
- event = libinput_get_event(li);
- ptrev = litest_is_button_event(event,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
- curtime = libinput_event_pointer_get_time(ptrev);
- libinput_event_destroy(event);
- ck_assert_int_ge(curtime, oldtime);
- oldtime = curtime;
- }
-
- event = libinput_get_event(li);
- ptrev = litest_is_button_event(event,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
- curtime = libinput_event_pointer_get_time(ptrev);
- libinput_event_destroy(event);
- ck_assert_int_gt(curtime, oldtime);
-
- litest_touch_move_to(dev, 0, 50, 50, 70, 50, 10, 4);
-
- litest_assert_only_typed_events(li,
- LIBINPUT_EVENT_POINTER_MOTION);
-
- litest_touch_up(dev, 0);
- litest_touch_down(dev, 0, 70, 50);
- litest_touch_up(dev, 0);
- litest_assert_button_event(li,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
-
- litest_assert_empty_queue(li);
-}
-END_TEST
-
-START_TEST(touchpad_1fg_multitap_n_drag_tap_click)
-{
- struct litest_device *dev = litest_current_device();
- struct libinput *li = dev->libinput;
- struct libinput_event *event;
- struct libinput_event_pointer *ptrev;
- uint32_t oldtime = 0,
- curtime;
- int range = _i, /* looped test */
- ntaps;
-
- litest_enable_tap(dev->libinput_device);
- litest_enable_drag_lock(dev->libinput_device);
-
- litest_drain_events(li);
-
- for (ntaps = 0; ntaps <= range; ntaps++) {
- litest_touch_down(dev, 0, 50, 50);
- litest_touch_up(dev, 0);
- libinput_dispatch(li);
- msleep(10);
- }
-
- libinput_dispatch(li);
- litest_touch_down(dev, 0, 50, 50);
- libinput_dispatch(li);
-
- litest_timeout_tap();
- libinput_dispatch(li);
-
- for (ntaps = 0; ntaps < range; ntaps++) {
- event = libinput_get_event(li);
- ptrev = litest_is_button_event(event,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
- curtime = libinput_event_pointer_get_time(ptrev);
- libinput_event_destroy(event);
- ck_assert_int_gt(curtime, oldtime);
-
- event = libinput_get_event(li);
- ptrev = litest_is_button_event(event,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
- curtime = libinput_event_pointer_get_time(ptrev);
- libinput_event_destroy(event);
- ck_assert_int_ge(curtime, oldtime);
- oldtime = curtime;
- }
-
- event = libinput_get_event(li);
- ptrev = litest_is_button_event(event,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
- curtime = libinput_event_pointer_get_time(ptrev);
- libinput_event_destroy(event);
- ck_assert_int_gt(curtime, oldtime);
-
- litest_touch_move_to(dev, 0, 50, 50, 70, 50, 10, 4);
-
- litest_assert_only_typed_events(li,
- LIBINPUT_EVENT_POINTER_MOTION);
-
- litest_touch_up(dev, 0);
- litest_touch_down(dev, 0, 70, 50);
- litest_button_click(dev, BTN_LEFT, true);
- litest_button_click(dev, BTN_LEFT, false);
- libinput_dispatch(li);
-
- litest_assert_button_event(li,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
-
- /* the physical click */
- litest_assert_button_event(li,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
- litest_assert_button_event(li,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
- litest_touch_up(dev, 0);
-
- litest_assert_empty_queue(li);
-}
-END_TEST
-
-START_TEST(touchpad_1fg_tap_n_drag)
-{
- struct litest_device *dev = litest_current_device();
- struct libinput *li = dev->libinput;
- struct libinput_event *event;
- struct libinput_event_pointer *ptrev __attribute__((unused));
-
- litest_enable_tap(dev->libinput_device);
- litest_disable_drag_lock(dev->libinput_device);
-
- 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_move_to(dev, 0, 50, 50, 80, 80, 5, 40);
-
- libinput_dispatch(li);
-
- litest_assert_button_event(li, BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
-
- libinput_dispatch(li);
-
- litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
-
- litest_touch_up(dev, 0);
-
- /* don't use helper functions here, we expect the event be available
- * immediately, not after a timeout that the helper functions may
- * trigger.
- */
- libinput_dispatch(li);
- event = libinput_get_event(li);
- ck_assert_notnull(event);
- ptrev = litest_is_button_event(event,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
- libinput_event_destroy(event);
-
- litest_assert_empty_queue(li);
-}
-END_TEST
-
-START_TEST(touchpad_1fg_tap_n_drag_draglock)
-{
- struct litest_device *dev = litest_current_device();
- struct libinput *li = dev->libinput;
-
- litest_enable_tap(dev->libinput_device);
- litest_enable_drag_lock(dev->libinput_device);
-
- 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_move_to(dev, 0, 50, 50, 80, 80, 5, 40);
- litest_touch_up(dev, 0);
-
- libinput_dispatch(li);
-
- litest_assert_button_event(li, BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
-
- libinput_dispatch(li);
-
- litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
-
- /* lift finger, set down again, should continue dragging */
- litest_touch_down(dev, 0, 50, 50);
- litest_touch_move_to(dev, 0, 50, 50, 80, 80, 5, 40);
- litest_touch_up(dev, 0);
-
- litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
-
- litest_timeout_tap();
-
- litest_assert_button_event(li, BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
-
- litest_assert_empty_queue(li);
-}
-END_TEST
-
-START_TEST(touchpad_1fg_tap_n_drag_draglock_tap)
-{
- struct litest_device *dev = litest_current_device();
- struct libinput *li = dev->libinput;
-
- litest_enable_tap(dev->libinput_device);
- litest_enable_drag_lock(dev->libinput_device);
-
- 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_move_to(dev, 0, 50, 50, 80, 80, 5, 40);
- litest_touch_up(dev, 0);
-
- libinput_dispatch(li);
-
- litest_assert_button_event(li, BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
-
- libinput_dispatch(li);
-
- litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
-
- /* lift finger, set down again, should continue dragging */
- litest_touch_down(dev, 0, 50, 50);
- litest_touch_move_to(dev, 0, 50, 50, 80, 80, 5, 40);
-
- litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
-
- litest_touch_up(dev, 0);
- litest_touch_down(dev, 0, 50, 50);
- litest_touch_up(dev, 0);
-
- litest_assert_button_event(li, BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
-
- litest_assert_empty_queue(li);
-}
-END_TEST
-
-START_TEST(touchpad_1fg_tap_n_drag_draglock_tap_click)
-{
- struct litest_device *dev = litest_current_device();
- struct libinput *li = dev->libinput;
-
- litest_enable_tap(dev->libinput_device);
- litest_enable_drag_lock(dev->libinput_device);
-
- 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_move_to(dev, 0, 50, 50, 80, 80, 5, 40);
- libinput_dispatch(li);
-
- litest_assert_button_event(li, BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
-
- libinput_dispatch(li);
-
- litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
-
- litest_touch_up(dev, 0);
- litest_touch_down(dev, 0, 50, 50);
- litest_button_click(dev, BTN_LEFT, true);
- litest_button_click(dev, BTN_LEFT, false);
- libinput_dispatch(li);
-
- litest_assert_button_event(li, BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
-
- /* the physical click */
- litest_assert_button_event(li,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
- litest_assert_button_event(li,
- BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
- litest_touch_up(dev, 0);
-
- litest_assert_empty_queue(li);
-}
-END_TEST
-
-START_TEST(touchpad_1fg_tap_n_drag_draglock_timeout)
-{
- struct litest_device *dev = litest_current_device();
- struct libinput *li = dev->libinput;
-
- litest_enable_tap(dev->libinput_device);
- litest_enable_drag_lock(dev->libinput_device);
-
- litest_drain_events(li);
-
- litest_touch_down(dev, 0, 50, 50);
- litest_touch_up(dev, 0);
- litest_touch_down(dev, 0, 50, 50);
- libinput_dispatch(li);
- litest_timeout_tap();
-
- litest_assert_button_event(li, BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
-
- litest_assert_empty_queue(li);
- litest_touch_up(dev, 0);
- libinput_dispatch(li);
-
- litest_timeout_tapndrag();
- litest_assert_button_event(li, BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
-
- litest_assert_empty_queue(li);
-}
-END_TEST
-
START_TEST(touchpad_2fg_tap_n_drag)
{
struct litest_device *dev = litest_current_device();
@@ -1041,38 +278,6 @@ START_TEST(touchpad_2fg_tap_quickrelease)
}
END_TEST
-START_TEST(touchpad_1fg_tap_click)
-{
- struct litest_device *dev = litest_current_device();
- struct libinput *li = dev->libinput;
-
- litest_enable_tap(dev->libinput_device);
-
- litest_drain_events(dev->libinput);
-
- /* Finger down, finger up -> tap button press
- * Physical button click -> no button press/release
- * Tap timeout -> tap button release */
- litest_touch_down(dev, 0, 50, 50);
- litest_touch_up(dev, 0);
- litest_event(dev, EV_KEY, BTN_LEFT, 1);
- litest_event(dev, EV_SYN, SYN_REPORT, 0);
- litest_event(dev, EV_KEY, BTN_LEFT, 0);
- litest_event(dev, EV_SYN, SYN_REPORT, 0);
- libinput_dispatch(li);
- litest_timeout_tap();
-
- libinput_dispatch(li);
-
- litest_assert_button_event(li, BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
- litest_assert_button_event(li, BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
-
- litest_assert_empty_queue(li);
-}
-END_TEST
-
START_TEST(touchpad_2fg_tap_click)
{
struct litest_device *dev = litest_current_device();
@@ -1251,83 +456,6 @@ START_TEST(touchpad_no_first_fg_tap_after_move)
}
END_TEST
-START_TEST(touchpad_1fg_double_tap_click)
-{
- struct litest_device *dev = litest_current_device();
- struct libinput *li = dev->libinput;
-
- litest_enable_tap(dev->libinput_device);
-
- litest_drain_events(dev->libinput);
-
- /* one finger down, up, down, button click, finger up
- -> two button left event pairs */
- litest_touch_down(dev, 0, 50, 50);
- litest_touch_up(dev, 0);
- litest_touch_down(dev, 0, 50, 50);
- litest_event(dev, EV_KEY, BTN_LEFT, 1);
- litest_event(dev, EV_SYN, SYN_REPORT, 0);
- litest_event(dev, EV_KEY, BTN_LEFT, 0);
- litest_event(dev, EV_SYN, SYN_REPORT, 0);
- litest_touch_up(dev, 0);
-
- libinput_dispatch(li);
-
- litest_assert_button_event(li, BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
- litest_assert_button_event(li, BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
- litest_assert_button_event(li, BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
- litest_assert_button_event(li, BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
-
- litest_assert_empty_queue(li);
-}
-END_TEST
-
-START_TEST(touchpad_1fg_tap_n_drag_click)
-{
- struct litest_device *dev = litest_current_device();
- struct libinput *li = dev->libinput;
-
- litest_enable_tap(dev->libinput_device);
-
- litest_drain_events(dev->libinput);
-
- /* one finger down, up, down, move, button click, finger up
- -> two button left event pairs, motion allowed */
- litest_touch_down(dev, 0, 50, 50);
- litest_touch_up(dev, 0);
- litest_touch_down(dev, 0, 50, 50);
- litest_touch_move_to(dev, 0, 50, 50, 80, 50, 10, 0);
-
- litest_assert_button_event(li, BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
-
- litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
-
- litest_event(dev, EV_KEY, BTN_LEFT, 1);
- litest_event(dev, EV_SYN, SYN_REPORT, 0);
-
- litest_assert_button_event(li, BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
- litest_assert_button_event(li, BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
-
- litest_event(dev, EV_KEY, BTN_LEFT, 0);
- litest_event(dev, EV_SYN, SYN_REPORT, 0);
- litest_touch_up(dev, 0);
-
- libinput_dispatch(li);
-
- litest_assert_button_event(li, BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
-
- litest_assert_empty_queue(li);
-}
-END_TEST
-
START_TEST(touchpad_3fg_tap)
{
struct litest_device *dev = litest_current_device();
@@ -1635,37 +763,6 @@ START_TEST(touchpad_5fg_tap_quickrelease)
}
END_TEST
-START_TEST(clickpad_1fg_tap_click)
-{
- struct litest_device *dev = litest_current_device();
- struct libinput *li = dev->libinput;
-
- litest_enable_tap(dev->libinput_device);
-
- litest_drain_events(dev->libinput);
-
- /* finger down, button click, finger up
- -> only one button left event pair */
- litest_touch_down(dev, 0, 50, 50);
- litest_event(dev, EV_KEY, BTN_LEFT, 1);
- litest_event(dev, EV_SYN, SYN_REPORT, 0);
- litest_event(dev, EV_KEY, BTN_LEFT, 0);
- litest_event(dev, EV_SYN, SYN_REPORT, 0);
- litest_touch_up(dev, 0);
- libinput_dispatch(li);
- litest_timeout_tap();
-
- libinput_dispatch(li);
-
- litest_assert_button_event(li, BTN_LEFT,
- LIBINPUT_BUTTON_STATE_PRESSED);
- litest_assert_button_event(li, BTN_LEFT,
- LIBINPUT_BUTTON_STATE_RELEASED);
-
- litest_assert_empty_queue(li);
-}
-END_TEST
-
START_TEST(touchpad_tap_is_available)
{
struct litest_device *dev = litest_current_device();
@@ -1963,18 +1060,6 @@ litest_setup_tests(void)
{
struct range multitap_range = {3, 8};
- litest_add("tap:1fg", touchpad_1fg_tap, LITEST_TOUCHPAD, LITEST_ANY);
- litest_add("tap:1fg", touchpad_1fg_doubletap, LITEST_TOUCHPAD, LITEST_ANY);
- litest_add_ranged("tap:1fg", touchpad_1fg_multitap, LITEST_TOUCHPAD, LITEST_ANY, &multitap_range);
- litest_add_ranged("tap:1fg", touchpad_1fg_multitap_n_drag_timeout, LITEST_TOUCHPAD, LITEST_ANY, &multitap_range);
- litest_add_ranged("tap:1fg", touchpad_1fg_multitap_n_drag_tap, LITEST_TOUCHPAD, LITEST_ANY, &multitap_range);
- litest_add_ranged("tap:1fg", touchpad_1fg_multitap_n_drag_move, LITEST_TOUCHPAD, LITEST_ANY, &multitap_range);
- litest_add_ranged("tap:1fg", touchpad_1fg_multitap_n_drag_2fg, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH, &multitap_range);
- litest_add_ranged("tap:1fg", touchpad_1fg_multitap_n_drag_click, LITEST_CLICKPAD, LITEST_ANY, &multitap_range);
- litest_add("tap:1fg", touchpad_1fg_tap_n_drag, LITEST_TOUCHPAD, LITEST_ANY);
- litest_add("tap:1fg", touchpad_1fg_tap_n_drag_draglock, LITEST_TOUCHPAD, LITEST_ANY);
- litest_add("tap:1fg", touchpad_1fg_tap_n_drag_draglock_tap, LITEST_TOUCHPAD, LITEST_ANY);
- litest_add("tap:1fg", touchpad_1fg_tap_n_drag_draglock_timeout, LITEST_TOUCHPAD, LITEST_ANY);
litest_add("tap:2fg", touchpad_2fg_tap_n_drag, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
litest_add("tap:2fg", touchpad_2fg_tap_n_drag_3fg_btntool, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH|LITEST_APPLE_CLICKPAD);
litest_add("tap:2fg", touchpad_2fg_tap_n_drag_3fg, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
@@ -1983,7 +1068,6 @@ litest_setup_tests(void)
litest_add("tap:2fg", touchpad_2fg_tap_n_hold_first, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
litest_add("tap:2fg", touchpad_2fg_tap_n_hold_second, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
litest_add("tap:2fg", touchpad_2fg_tap_quickrelease, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH|LITEST_SEMI_MT);
- litest_add("tap:2fg", touchpad_1fg_tap_click, LITEST_TOUCHPAD|LITEST_BUTTON, LITEST_CLICKPAD);
litest_add("tap:2fg", touchpad_2fg_tap_click, LITEST_TOUCHPAD|LITEST_BUTTON, LITEST_SINGLE_TOUCH|LITEST_CLICKPAD);
litest_add("tap:2fg", touchpad_2fg_tap_click_apple, LITEST_APPLE_CLICKPAD, LITEST_ANY);
@@ -2000,20 +1084,12 @@ litest_setup_tests(void)
litest_add("tap:5fg", touchpad_5fg_tap, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH|LITEST_SEMI_MT);
litest_add("tap:5fg", touchpad_5fg_tap_quickrelease, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH|LITEST_SEMI_MT);
- /* Real buttons don't interfere with tapping, so don't run those for
- pads with buttons */
- litest_add("tap:1fg", touchpad_1fg_double_tap_click, LITEST_CLICKPAD, LITEST_ANY);
- litest_add("tap:1fg", touchpad_1fg_tap_n_drag_click, LITEST_CLICKPAD, LITEST_ANY);
- litest_add_ranged("tap:1fg", touchpad_1fg_multitap_n_drag_tap_click, LITEST_CLICKPAD, LITEST_ANY, &multitap_range);
- litest_add("tap:1fg", touchpad_1fg_tap_n_drag_draglock_tap_click, LITEST_CLICKPAD, LITEST_ANY);
-
litest_add("tap:config", touchpad_tap_default_disabled, LITEST_TOUCHPAD|LITEST_BUTTON, LITEST_ANY);
litest_add("tap:config", touchpad_tap_default_enabled, LITEST_TOUCHPAD, LITEST_BUTTON);
litest_add("tap:config", touchpad_tap_invalid, LITEST_TOUCHPAD, LITEST_ANY);
litest_add("tap:config", touchpad_tap_is_available, LITEST_TOUCHPAD, LITEST_ANY);
litest_add("tap:config", touchpad_tap_is_not_available, LITEST_ANY, LITEST_TOUCHPAD);
- litest_add("tap:1fg", clickpad_1fg_tap_click, LITEST_CLICKPAD, LITEST_ANY);
litest_add("tap:2fg", clickpad_2fg_tap_click, LITEST_CLICKPAD, LITEST_SINGLE_TOUCH|LITEST_APPLE_CLICKPAD);
litest_add("tap:draglock", touchpad_drag_lock_default_disabled, LITEST_TOUCHPAD, LITEST_ANY);
--
2.7.4
More information about the wayland-devel
mailing list