From 8b4c040bfbd967314b79333a6ed53d59a62dc7ae Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 20 Jun 2019 16:38:07 +1000 Subject: [PATCH] test: fix the slot swap test This test worked because no gesture was detected in the initial movement. If that happens though, releasing one finger triggers the gesture timeout during which we suppress events, thus failing the test. Fix this by moving, waiting, moving - that will definitely generate an event. Signed-off-by: Peter Hutterer --- test/test-touchpad.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/test-touchpad.c b/test/test-touchpad.c index 96281ea6..9469255a 100644 --- a/test/test-touchpad.c +++ b/test/test-touchpad.c @@ -5569,7 +5569,17 @@ START_TEST(touchpad_slot_swap) litest_touch_move(dev, second, 50, 30.1); litest_pop_event_frame(dev); libinput_dispatch(li); - litest_touch_move_to(dev, second, 50, 30, 50, 11, 10); + /* drain a potential scroll stop */ + litest_drain_events(li); + /* If a gesture was detected, we need to go past the gesture + * timeout to trigger events. So let's move a bit first to + * make sure it looks continuous, then wait, then move again + * to make sure we trigger events */ + litest_touch_move_to(dev, second, 50, 30, 50, 21, 10); + libinput_dispatch(li); + litest_timeout_gesture(); + libinput_dispatch(li); + litest_touch_move_to(dev, second, 50, 21, 50, 11, 20); libinput_dispatch(li); event = libinput_get_event(li); do {