]> git.sur5r.net Git - i3/i3/blob - testcases/t/264-dock-criteria.t
Kill windows between tests
[i3/i3] / testcases / t / 264-dock-criteria.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 # Verifies that command or config criteria does not match dock clients
18 # Bug still in: 4.12-38-ge690e3d
19 use i3test i3_autostart => 0;
20
21 my $config = <<EOT;
22 # i3 config file (v4)
23 for_window [class="dock"] move workspace current
24 EOT
25
26 my $pid = launch_with_config($config);
27
28 my $ws = fresh_workspace();
29
30
31 ## command criteria should not match dock windows
32 open_window({
33     window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'),
34     wm_class => "x"
35 });
36
37 is(get_dock_clients, 1, "created one docked client");
38 is_num_children($ws, 0, 'no container on the current workspace');
39
40 cmd '[class="^x$"] move workspace current';
41
42 does_i3_live
43 is(get_dock_clients, 1, "one docked client after move");
44 is_num_children($ws, 0, 'no container on the current workspace');
45
46 cmd '[class="^x$"] fullscreen';
47
48 does_i3_live
49 is(get_dock_clients, 1, "one docked client after fullscreen");
50 is_num_children($ws, 0, 'no container on the current workspace');
51
52 cmd '[class="^x$"] kill';
53
54 does_i3_live
55 is(get_dock_clients, 1, "one docked client after kill");
56 is_num_children($ws, 0, 'no container on the current workspace');
57
58
59 ## config criteria should not match dock windows
60 open_window({
61     window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'),
62     wm_class => "dock"
63 });
64
65 does_i3_live
66 is(get_dock_clients, 2, "created second docked client");
67 is_num_children($ws, 0, 'no container on the current workspace');
68
69
70 exit_gracefully($pid);
71 done_testing;