[mutter] tests/monitor: Test two crtcs, one output



commit 6776329cf5cb35bb3523fdfcd5241ea6d7bcbe93
Author: Jonas Ådahl <jadahl gmail com>
Date:   Wed Dec 7 15:15:25 2016 +0800

    tests/monitor: Test two crtcs, one output
    
    https://bugzilla.gnome.org/show_bug.cgi?id=777732

 src/tests/monitor-unit-tests.c |   41 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 41 insertions(+), 0 deletions(-)
---
diff --git a/src/tests/monitor-unit-tests.c b/src/tests/monitor-unit-tests.c
index 9a14f3c..b344f04 100644
--- a/src/tests/monitor-unit-tests.c
+++ b/src/tests/monitor-unit-tests.c
@@ -313,6 +313,45 @@ meta_test_monitor_initial_linear_config (void)
   check_monitor_configuration (&initial_test_case);
 }
 
+static void
+emulate_hotplug (MetaMonitorTestSetup *test_setup)
+{
+  MetaBackend *backend = meta_get_backend ();
+  MetaMonitorManager *monitor_manager =
+    meta_backend_get_monitor_manager (backend);
+  MetaMonitorManagerTest *monitor_manager_test =
+    META_MONITOR_MANAGER_TEST (monitor_manager);
+
+  meta_monitor_manager_test_emulate_hotplug (monitor_manager_test, test_setup);
+}
+
+static void
+meta_test_monitor_one_disconnected_linear_config (void)
+{
+  MonitorTestCase test_case = initial_test_case;
+  MetaMonitorTestSetup *test_setup;
+
+  test_case.setup.n_outputs = 1;
+
+  test_case.expect = (MonitorTestCaseExpect) {
+    .logical_monitors = {
+      {
+        .layout = { .x = 0, .y = 0, .width = 1024, .height = 768 },
+        .scale = 1
+      },
+    },
+    .n_logical_monitors = 1,
+    .n_outputs = 1,
+    .n_crtcs = 2,
+    .screen_width = 1024,
+    .screen_height = 768
+  };
+
+  test_setup = create_monitor_test_setup (&test_case);
+  emulate_hotplug (test_setup);
+  check_monitor_configuration (&test_case);
+}
+
 void
 init_monitor_tests (void)
 {
@@ -323,4 +362,6 @@ init_monitor_tests (void)
 
   g_test_add_func ("/backends/monitor/initial-linear-config",
                    meta_test_monitor_initial_linear_config);
+  g_test_add_func ("/backends/monitor/one-disconnected-linear-config",
+                   meta_test_monitor_one_disconnected_linear_config);
 }


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