[mutter/benzea/ignore-monitor-connector: 1253/1253] tests/monitor-unit-tests: Add test for ignored connector IDs
- From: Benjamin Berg <bberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/benzea/ignore-monitor-connector: 1253/1253] tests/monitor-unit-tests: Add test for ignored connector IDs
- Date: Fri, 23 Oct 2020 15:16:36 +0000 (UTC)
commit 26a3b841810200a836834648ad0d8c38fe01daa4
Author: Benjamin Berg <bberg redhat com>
Date: Fri Dec 20 14:27:11 2019 +0100
tests/monitor-unit-tests: Add test for ignored 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-test-utils.c | 3 +++
src/tests/monitor-test-utils.h | 3 ++-
src/tests/monitor-unit-tests.c | 10 ++++++++++
3 files changed, 15 insertions(+), 1 deletion(-)
---
diff --git a/src/tests/monitor-test-utils.c b/src/tests/monitor-test-utils.c
index a83d8c8e28..ddfe7e2b49 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 3ebf1ff796..4d0653e820 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 76317d83a3..44e6f71304 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]