[mutter] tests/test-runner: Add a 'wait_reconfigure' command



commit 62f449d7d5af8551ea570a9a3db250d3e63c46b6
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Thu Apr 2 16:14:33 2020 +0200

    tests/test-runner: Add a 'wait_reconfigure' command
    
    This makes sure that a client has properly responded to a configure
    event it itself triggered. In practice, this is just two 'wait'
    commands, with a 'dispatch' in between, which is needed because a single
    one does not reliably include the two way round trip happening when e.g.
    responding to a unmaximize configure event triggered by a unmaximize
    request.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1171

 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 b6ff931b2..6364d0ca9 100644
--- a/src/tests/test-runner.c
+++ b/src/tests/test-runner.c
@@ -637,6 +637,24 @@ test_case_do (TestCase *test,
       if (!test_case_wait (test, error))
         return FALSE;
     }
+  else if (strcmp (argv[0], "wait_reconfigure") == 0)
+    {
+      if (argc != 1)
+        BAD_COMMAND("usage: %s", argv[0]);
+
+      /*
+       * Wait twice, so that we
+       *  1) First wait for any requests to configure being made
+       *  2) Then wait until the new configuration has been applied
+       */
+
+      if (!test_case_wait (test, error))
+        return FALSE;
+      if (!test_case_dispatch (test, error))
+        return FALSE;
+      if (!test_case_wait (test, error))
+        return FALSE;
+    }
   else if (strcmp (argv[0], "dispatch") == 0)
     {
       if (argc != 1)


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