From d7a0ed9ce0b36f48384d6b9c74b88f63921c287a Mon Sep 17 00:00:00 2001 From: Aleksandr Mezin Date: Thu, 2 Jan 2025 19:39:21 +0200 Subject: [PATCH] tests: expect correct window geometry immediately for unchanged settings --- test/test_wm.py | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/test/test_wm.py b/test/test_wm.py index 75d58cf6..59fcbcf0 100644 --- a/test/test_wm.py +++ b/test/test_wm.py @@ -475,10 +475,10 @@ def test_show( wait_idle() assert extension_test_hook.WindowRect == expected_rect - assert extension_test_hook.seen_transitions == expected_show_transitions assert extension_test_hook.WindowSkipTaskbar == window_skip_taskbar assert extension_test_hook.WindowOnAllWorkspaces == expected_above_all_windows assert shell_test_hook.FocusApp == 'com.github.amezin.ddterm' + assert extension_test_hook.seen_transitions == expected_show_transitions if not window_maximize: assert extension_test_hook.WindowAbove == window_above @@ -486,11 +486,11 @@ def test_show( shell_test_hook.WaitLeisure() assert extension_test_hook.WindowRect == expected_rect - assert extension_test_hook.seen_transitions == expected_show_transitions - assert extension_test_hook.Transitions == set() assert extension_test_hook.WindowSkipTaskbar == window_skip_taskbar assert extension_test_hook.WindowOnAllWorkspaces == expected_above_all_windows assert shell_test_hook.FocusApp == 'com.github.amezin.ddterm' + assert extension_test_hook.seen_transitions == expected_show_transitions + assert extension_test_hook.Transitions == set() if not window_maximize: assert extension_test_hook.WindowAbove == window_above @@ -508,6 +508,19 @@ def test_show( app_debug_dbus_interface.reset_size_allocations() extension_dbus_interface.Toggle() extension_test_hook.wait_property('RenderedFirstFrame', True) + + assert extension_test_hook.WindowRect == expected_rect + assert len(set(app_debug_dbus_interface.size_allocations)) <= max_size_allocations + assert len(app_debug_dbus_interface.size_allocations) <= max_size_allocations + 1 + assert len(set(extension_test_hook.window_rect_snapshots)) <= max_window_rect_changes + assert len(extension_test_hook.window_rect_snapshots) <= max_window_rect_changes + 1 + assert extension_test_hook.WindowSkipTaskbar == window_skip_taskbar + assert extension_test_hook.WindowOnAllWorkspaces == expected_above_all_windows + assert shell_test_hook.FocusApp == 'com.github.amezin.ddterm' + + if not window_maximize: + assert extension_test_hook.WindowAbove == window_above + wait_idle() assert extension_test_hook.WindowRect == expected_rect @@ -515,10 +528,10 @@ def test_show( assert len(app_debug_dbus_interface.size_allocations) <= max_size_allocations + 1 assert len(set(extension_test_hook.window_rect_snapshots)) <= max_window_rect_changes assert len(extension_test_hook.window_rect_snapshots) <= max_window_rect_changes + 1 - assert extension_test_hook.seen_transitions == expected_show_transitions assert extension_test_hook.WindowSkipTaskbar == window_skip_taskbar assert extension_test_hook.WindowOnAllWorkspaces == expected_above_all_windows assert shell_test_hook.FocusApp == 'com.github.amezin.ddterm' + assert extension_test_hook.seen_transitions == expected_show_transitions if not window_maximize: assert extension_test_hook.WindowAbove == window_above @@ -530,11 +543,11 @@ def test_show( assert len(app_debug_dbus_interface.size_allocations) <= max_size_allocations + 1 assert len(set(extension_test_hook.window_rect_snapshots)) <= max_window_rect_changes assert len(extension_test_hook.window_rect_snapshots) <= max_window_rect_changes + 1 - assert extension_test_hook.seen_transitions == expected_show_transitions - assert extension_test_hook.Transitions == set() assert extension_test_hook.WindowSkipTaskbar == window_skip_taskbar assert extension_test_hook.WindowOnAllWorkspaces == expected_above_all_windows assert shell_test_hook.FocusApp == 'com.github.amezin.ddterm' + assert extension_test_hook.seen_transitions == expected_show_transitions + assert extension_test_hook.Transitions == set() if not window_maximize: assert extension_test_hook.WindowAbove == window_above