summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2019-12-20 14:27:11 +0100
committerBenjamin Berg <bberg@redhat.com>2020-10-23 17:13:35 +0200
commit26a3b841810200a836834648ad0d8c38fe01daa4 (patch)
tree8675ad1b6a0f9ef392aac02678872954e3d57448
parentb5d5de7e90c6832310c6733f1151f604f9f3d0b8 (diff)
downloadmutter-26a3b841810200a836834648ad0d8c38fe01daa4.tar.gz
tests/monitor-unit-tests: Add test for ignored connector IDsbenzea/ignore-monitor-connector
In some cases the connector ID should be ignored. Add a flag to modify the generated connector ID, and test whether the stored configuration still applies with the changed IDs. https://gitlab.gnome.org/GNOME/mutter/issues/932
-rw-r--r--src/tests/monitor-test-utils.c3
-rw-r--r--src/tests/monitor-test-utils.h3
-rw-r--r--src/tests/monitor-unit-tests.c10
3 files changed, 15 insertions, 1 deletions
diff --git a/src/tests/monitor-test-utils.c b/src/tests/monitor-test-utils.c
index a83d8c8e2..ddfe7e2b4 100644
--- a/src/tests/monitor-test-utils.c
+++ b/src/tests/monitor-test-utils.c
@@ -541,6 +541,9 @@ create_monitor_test_setup (MonitorTestCaseSetup *setup,
int n_laptop_panels = 0;
int n_normal_panels = 0;
+ if (flags & MONITOR_TEST_FLAG_OFFSET_DP_CONNECTOR)
+ n_normal_panels = 100;
+
test_setup = g_new0 (MetaMonitorTestSetup, 1);
test_setup->modes = NULL;
diff --git a/src/tests/monitor-test-utils.h b/src/tests/monitor-test-utils.h
index 3ebf1ff79..4d0653e82 100644
--- a/src/tests/monitor-test-utils.h
+++ b/src/tests/monitor-test-utils.h
@@ -78,7 +78,8 @@
typedef enum _MonitorTestFlag
{
MONITOR_TEST_FLAG_NONE,
- MONITOR_TEST_FLAG_NO_STORED
+ MONITOR_TEST_FLAG_NO_STORED,
+ MONITOR_TEST_FLAG_OFFSET_DP_CONNECTOR,
} MonitorTestFlag;
typedef struct _MonitorTestCaseMode
diff --git a/src/tests/monitor-unit-tests.c b/src/tests/monitor-unit-tests.c
index 76317d83a..44e6f7130 100644
--- a/src/tests/monitor-unit-tests.c
+++ b/src/tests/monitor-unit-tests.c
@@ -4824,6 +4824,16 @@ meta_test_monitor_custom_oneoff (void)
check_monitor_configuration (&test_case.expect);
check_monitor_test_clients_state ();
+
+ /* Same test after hotplugging the monitor to a different port */
+ test_setup = create_monitor_test_setup (&test_case.setup,
+ MONITOR_TEST_FLAG_NONE |
+ MONITOR_TEST_FLAG_OFFSET_DP_CONNECTOR);
+ set_custom_monitor_config ("oneoff.xml");
+ emulate_hotplug (test_setup);
+
+ check_monitor_configuration (&test_case.expect);
+ check_monitor_test_clients_state ();
}
static void