summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2019-06-18 15:36:13 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2019-06-18 18:29:19 +1000
commitc3c3c4b2aef408d7e1e3fcbef96f78f6bc83d0ab (patch)
tree5a852552bff34ad2fa4eb689b627410f13368038 /test
parent84872fa35b8bad8eb45af5b2df36d9ac1e01aa98 (diff)
downloadlibinput-c3c3c4b2aef408d7e1e3fcbef96f78f6bc83d0ab.tar.gz
test: add another test for thumb movements
Small movements mustn't trigger events, large movements should. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'test')
-rw-r--r--test/test-touchpad.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/test/test-touchpad.c b/test/test-touchpad.c
index 2473193c..451cba9c 100644
--- a/test/test-touchpad.c
+++ b/test/test-touchpad.c
@@ -5060,7 +5060,33 @@ START_TEST(touchpad_thumb_area_update_no_motion)
}
END_TEST
-START_TEST(touchpad_thumb_area_moving)
+START_TEST(touchpad_thumb_area_small_move)
+{
+ struct litest_device *dev = litest_current_device();
+ struct libinput *li = dev->libinput;
+
+ litest_disable_tap(dev->libinput_device);
+ litest_enable_clickfinger(dev);
+
+ if (!has_thumb_detect(dev))
+ return;
+
+ litest_drain_events(li);
+
+ /* movement less than the threshold */
+ litest_touch_down(dev, 0, 50, 99);
+ libinput_dispatch(li);
+ litest_timeout_thumb();
+ libinput_dispatch(li);
+
+ litest_touch_move_to(dev, 0, 50, 99, 52, 99, 10);
+ litest_touch_up(dev, 0);
+
+ litest_assert_empty_queue(li);
+}
+END_TEST
+
+START_TEST(touchpad_thumb_area_large_move)
{
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
@@ -7076,7 +7102,8 @@ TEST_COLLECTION(touchpad)
litest_add("touchpad:thumb", touchpad_thumb_area_begin_no_motion, LITEST_CLICKPAD, LITEST_ANY);
litest_add("touchpad:thumb", touchpad_thumb_area_update_no_motion, LITEST_CLICKPAD, LITEST_ANY);
- litest_add("touchpad:thumb", touchpad_thumb_area_moving, LITEST_CLICKPAD, LITEST_ANY);
+ litest_add("touchpad:thumb", touchpad_thumb_area_small_move, LITEST_CLICKPAD, LITEST_ANY);
+ litest_add("touchpad:thumb", touchpad_thumb_area_large_move, LITEST_CLICKPAD, LITEST_ANY);
litest_add("touchpad:thumb", touchpad_thumb_speed_empty_slots, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
litest_add("touchpad:thumb", touchpad_thumb_area_clickfinger, LITEST_CLICKPAD, LITEST_ANY);
litest_add("touchpad:thumb", touchpad_thumb_area_btnarea, LITEST_CLICKPAD, LITEST_ANY);