tests/clutter/event-delivery: Flush input thread after events

Otherwise the test becomes flaky, due to events not having ended up on
the main thread yet.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2727>
This commit is contained in:
Jonas Ådahl 2022-12-01 21:54:34 +01:00 committed by Marge Bot
parent c3f7bf331c
commit 8b8b06e12e

View File

@ -55,10 +55,12 @@ event_delivery_consecutive_touch_begin_end (void)
clutter_virtual_input_device_notify_touch_up (virtual_pointer, now_us, 0); clutter_virtual_input_device_notify_touch_up (virtual_pointer, now_us, 0);
clutter_virtual_input_device_notify_touch_down (virtual_pointer, now_us, 0, 5, 5); clutter_virtual_input_device_notify_touch_down (virtual_pointer, now_us, 0, 5, 5);
g_assert_true (!was_updated); g_assert_true (!was_updated);
clutter_test_flush_input ();
wait_stage_updated (CLUTTER_STAGE (stage), &was_updated); wait_stage_updated (CLUTTER_STAGE (stage), &was_updated);
g_assert_cmpint (n_captured_touch_events, ==, 3); g_assert_cmpint (n_captured_touch_events, ==, 3);
clutter_virtual_input_device_notify_touch_up (virtual_pointer, now_us, 0); clutter_virtual_input_device_notify_touch_up (virtual_pointer, now_us, 0);
clutter_test_flush_input ();
wait_stage_updated (CLUTTER_STAGE (stage), &was_updated); wait_stage_updated (CLUTTER_STAGE (stage), &was_updated);
g_assert_cmpint (n_captured_touch_events, ==, 4); g_assert_cmpint (n_captured_touch_events, ==, 4);