mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 03:22:04 +00:00
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:
parent
d830d985c1
commit
d85c3c1e94
@ -149,6 +149,7 @@ stacking_tests = [
|
||||
'basic-wayland',
|
||||
'client-side-decorated',
|
||||
'closed-transient',
|
||||
'closed-transient-no-default-focus',
|
||||
'closed-transient-no-input-no-take-focus-parent',
|
||||
'closed-transient-no-input-no-take-focus-parents',
|
||||
'closed-transient-no-input-parent',
|
||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user