[mutter] tests/wayland-test-driver: Add surface argument to sync_point request



commit d8521ffc56b019a404d796741f828cc302819de9
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Tue Sep 7 10:31:26 2021 +0200

    tests/wayland-test-driver: Add surface argument to sync_point request
    
    Will allow more "specific" sync points; will be used in the future by
    new tests.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1993>

 src/tests/meta-wayland-test-driver.c              | 7 +++++--
 src/tests/wayland-test-clients/test-driver.xml    | 1 +
 src/tests/wayland-test-clients/xdg-apply-limits.c | 4 ++--
 src/tests/wayland-unit-tests.c                    | 1 +
 4 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/tests/meta-wayland-test-driver.c b/src/tests/meta-wayland-test-driver.c
index 0eecf8d450..24ce06030f 100644
--- a/src/tests/meta-wayland-test-driver.c
+++ b/src/tests/meta-wayland-test-driver.c
@@ -81,12 +81,14 @@ sync_actor_destroy (struct wl_client   *client,
 static void
 sync_point (struct wl_client   *client,
             struct wl_resource *resource,
-            uint32_t            sequence)
+            uint32_t            sequence,
+            struct wl_resource *surface_resource)
 {
   MetaWaylandTestDriver *test_driver = wl_resource_get_user_data (resource);
 
   g_signal_emit (test_driver, signals[SYNC_POINT], 0,
                  sequence,
+                 surface_resource,
                  client);
 }
 
@@ -133,8 +135,9 @@ meta_wayland_test_driver_class_init (MetaWaylandTestDriverClass *klass)
                   G_SIGNAL_RUN_LAST,
                   0,
                   NULL, NULL, NULL,
-                  G_TYPE_NONE, 2,
+                  G_TYPE_NONE, 3,
                   G_TYPE_UINT,
+                  G_TYPE_POINTER,
                   G_TYPE_POINTER);
 }
 
diff --git a/src/tests/wayland-test-clients/test-driver.xml b/src/tests/wayland-test-clients/test-driver.xml
index 2433cf111a..27574b101b 100644
--- a/src/tests/wayland-test-clients/test-driver.xml
+++ b/src/tests/wayland-test-clients/test-driver.xml
@@ -8,6 +8,7 @@
 
     <request name="sync_point">
       <arg name="sequence" type="uint"/>
+      <arg name="surface" type="object" interface="wl_surface" allow-null="true"/>
     </request>
   </interface>
 </protocol>
diff --git a/src/tests/wayland-test-clients/xdg-apply-limits.c 
b/src/tests/wayland-test-clients/xdg-apply-limits.c
index aa5ab6e70e..47153cc4ff 100644
--- a/src/tests/wayland-test-clients/xdg-apply-limits.c
+++ b/src/tests/wayland-test-clients/xdg-apply-limits.c
@@ -236,7 +236,7 @@ handle_frame_callback (void               *data,
     {
     case STATE_WAIT_FOR_FRAME_1:
       reset_surface ();
-      test_driver_sync_point (test_driver, 1);
+      test_driver_sync_point (test_driver, 1, NULL);
       break;
     case STATE_WAIT_FOR_FRAME_2:
       exit (EXIT_SUCCESS);
@@ -395,7 +395,7 @@ main (int    argc,
   xdg_toplevel_set_max_size(xdg_toplevel, 700, 500);
   wl_surface_commit (surface);
 
-  test_driver_sync_point (test_driver, 0);
+  test_driver_sync_point (test_driver, 0, NULL);
 
   running = TRUE;
   while (running)
diff --git a/src/tests/wayland-unit-tests.c b/src/tests/wayland-unit-tests.c
index 3f8c62c0c8..03bab12a1f 100644
--- a/src/tests/wayland-unit-tests.c
+++ b/src/tests/wayland-unit-tests.c
@@ -202,6 +202,7 @@ typedef struct _ApplyLimitData
 static void
 on_sync_point (MetaWaylandTestDriver *test_driver,
                unsigned int           sequence,
+               struct wl_resource    *surface_resource,
                struct wl_client      *wl_client,
                ApplyLimitData        *data)
 {


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