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 <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2019-06-20 16:38:07 +10:00
parent 8f8ad0e31b
commit 8b4c040bfb

View file

@ -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 {