From: Peter Hutterer Date: Tue, 18 Jun 2019 05:36:13 +0000 (+1000) Subject: test: add another test for thumb movements X-Git-Tag: 1.13.901~40 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c3c3c4b2aef408d7e1e3fcbef96f78f6bc83d0ab;p=platform%2Fupstream%2Flibinput.git test: add another test for thumb movements Small movements mustn't trigger events, large movements should. Signed-off-by: Peter Hutterer --- diff --git a/test/test-touchpad.c b/test/test-touchpad.c index 2473193..451cba9 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);