tests: implement sync_with_i3 and use it instead of sleep()
Also use open_standard_window() in a few more places where appropriate
This commit is contained in:
@ -5,7 +5,6 @@
|
||||
|
||||
use i3test;
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
|
||||
BEGIN {
|
||||
use_ok('X11::XCB::Window');
|
||||
@ -22,20 +21,7 @@ my $tmp = fresh_workspace;
|
||||
my $x = X11::XCB::Connection->new;
|
||||
|
||||
# Create a floating window
|
||||
my $window = $x->root->create_child(
|
||||
class => WINDOW_CLASS_INPUT_OUTPUT,
|
||||
rect => [ 0, 0, 30, 30],
|
||||
background_color => '#C0C0C0',
|
||||
# replace the type with 'utility' as soon as the coercion works again in X11::XCB
|
||||
window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY'),
|
||||
);
|
||||
|
||||
isa_ok($window, 'X11::XCB::Window');
|
||||
|
||||
$window->map;
|
||||
|
||||
sleep 0.25;
|
||||
|
||||
my $window = open_standard_window($x, undef, 1);
|
||||
ok($window->mapped, 'Window is mapped');
|
||||
|
||||
my $ws = get_ws($tmp);
|
||||
@ -45,17 +31,7 @@ is(@{$ws->{floating_nodes}}, 1, 'one floating node');
|
||||
is(@{$nodes}, 0, 'no tiling nodes');
|
||||
|
||||
# Create a tiling window
|
||||
my $twindow = $x->root->create_child(
|
||||
class => WINDOW_CLASS_INPUT_OUTPUT,
|
||||
rect => [ 0, 0, 30, 30],
|
||||
background_color => '#C0C0C0',
|
||||
);
|
||||
|
||||
isa_ok($twindow, 'X11::XCB::Window');
|
||||
|
||||
$twindow->map;
|
||||
|
||||
sleep 0.25;
|
||||
my $twindow = open_standard_window($x);
|
||||
|
||||
($nodes, $focus) = get_ws_content($tmp);
|
||||
|
||||
@ -78,20 +54,7 @@ is(@{$ws->{floating_nodes}}, 0, 'no floating nodes so far');
|
||||
is(@{$ws->{nodes}}, 1, 'one tiling node (stacked con)');
|
||||
|
||||
# Create a floating window
|
||||
my $window = $x->root->create_child(
|
||||
class => WINDOW_CLASS_INPUT_OUTPUT,
|
||||
rect => [ 0, 0, 30, 30],
|
||||
background_color => '#C0C0C0',
|
||||
# replace the type with 'utility' as soon as the coercion works again in X11::XCB
|
||||
window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY'),
|
||||
);
|
||||
|
||||
isa_ok($window, 'X11::XCB::Window');
|
||||
|
||||
$window->map;
|
||||
|
||||
sleep 0.25;
|
||||
|
||||
my $window = open_standard_window($x, undef, 1);
|
||||
ok($window->mapped, 'Window is mapped');
|
||||
|
||||
$ws = get_ws($tmp);
|
||||
|
Reference in New Issue
Block a user