tests: Derive configuration when stage views is disabled
In order to test deriving the logical state from the underlying configuration, as is always done on X11, make the test backend derive the state when stage views are disabled. https://bugzilla.gnome.org/show_bug.cgi?id=777732
This commit is contained in:
parent
af4017de49
commit
99a0b43f28
@ -268,7 +268,10 @@ meta_monitor_manager_test_apply_monitors_config (MetaMonitorManager *manage
|
||||
manager->screen_width = 1;
|
||||
manager->screen_height = 1;
|
||||
|
||||
meta_monitor_manager_rebuild (manager, NULL);
|
||||
if (meta_is_stage_views_enabled ())
|
||||
meta_monitor_manager_rebuild (manager, NULL);
|
||||
else
|
||||
meta_monitor_manager_rebuild_derived (manager);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -296,7 +299,11 @@ meta_monitor_manager_test_apply_monitors_config (MetaMonitorManager *manage
|
||||
g_ptr_array_free (output_infos, TRUE);
|
||||
|
||||
update_screen_size (manager, config);
|
||||
meta_monitor_manager_rebuild (manager, config);
|
||||
|
||||
if (meta_is_stage_views_enabled ())
|
||||
meta_monitor_manager_rebuild (manager, config);
|
||||
else
|
||||
meta_monitor_manager_rebuild_derived (manager);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -510,6 +510,12 @@ meta_test_monitor_store_scale (void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!meta_is_stage_views_enabled ())
|
||||
{
|
||||
g_test_skip ("Not using stage views");
|
||||
return;
|
||||
}
|
||||
|
||||
set_custom_monitor_config ("scale.xml");
|
||||
|
||||
check_monitor_configurations (&expect);
|
||||
|
@ -707,6 +707,7 @@ check_monitor_configuration (MonitorTestCase *test_case)
|
||||
else
|
||||
{
|
||||
MetaCrtc *crtc = &monitor_manager->crtcs[i];
|
||||
MetaLogicalMonitor *logical_monitor = crtc->logical_monitor;
|
||||
MetaCrtcMode *expected_current_mode =
|
||||
&monitor_manager->modes[test_case->expect.crtcs[i].current_mode];
|
||||
int crtc_x, crtc_y;
|
||||
@ -717,10 +718,30 @@ check_monitor_configuration (MonitorTestCase *test_case)
|
||||
==,
|
||||
test_case->expect.crtcs[i].transform);
|
||||
|
||||
get_compensated_crtc_position (crtc, &crtc_x, &crtc_y);
|
||||
if (meta_is_stage_views_enabled ())
|
||||
{
|
||||
get_compensated_crtc_position (crtc, &crtc_x, &crtc_y);
|
||||
|
||||
g_assert_cmpint (crtc_x, ==, test_case->expect.crtcs[i].x);
|
||||
g_assert_cmpint (crtc_y, ==, test_case->expect.crtcs[i].y);
|
||||
g_assert_cmpint (crtc_x, ==, test_case->expect.crtcs[i].x);
|
||||
g_assert_cmpint (crtc_y, ==, test_case->expect.crtcs[i].y);
|
||||
}
|
||||
else
|
||||
{
|
||||
int expect_crtc_x;
|
||||
int expect_crtc_y;
|
||||
|
||||
g_assert_cmpuint (logical_monitor->transform,
|
||||
==,
|
||||
crtc->transform);
|
||||
|
||||
expect_crtc_x = (test_case->expect.crtcs[i].x +
|
||||
logical_monitor->rect.x);
|
||||
expect_crtc_y = (test_case->expect.crtcs[i].y +
|
||||
logical_monitor->rect.y);
|
||||
|
||||
g_assert_cmpint (crtc->rect.x, ==, expect_crtc_x);
|
||||
g_assert_cmpint (crtc->rect.y, ==, expect_crtc_y);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1455,6 +1476,12 @@ meta_test_monitor_hidpi_linear_config (void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!meta_is_stage_views_enabled ())
|
||||
{
|
||||
g_test_skip ("Not using stage views");
|
||||
return;
|
||||
}
|
||||
|
||||
test_setup = create_monitor_test_setup (&test_case,
|
||||
MONITOR_TEST_FLAG_NO_STORED);
|
||||
emulate_hotplug (test_setup);
|
||||
@ -2788,6 +2815,12 @@ meta_test_monitor_custom_scale_config (void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!meta_is_stage_views_enabled ())
|
||||
{
|
||||
g_test_skip ("Not using stage views");
|
||||
return;
|
||||
}
|
||||
|
||||
test_setup = create_monitor_test_setup (&test_case,
|
||||
MONITOR_TEST_FLAG_NONE);
|
||||
set_custom_monitor_config ("scale.xml");
|
||||
@ -2924,6 +2957,12 @@ meta_test_monitor_custom_tiled_config (void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!meta_is_stage_views_enabled ())
|
||||
{
|
||||
g_test_skip ("Not using stage views");
|
||||
return;
|
||||
}
|
||||
|
||||
test_setup = create_monitor_test_setup (&test_case,
|
||||
MONITOR_TEST_FLAG_NONE);
|
||||
set_custom_monitor_config ("tiled.xml");
|
||||
@ -3079,6 +3118,12 @@ meta_test_monitor_custom_tiled_custom_resolution_config (void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!meta_is_stage_views_enabled ())
|
||||
{
|
||||
g_test_skip ("Not using stage views");
|
||||
return;
|
||||
}
|
||||
|
||||
test_setup = create_monitor_test_setup (&test_case,
|
||||
MONITOR_TEST_FLAG_NONE);
|
||||
set_custom_monitor_config ("tiled-custom-resolution.xml");
|
||||
|
Loading…
Reference in New Issue
Block a user