From e743334fe03b3f039d703dc395842f956eb593d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 10 Aug 2022 12:04:41 +0200 Subject: [PATCH] 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: --- src/tests/test-runner.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/tests/test-runner.c b/src/tests/test-runner.c index 75d9c765d..e3c5d1636 100644 --- a/src/tests/test-runner.c +++ b/src/tests/test-runner.c @@ -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 /", 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)