testcases: fix race conditions in various tests

This commit is contained in:
Maik Fischer
2011-11-21 16:49:22 +01:00
committed by Michael Stapelberg
parent af793c9030
commit 0f386a96e7
4 changed files with 33 additions and 22 deletions

View File

@ -49,8 +49,7 @@ cmd 'floating enable';
# now kill the third one (it's floating). focus should stay unchanged
cmd '[id="' . $third->id . '"] kill';
# TODO: wait for unmapnotify
sync_with_i3($x);
wait_for_unmap($x);
is($x->input_focus, $second->id, 'second con still focused after killing third');
@ -81,15 +80,12 @@ cmd 'floating enable';
# now kill the second one. focus should fall back to the third one, which is
# also floating
cmd 'kill';
# TODO: wait for unmapnotify
sync_with_i3($x);
wait_for_unmap($x);
is($x->input_focus, $third->id, 'third con focused');
cmd 'kill';
# TODO: wait for unmapnotify
sync_with_i3($x);
wait_for_unmap($x);
is($x->input_focus, $first->id, 'first con focused after killing all floating cons');
@ -122,15 +118,12 @@ sync_with_i3($x);
# now kill the second one. focus should fall back to the third one, which is
# also floating
cmd 'kill';
# TODO: wait for unmapnotify
sync_with_i3($x);
wait_for_unmap($x);
is($x->input_focus, $third->id, 'third con focused');
cmd 'kill';
# TODO: wait for unmapnotify
sync_with_i3($x);
wait_for_unmap($x);
is($x->input_focus, $first->id, 'first con focused after killing all floating cons');