tests/monitor-unit-tests: Make hotplug mode part of test setup

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1287
This commit is contained in:
Jonas Ådahl 2020-02-26 09:35:14 +01:00 committed by Georges Basile Stavracas Neto
parent 9bcf1d0238
commit 46e3d20057
3 changed files with 21 additions and 18 deletions

View File

@ -671,8 +671,16 @@ create_monitor_test_setup (MonitorTestCaseSetup *setup,
output->vendor = g_strdup ("MetaProduct's Inc.");
output->product = g_strdup ("MetaMonitor");
output->serial = g_strdup (serial);
output->suggested_x = -1;
output->suggested_y = -1;
if (setup->outputs[i].hotplug_mode)
{
output->suggested_x = setup->outputs[i].suggested_x;
output->suggested_y = setup->outputs[i].suggested_y;
}
else
{
output->suggested_x = -1;
output->suggested_y = -1;
}
output->hotplug_mode_update = hotplug_mode_update;
output->width_mm = setup->outputs[i].width_mm;
output->height_mm = setup->outputs[i].height_mm;

View File

@ -107,6 +107,9 @@ typedef struct _MonitorTestCaseOutput
gboolean is_underscanning;
const char *serial;
MetaMonitorTransform panel_orientation_transform;
gboolean hotplug_mode;
int suggested_x;
int suggested_y;
} MonitorTestCaseOutput;
typedef struct _MonitorTestCaseCrtc

View File

@ -1178,15 +1178,6 @@ meta_test_monitor_hidpi_linear_config (void)
check_monitor_test_clients_state ();
}
static void
set_suggested_output_position (MetaOutput *output,
int x,
int y)
{
output->suggested_x = x;
output->suggested_y = y;
}
static void
meta_test_monitor_suggested_config (void)
{
@ -1214,7 +1205,10 @@ meta_test_monitor_suggested_config (void)
.possible_crtcs = { 0 },
.n_possible_crtcs = 1,
.width_mm = 222,
.height_mm = 125
.height_mm = 125,
.hotplug_mode = TRUE,
.suggested_x = 1024,
.suggested_y = 758,
},
{
.crtc = 1,
@ -1224,7 +1218,10 @@ meta_test_monitor_suggested_config (void)
.possible_crtcs = { 1 },
.n_possible_crtcs = 1,
.width_mm = 220,
.height_mm = 124
.height_mm = 124,
.hotplug_mode = TRUE,
.suggested_x = 0,
.suggested_y = 0,
}
},
.n_outputs = 2,
@ -1327,11 +1324,6 @@ meta_test_monitor_suggested_config (void)
test_setup = create_monitor_test_setup (&test_case.setup,
MONITOR_TEST_FLAG_NO_STORED);
set_suggested_output_position (g_list_nth_data (test_setup->outputs, 0),
1024, 758);
set_suggested_output_position (g_list_nth_data (test_setup->outputs, 1),
0, 0);
emulate_hotplug (test_setup);
check_monitor_configuration (&test_case.expect);
check_monitor_test_clients_state ();