tests/runner: Add 'sync_shown' command

This command will block until a previously asynchronously shown window
is shown. E.g.

show w/1 async
... do stuff ..
sync_shown w/1

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2554>
This commit is contained in:
Jonas Ådahl 2022-08-10 12:04:41 +02:00 committed by Marge Bot
parent 5c26d786f5
commit e743334fe0

View File

@ -638,6 +638,24 @@ test_case_do (TestCase *test,
if (!show_async)
meta_test_client_wait_for_window_shown (client, window);
}
else if (strcmp (argv[0], "sync_shown") == 0)
{
MetaWindow *window;
MetaTestClient *client;
const char *window_id;
if (argc != 2)
BAD_COMMAND("usage: %s <client-id>/<window-id>", argv[0]);
if (!test_case_parse_window_id (test, argv[1], &client, &window_id, error))
return FALSE;
window = meta_test_client_find_window (client, window_id, error);
if (!window)
return FALSE;
meta_test_client_wait_for_window_shown (client, window);
}
else if (strcmp (argv[0], "resize") == 0)
{
if (argc != 4)