tests/stacking: Add test for when no default focus window can be found

The previous commit removed checks for intermediate focus states which
would make tests randomly fail, because of their time dependence. What
can be tested however is that if there is no other window available that
would accept the focus, that the focus remains at 'none', after the
focused window has been closed. This newly introduced test checks the
focus directly after closing the window (and syncing) and after the time
it would have taken for the queue to finish. The first check has a
similar timing issue as the removed focus checks in the other tests, but
the test will never accidentally fail, because regardless of whether the
queue has finished or not, the focus is always expected to be 'none'.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1329
This commit is contained in:
Sebastian Keller 2020-06-26 21:32:39 +02:00 committed by Georges Basile Stavracas Neto
parent d830d985c1
commit d85c3c1e94
2 changed files with 30 additions and 0 deletions

View File

@ -149,6 +149,7 @@ stacking_tests = [
'basic-wayland', 'basic-wayland',
'client-side-decorated', 'client-side-decorated',
'closed-transient', 'closed-transient',
'closed-transient-no-default-focus',
'closed-transient-no-input-no-take-focus-parent', 'closed-transient-no-input-no-take-focus-parent',
'closed-transient-no-input-no-take-focus-parents', 'closed-transient-no-input-no-take-focus-parents',
'closed-transient-no-input-parent', 'closed-transient-no-input-parent',

View File

@ -0,0 +1,29 @@
new_client 1 x11
create 1/1
accept_focus 1/1 false
show 1/1
create 1/2 csd
set_parent 1/2 1
accept_focus 1/2 false
show 1/2
create 1/3 csd
set_parent 1/3 2
show 1/3
wait
assert_focused 1/3
assert_stacking 1/1 1/2 1/3
destroy 1/3
wait
assert_focused none
assert_stacking 1/1 1/2
sleep 150
wait
assert_focused none
assert_stacking 1/1 1/2