i3/testcases/t/63-wm-state.t
Michael Stapelberg 38a9eabff1 tests: implement sync_with_i3 and use it instead of sleep()
Also use open_standard_window() in a few more places where appropriate
2011-09-24 11:15:08 +01:00

35 lines
665 B
Perl

#!perl
# vim:ts=4:sw=4:expandtab
#
# Tests if WM_STATE is WM_STATE_NORMAL when mapped and WM_STATE_WITHDRAWN when
# unmapped.
#
use X11::XCB qw(:all);
use i3test;
BEGIN {
use_ok('X11::XCB::Window');
use_ok('X11::XCB::Event::Generic');
use_ok('X11::XCB::Event::MapNotify');
use_ok('X11::XCB::Event::ClientMessage');
}
my $x = X11::XCB::Connection->new;
my $window = open_standard_window($x);
sync_with_i3($x);
diag('window mapped');
is($window->state, ICCCM_WM_STATE_NORMAL, 'WM_STATE normal');
$window->unmap;
# TODO: wait for unmapnotify
sync_with_i3($x);
is($window->state, ICCCM_WM_STATE_WITHDRAWN, 'WM_STATE withdrawn');
done_testing;