t/164-kill-win-vs-client: get rid of sleep()s
This commit is contained in:
parent
bee1e90b1e
commit
41400d8a16
|
@ -409,10 +409,12 @@ sub focused_ws {
|
||||||
# See also docs/testsuite for a long explanation
|
# See also docs/testsuite for a long explanation
|
||||||
#
|
#
|
||||||
sub sync_with_i3 {
|
sub sync_with_i3 {
|
||||||
|
my %args = @_ == 1 ? %{$_[0]} : @_;
|
||||||
|
|
||||||
# Since we need a (mapped) window for receiving a ClientMessage, we create
|
# Since we need a (mapped) window for receiving a ClientMessage, we create
|
||||||
# one on the first call of sync_with_i3. It will be re-used in all
|
# one on the first call of sync_with_i3. It will be re-used in all
|
||||||
# subsequent calls.
|
# subsequent calls.
|
||||||
if (!defined($_sync_window)) {
|
if (!defined($_sync_window) || exists($args{no_cache})) {
|
||||||
$_sync_window = open_window(
|
$_sync_window = open_window(
|
||||||
rect => [ -15, -15, 10, 10 ],
|
rect => [ -15, -15, 10, 10 ],
|
||||||
override_redirect => 1,
|
override_redirect => 1,
|
||||||
|
|
|
@ -28,8 +28,7 @@ sub two_windows {
|
||||||
my $tmp = two_windows;
|
my $tmp = two_windows;
|
||||||
|
|
||||||
cmd 'kill';
|
cmd 'kill';
|
||||||
|
sync_with_i3;
|
||||||
sleep 0.25;
|
|
||||||
|
|
||||||
ok(@{get_ws_content($tmp)} == 1, 'one container left after killing');
|
ok(@{get_ws_content($tmp)} == 1, 'one container left after killing');
|
||||||
|
|
||||||
|
@ -41,8 +40,7 @@ ok(@{get_ws_content($tmp)} == 1, 'one container left after killing');
|
||||||
$tmp = two_windows;
|
$tmp = two_windows;
|
||||||
|
|
||||||
cmd 'kill window';
|
cmd 'kill window';
|
||||||
|
sync_with_i3;
|
||||||
sleep 0.25;
|
|
||||||
|
|
||||||
ok(@{get_ws_content($tmp)} == 1, 'one container left after killing');
|
ok(@{get_ws_content($tmp)} == 1, 'one container left after killing');
|
||||||
|
|
||||||
|
@ -54,8 +52,9 @@ ok(@{get_ws_content($tmp)} == 1, 'one container left after killing');
|
||||||
$tmp = two_windows;
|
$tmp = two_windows;
|
||||||
|
|
||||||
cmd 'kill client';
|
cmd 'kill client';
|
||||||
|
# We need to re-establish the X11 connection which we just killed :).
|
||||||
sleep 0.25;
|
$x = i3test::X11->new;
|
||||||
|
sync_with_i3(no_cache => 1);
|
||||||
|
|
||||||
ok(@{get_ws_content($tmp)} == 0, 'no containers left after killing');
|
ok(@{get_ws_content($tmp)} == 0, 'no containers left after killing');
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue