]> git.sur5r.net Git - i3/i3/blob - testcases/t/150-regress-dock-restart.t
tests: replace http:// with https:// where appropriate
[i3/i3] / testcases / t / 150-regress-dock-restart.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Please read the following documents before working on tests:
5 # • https://build.i3wm.org/docs/testsuite.html
6 #   (or docs/testsuite)
7 #
8 # • https://build.i3wm.org/docs/lib-i3test.html
9 #   (alternatively: perldoc ./testcases/lib/i3test.pm)
10 #
11 # • https://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 # Regression test for inplace restarting with dock clients
18 #
19 use i3test;
20
21 my $tmp = fresh_workspace;
22
23 #####################################################################
24 # verify that there is no dock window yet
25 #####################################################################
26
27 # Children of all dockareas
28 my @docked = get_dock_clients;
29
30 is(@docked, 0, 'no dock clients yet');
31
32 # open a dock client
33
34 my $window = open_window({
35         background_color => '#FF0000',
36         window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'),
37     });
38
39 #####################################################################
40 # check that we can find it in the layout tree at the expected position
41 #####################################################################
42
43 @docked = get_dock_clients;
44 is(@docked, 1, 'one dock client found');
45
46 # verify the height
47 my $docknode = $docked[0];
48
49 is($docknode->{rect}->{height}, 30, 'dock node has unchanged height');
50
51 # perform an inplace-restart
52 cmd 'restart';
53
54 does_i3_live;
55
56
57 #####################################################################
58 # check that we can still find the dock client
59 #####################################################################
60
61 @docked = get_dock_clients;
62 is(@docked, 1, 'one dock client found');
63 $docknode = $docked[0];
64
65 is($docknode->{rect}->{height}, 30, 'dock node has unchanged height after restart');
66
67 $window->destroy;
68
69 wait_for_unmap $window;
70
71 @docked = get_dock_clients;
72 is(@docked, 0, 'no dock clients found');
73
74 #####################################################################
75 # create a dock client with a 1px border
76 #####################################################################
77
78 $window = open_window({
79         border => 1,
80         rect => [ 0, 0, 30, 20 ],
81         background_color => '#00FF00',
82         window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'),
83     });
84
85 @docked = get_dock_clients;
86 is(@docked, 1, 'one dock client found');
87 $docknode = $docked[0];
88
89 is($docknode->{rect}->{height}, 20, 'dock node has unchanged height');
90
91 cmd 'restart';
92
93 @docked = get_dock_clients;
94 is(@docked, 1, 'one dock client found');
95 $docknode = $docked[0];
96
97 is($docknode->{rect}->{height}, 20, 'dock node has unchanged height');
98
99
100 done_testing;