]> git.sur5r.net Git - i3/i3/blob - testcases/t/163-wm-state.t
Merge branch 'next'
[i3/i3] / testcases / t / 163-wm-state.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Please read the following documents before working on tests:
5 # • http://build.i3wm.org/docs/testsuite.html
6 #   (or docs/testsuite)
7 #
8 # • http://build.i3wm.org/docs/lib-i3test.html
9 #   (alternatively: perldoc ./testcases/lib/i3test.pm)
10 #
11 # • http://build.i3wm.org/docs/ipc.html
12 #   (or docs/ipc)
13 #
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 #   (unless you are already familiar with Perl)
16 #
17 # Tests if WM_STATE is WM_STATE_NORMAL when mapped and WM_STATE_WITHDRAWN when
18 # unmapped.
19 #
20 use i3test;
21 use X11::XCB qw(ICCCM_WM_STATE_NORMAL ICCCM_WM_STATE_WITHDRAWN);
22
23 my $window = open_window;
24
25 is($window->state, ICCCM_WM_STATE_NORMAL, 'WM_STATE normal');
26
27 $window->unmap;
28
29 wait_for_unmap $window;
30
31 is($window->state, ICCCM_WM_STATE_WITHDRAWN, 'WM_STATE withdrawn');
32
33 done_testing;