From c30cb069f50f74200f3f05d815c814ce7aef49fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 21 Mar 2017 17:22:56 +0800 Subject: [PATCH] tests: Make it possible to emulate backend not supporting tranforms https://bugzilla.gnome.org/show_bug.cgi?id=777732 --- src/tests/meta-monitor-manager-test.c | 16 +++++++++++++++- src/tests/meta-monitor-manager-test.h | 3 +++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/tests/meta-monitor-manager-test.c b/src/tests/meta-monitor-manager-test.c index 2f68809c7..e5a8f6fdf 100644 --- a/src/tests/meta-monitor-manager-test.c +++ b/src/tests/meta-monitor-manager-test.c @@ -34,6 +34,7 @@ struct _MetaMonitorManagerTest MetaMonitorManager parent; gboolean is_lid_closed; + gboolean handles_transforms; int tiled_monitor_count; @@ -74,6 +75,15 @@ meta_monitor_manager_test_set_is_lid_closed (MetaMonitorManagerTest *manager_tes manager_test->is_lid_closed = is_lid_closed; } +void +meta_monitor_manager_test_set_handles_transforms (MetaMonitorManagerTest *manager_test, + gboolean handles_transforms) +{ + g_assert (handles_transforms || meta_is_stage_views_enabled()); + + manager_test->handles_transforms = handles_transforms; +} + int meta_monitor_manager_test_get_tiled_monitor_count (MetaMonitorManagerTest *manager_test) { @@ -361,7 +371,9 @@ meta_monitor_manager_test_is_transform_handled (MetaMonitorManager *manager, MetaCrtc *crtc, MetaMonitorTransform transform) { - return TRUE; + MetaMonitorManagerTest *manager_test = META_MONITOR_MANAGER_TEST (manager); + + return manager_test->handles_transforms; } static int @@ -450,6 +462,8 @@ meta_monitor_manager_test_init (MetaMonitorManagerTest *manager_test) { g_assert (_initial_test_setup); + manager_test->handles_transforms = TRUE; + manager_test->test_setup = _initial_test_setup; } diff --git a/src/tests/meta-monitor-manager-test.h b/src/tests/meta-monitor-manager-test.h index fe2b85cef..eb53aee36 100644 --- a/src/tests/meta-monitor-manager-test.h +++ b/src/tests/meta-monitor-manager-test.h @@ -49,6 +49,9 @@ void meta_monitor_manager_test_emulate_hotplug (MetaMonitorManagerTest *manager_ void meta_monitor_manager_test_set_is_lid_closed (MetaMonitorManagerTest *manager_test, gboolean is_lid_closed); +void meta_monitor_manager_test_set_handles_transforms (MetaMonitorManagerTest *manager_test, + gboolean handles_transforms); + int meta_monitor_manager_test_get_tiled_monitor_count (MetaMonitorManagerTest *manager_test); #endif /* META_MONITOR_MANAGER_TEST_H */