[mutter] tests/stage-view: Keep old stage views alive on hotplug



commit 65aa476414ca87aac64f4e55c26c19322ffd58f0
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Jul 7 15:23:49 2020 +0200

    tests/stage-view: Keep old stage views alive on hotplug
    
    Otherwise we cannot reliably compare them to the new post-hotplug
    views.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1357

 src/tests/stage-view-tests.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/tests/stage-view-tests.c b/src/tests/stage-view-tests.c
index f0691be591..f298b8ba81 100644
--- a/src/tests/stage-view-tests.c
+++ b/src/tests/stage-view-tests.c
@@ -561,11 +561,13 @@ meta_test_actor_stage_views_hot_plug (void)
   is_on_stage_views (actor_1, 1, stage_views->data);
   is_on_stage_views (actor_2, 1, stage_views->next->data);
 
+  prev_stage_views = g_list_copy_deep (stage_views,
+                                       (GCopyFunc) g_object_ref, NULL);
+
   test_setup = create_monitor_test_setup (&hotplug_test_case_setup,
                                           MONITOR_TEST_FLAG_NO_STORED);
   meta_monitor_manager_test_emulate_hotplug (monitor_manager_test, test_setup);
 
-  prev_stage_views = stage_views;
   stage_views = clutter_stage_peek_stage_views (CLUTTER_STAGE (stage));
 
   g_assert (stage_views != prev_stage_views);
@@ -575,6 +577,8 @@ meta_test_actor_stage_views_hot_plug (void)
   assert_is_stage_view (stage_views->data, 0, 0, 1024, 768);
   assert_is_stage_view (stage_views->next->data, 1024, 0, 1024, 768);
 
+  g_list_free_full (prev_stage_views, (GDestroyNotify) g_object_unref);
+
   is_on_stage_views (actor_1, 0);
   is_on_stage_views (actor_2, 0);
 


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