[mutter/gnome-42] tests/runner: Add 'sync_shown' command



commit e938fae99a0783eb57e69fd4629efdb0339c5d39
Author: Jonas Ådahl <jadahl gmail com>
Date:   Wed Aug 10 12:04:41 2022 +0200

    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>

 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 75d9c765de..e3c5d1636b 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 <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)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]