testcases: use open_window everywhere

This commit is contained in:
Maik Fischer
2011-11-23 17:22:43 +01:00
committed by Michael Stapelberg
parent ec877f2ec4
commit 475dc3c532
11 changed files with 104 additions and 352 deletions

View File

@ -2,24 +2,12 @@
# vim:ts=4:sw=4:expandtab
use i3test;
use X11::XCB 'WINDOW_CLASS_INPUT_OUTPUT';
# Create a floating window which is smaller than the minimum enforced size of i3
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'),
event_mask => [ 'structure_notify' ],
);
my $window = open_floating_window;
isa_ok($window, 'X11::XCB::Window');
$window->map;
wait_for_map $window;
my ($absolute, $top) = $window->rect;
ok($window->mapped, 'Window is mapped');
@ -30,20 +18,10 @@ ok($absolute->{x} != 0 && $absolute->{y} != 0, 'i3 did not map it to (0x0)');
$window->unmap;
$window = $x->root->create_child(
class => WINDOW_CLASS_INPUT_OUTPUT,
rect => [ 1, 1, 80, 90],
background_color => '#C0C0C0',
window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY'),
event_mask => [ 'structure_notify' ],
);
$window = open_floating_window(rect => [ 1, 1, 80, 90 ]);
isa_ok($window, 'X11::XCB::Window');
$window->map;
wait_for_map $window;
($absolute, $top) = $window->rect;
cmp_ok($absolute->{width}, '==', 80, "i3 let the width at 80");
@ -61,20 +39,10 @@ $window->unmap;
# at least the size of its initial geometry
#####################################################################
$window = $x->root->create_child(
class => WINDOW_CLASS_INPUT_OUTPUT,
rect => [ 1, 1, 80, 90],
background_color => '#C0C0C0',
#window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY'),
event_mask => [ 'structure_notify' ],
);
$window = open_window(rect => [ 1, 1, 80, 90 ]);
isa_ok($window, 'X11::XCB::Window');
$window->map;
wait_for_map $window;
cmd 'floating enable';
sync_with_i3;