From 9f999f9cb3acae63b8844b2a7a2d92394706c521 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Fri, 20 Dec 2019 14:27:11 +0100 Subject: [PATCH] tests/monitor-unit-tests: Add test to for ignoring connector IDs 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 --- src/tests/monitor-unit-tests.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/tests/monitor-unit-tests.c b/src/tests/monitor-unit-tests.c index 683f366a3..125405867 100644 --- a/src/tests/monitor-unit-tests.c +++ b/src/tests/monitor-unit-tests.c @@ -89,7 +89,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 @@ -924,6 +925,9 @@ create_monitor_test_setup (MonitorTestCase *test_case, else hotplug_mode_update = FALSE; + if (flags & MONITOR_TEST_FLAG_OFFSET_DP_CONNECTOR) + n_normal_panels = 100; + test_setup = g_new0 (MetaMonitorTestSetup, 1); test_setup->modes = NULL; @@ -5279,6 +5283,15 @@ meta_test_monitor_custom_oneoff (void) emulate_hotplug (test_setup); check_monitor_configuration (&test_case); + + /* Same test after hotplugging the monitor to a different port */ + test_setup = create_monitor_test_setup (&test_case, + 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); } static void