2 # vim:ts=4:sw=4:expandtab
4 # Please read the following documents before working on tests:
5 # • http://build.i3wm.org/docs/testsuite.html
8 # • http://build.i3wm.org/docs/lib-i3test.html
9 # (alternatively: perldoc ./testcases/lib/i3test.pm)
11 # • http://build.i3wm.org/docs/ipc.html
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 # (unless you are already familiar with Perl)
17 # Tests if WM_STATE is WM_STATE_NORMAL when mapped and WM_STATE_WITHDRAWN when
23 my $tmp = fresh_workspace;
25 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
27 my $first = open_window;
28 my $second = open_window;
30 is($x->input_focus, $second->id, 'second window focused');
31 ok(@{get_ws_content($tmp)} == 2, 'two containers opened');
36 ##############################################################
37 # 1: open two windows (in the same client), kill one and see if
38 # the other one is still there
39 ##############################################################
41 my $tmp = two_windows;
46 ok(@{get_ws_content($tmp)} == 1, 'one container left after killing');
48 ##############################################################
49 # 2: same test case as test 1, but with the explicit variant
51 ##############################################################
58 ok(@{get_ws_content($tmp)} == 1, 'one container left after killing');
60 ##############################################################
61 # 3: open two windows (in the same client), use 'kill client'
62 # and check if both are gone
63 ##############################################################
68 # We need to re-establish the X11 connection which we just killed :).
69 $x = i3test::X11->new;
70 sync_with_i3(no_cache => 1);
72 ok(@{get_ws_content($tmp)} == 0, 'no containers left after killing');