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