gio/tests/desktop-app-info: Wait until the callback is called

The test was flacky because we were only relying on the presence of a
file, while the callback could have not been called yet, while ensure
for both assumptions to be true before stop iterating the loop.
This commit is contained in:
Marco Trevisan (Treviño) 2022-07-12 17:18:52 +02:00
parent df239b97fb
commit ecaa5b5b7a

View File

@ -1118,7 +1118,7 @@ test_default_uri_handler_async (void)
on_launch_default_for_uri_success_cb,
&called);
while (!g_file_test (file_path, G_FILE_TEST_IS_REGULAR))
while (!g_file_test (file_path, G_FILE_TEST_IS_REGULAR) || !called)
g_main_context_iteration (NULL, FALSE);
g_assert_true (called);