Skip to content

Commit 01f2fde

Browse files
committed
tests/wm: make gdk_backend class-scoped fixture
1 parent f45335e commit 01f2fde

9 files changed

+378
-375
lines changed

test/pict/test_maximize_unmaximize.gen

Lines changed: 43 additions & 39 deletions
Large diffs are not rendered by default.

test/pict/test_maximize_unmaximize.model

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ window_above: True, False
1717
window_skip_taskbar: True, False
1818
window_stick: True, False
1919

20-
gdk_backend: GdkBackend.X11, GdkBackend.WAYLAND (100)
21-
2220
monitor0_transform: displayconfig.Transform.NORMAL
2321
monitor1_transform: <monitor0_transform>, MONITOR_DISABLED
2422

2523
IF [class] = "TestX11"
26-
THEN [layout_mode] = "displayconfig.LayoutMode.PHYSICAL" AND [gdk_backend] = "GdkBackend.X11";
24+
THEN [layout_mode] = "displayconfig.LayoutMode.PHYSICAL";
2725

2826
IF [layout_mode] = "displayconfig.LayoutMode.PHYSICAL"
2927
THEN [monitor0_scale] IN {1.0, 2.0} AND [monitor1_scale] IN {1.0, 2.0, 0};

test/pict/test_mouse_resize.gen

Lines changed: 44 additions & 44 deletions
Large diffs are not rendered by default.

test/pict/test_mouse_resize.model

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
class: TestX11, TestWayland, TestWaylandTwoMonitors
22

3-
gdk_backend: GdkBackend.X11, GdkBackend.WAYLAND (100)
4-
53
monitor0_scale: 1.0, 1.25, 1.502347469329834, 1.748633861541748, 2.0
64
monitor1_scale: <monitor0_scale>, 0
75
layout_mode: displayconfig.LayoutMode.PHYSICAL (100), displayconfig.LayoutMode.LOGICAL
@@ -20,7 +18,7 @@ monitor0_transform: displayconfig.Transform.NORMAL
2018
monitor1_transform: <monitor0_transform>, MONITOR_DISABLED
2119

2220
IF [class] = "TestX11"
23-
THEN [layout_mode] = "displayconfig.LayoutMode.PHYSICAL" AND [gdk_backend] = "GdkBackend.X11";
21+
THEN [layout_mode] = "displayconfig.LayoutMode.PHYSICAL";
2422

2523
IF [layout_mode] = "displayconfig.LayoutMode.PHYSICAL"
2624
THEN [monitor0_scale] IN {1.0, 2.0} AND [monitor1_scale] IN {1.0, 2.0, 0};

test/pict/test_resize_maximize_unmaximize.gen

Lines changed: 46 additions & 45 deletions
Large diffs are not rendered by default.

test/pict/test_resize_maximize_unmaximize.model

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@ monitor0_scale: 1.0, 1.25, 1.502347469329834, 1.748633861541748, 2.0
1313
monitor1_scale: <monitor0_scale>, 0
1414
layout_mode: displayconfig.LayoutMode.PHYSICAL (100), displayconfig.LayoutMode.LOGICAL
1515

16-
gdk_backend: GdkBackend.X11, GdkBackend.WAYLAND (100)
17-
1816
monitor0_transform: displayconfig.Transform.NORMAL
1917
monitor1_transform: <monitor0_transform>, MONITOR_DISABLED
2018

2119
IF [class] = "TestX11"
22-
THEN [layout_mode] = "displayconfig.LayoutMode.PHYSICAL" AND [gdk_backend] = "GdkBackend.X11";
20+
THEN [layout_mode] = "displayconfig.LayoutMode.PHYSICAL";
2321

2422
IF [layout_mode] = "displayconfig.LayoutMode.PHYSICAL"
2523
THEN [monitor0_scale] IN {1.0, 2.0} AND [monitor1_scale] IN {1.0, 2.0, 0};

test/pict/test_show.gen

Lines changed: 225 additions & 225 deletions
Large diffs are not rendered by default.

test/pict/test_show.model

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ window_above: True, False
1919
window_skip_taskbar: True, False
2020
window_stick: True, False
2121

22-
gdk_backend: GdkBackend.X11, GdkBackend.WAYLAND (100)
23-
2422
monitor0_transform: displayconfig.Transform.NORMAL, displayconfig.Transform.ROTATE_90
2523
monitor1_transform: <monitor0_transform>, MONITOR_DISABLED
2624

2725
IF [class] = "TestX11"
28-
THEN [layout_mode] = "displayconfig.LayoutMode.PHYSICAL" AND [gdk_backend] = "GdkBackend.X11" AND [monitor0_transform] = "displayconfig.Transform.NORMAL";
26+
THEN [layout_mode] = "displayconfig.LayoutMode.PHYSICAL" AND [monitor0_transform] = "displayconfig.Transform.NORMAL";
2927

3028
IF [layout_mode] = "displayconfig.LayoutMode.PHYSICAL"
3129
THEN [monitor0_scale] IN {1.0, 2.0} AND [monitor1_scale] IN {1.0, 2.0, 0};

test/test_wm.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ def test_show(
432432
assert unmaximized_rect == extension_dbus_interface.TargetRect
433433
assert extension_test_hook.ClientType == gdk_backend
434434
assert monitor_scale == extension_dbus_interface.TargetMonitorScale
435+
assert extension_test_hook.ClientType == gdk_backend
435436

436437
extension_test_hook.wait_property('RenderedFirstFrame', True)
437438
wait_idle()
@@ -697,14 +698,12 @@ def get_parametrization(cls, name):
697698
reverse = cls._testmethods.index(name) % 2 == 1
698699

699700
p = p.order_by('layout_mode', reverse) # Change requires restarting the app
700-
p = p.order_by('gdk_backend', reverse) # Change requires restarting the app
701701

702702
return p
703703

704704
def pytest_generate_tests(self, metafunc):
705705
indirect = {
706706
'animation_mode',
707-
'gdk_backend',
708707
'current_monitor',
709708
'window_position',
710709
'window_size',
@@ -738,13 +737,20 @@ def monitor_layout(
738737

739738
return (displayconfig.SimpleMonitorConfig(scale=monitor0_scale),)
740739

741-
@pytest.fixture
742-
def gdk_backend(self, request):
743-
assert request.param == GdkBackend.X11
744-
745-
return request.param
746-
747-
740+
@pytest.fixture(scope='class')
741+
def gdk_backend(self):
742+
return GdkBackend.X11
743+
744+
745+
@pytest.mark.parametrize(
746+
'gdk_backend',
747+
(
748+
pytest.param(GdkBackend.WAYLAND, id='GdkBackend.WAYLAND'),
749+
pytest.param(GdkBackend.X11, id='GdkBackend.X11'),
750+
),
751+
indirect=True,
752+
scope='class',
753+
)
748754
class TestWayland(CommonTests, fixtures.GnomeSessionWaylandFixtures):
749755
@pytest.fixture
750756
def monitor_layout(
@@ -776,7 +782,7 @@ def expected_show_transitions(
776782

777783
return animation_mode.expected_transitions(window_position)
778784

779-
@pytest.fixture
785+
@pytest.fixture(scope='class')
780786
def gdk_backend(
781787
self,
782788
request,

0 commit comments

Comments
 (0)