Skip to content

Commit

Permalink
tests: expect correct window geometry immediately for unchanged settings
Browse files Browse the repository at this point in the history
  • Loading branch information
amezin committed Jan 3, 2025
1 parent a7e0767 commit d7a0ed9
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions test/test_wm.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,22 +475,22 @@ 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

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
Expand All @@ -508,17 +508,30 @@ 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
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.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
Expand All @@ -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
Expand Down

0 comments on commit d7a0ed9

Please sign in to comment.