tests/stacking: Avoid random failures in focus tests

Some tests were not waiting for the test client to actually issue
destroy commands before checking their effect on the window focus.

Similarly when mutter is supposed to change the focus based on a delay
by sending a WM_TAKE_FOCUS to the client, this also could fail without
synchronization with the client before checking the result.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1325
This commit is contained in:
Sebastian Keller 2020-06-21 00:40:18 +02:00
parent 5c5dcd58b5
commit c3d1320343
5 changed files with 15 additions and 5 deletions

View File

@ -20,7 +20,7 @@ assert_focused 1/3
assert_stacking 2/1 1/1 1/2 1/3
destroy 1/3
dispatch
wait
assert_focused none
assert_stacking 2/1 1/1 1/2
@ -32,5 +32,7 @@ assert_focused 2/1
assert_stacking 1/1 1/2 2/1
sleep 250
wait
assert_focused 2/1
assert_stacking 1/1 1/2 2/1

View File

@ -20,11 +20,13 @@ assert_focused 1/3
assert_stacking 2/1 1/1 1/2 1/3
destroy 1/3
dispatch
wait
assert_focused none
assert_stacking 2/1 1/1 1/2
sleep 150
wait
assert_focused 1/1
assert_stacking 2/1 1/1 1/2

View File

@ -30,14 +30,16 @@ assert_focused 1/5
assert_stacking 0/1 1/1 1/2 1/3 1/4 1/5
destroy 1/5
dispatch
wait
assert_focused none
assert_stacking 0/1 1/1 1/2 1/3 1/4
destroy 1/2
dispatch
wait
sleep 450
wait
assert_focused 1/1
assert_stacking 0/1 1/1 1/3 1/4

View File

@ -30,12 +30,14 @@ assert_focused 1/5
assert_stacking 0/1 1/1 1/2 1/3 1/4 1/5
destroy 1/5
dispatch
wait
assert_focused none
assert_stacking 0/1 1/1 1/2 1/3 1/4
sleep 600
wait
assert_focused 1/1
assert_stacking 0/1 1/1 1/2 1/3 1/4

View File

@ -30,5 +30,7 @@ assert_focused 1/2
assert_stacking 0/1 1/1 1/2
sleep 150
wait
assert_focused 1/2
assert_stacking 0/1 1/1 1/2