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
This commit is contained in:
Benjamin Berg 2019-12-20 14:27:11 +01:00
parent 1dc6998bf9
commit 9f999f9cb3

View File

@ -89,7 +89,8 @@
typedef enum _MonitorTestFlag typedef enum _MonitorTestFlag
{ {
MONITOR_TEST_FLAG_NONE, MONITOR_TEST_FLAG_NONE,
MONITOR_TEST_FLAG_NO_STORED MONITOR_TEST_FLAG_NO_STORED,
MONITOR_TEST_FLAG_OFFSET_DP_CONNECTOR,
} MonitorTestFlag; } MonitorTestFlag;
typedef struct _MonitorTestCaseMode typedef struct _MonitorTestCaseMode
@ -924,6 +925,9 @@ create_monitor_test_setup (MonitorTestCase *test_case,
else else
hotplug_mode_update = FALSE; hotplug_mode_update = FALSE;
if (flags & MONITOR_TEST_FLAG_OFFSET_DP_CONNECTOR)
n_normal_panels = 100;
test_setup = g_new0 (MetaMonitorTestSetup, 1); test_setup = g_new0 (MetaMonitorTestSetup, 1);
test_setup->modes = NULL; test_setup->modes = NULL;
@ -5279,6 +5283,15 @@ meta_test_monitor_custom_oneoff (void)
emulate_hotplug (test_setup); emulate_hotplug (test_setup);
check_monitor_configuration (&test_case); 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 static void