]> git.sur5r.net Git - i3/i3/blob - testcases/t/150-regress-dock-restart.t
Merge branch 'master' into next
[i3/i3] / testcases / t / 150-regress-dock-restart.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Regression test for inplace restarting with dock clients
5 #
6 use i3test;
7
8 my $tmp = fresh_workspace;
9
10 #####################################################################
11 # verify that there is no dock window yet
12 #####################################################################
13
14 # Children of all dockareas
15 my @docked = get_dock_clients;
16
17 is(@docked, 0, 'no dock clients yet');
18
19 # open a dock client
20
21 my $window = open_window({
22         background_color => '#FF0000',
23         window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'),
24     });
25
26 #####################################################################
27 # check that we can find it in the layout tree at the expected position
28 #####################################################################
29
30 @docked = get_dock_clients;
31 is(@docked, 1, 'one dock client found');
32
33 # verify the height
34 my $docknode = $docked[0];
35
36 is($docknode->{rect}->{height}, 30, 'dock node has unchanged height');
37
38 # perform an inplace-restart
39 cmd 'restart';
40
41 does_i3_live;
42
43
44 #####################################################################
45 # check that we can still find the dock client
46 #####################################################################
47
48 @docked = get_dock_clients;
49 is(@docked, 1, 'one dock client found');
50 $docknode = $docked[0];
51
52 is($docknode->{rect}->{height}, 30, 'dock node has unchanged height after restart');
53
54 $window->destroy;
55
56 wait_for_unmap $window;
57
58 @docked = get_dock_clients;
59 is(@docked, 0, 'no dock clients found');
60
61 #####################################################################
62 # create a dock client with a 1px border
63 #####################################################################
64
65 $window = open_window({
66         border => 1,
67         rect => [ 0, 0, 30, 20 ],
68         background_color => '#00FF00',
69         window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'),
70     });
71
72 @docked = get_dock_clients;
73 is(@docked, 1, 'one dock client found');
74 $docknode = $docked[0];
75
76 is($docknode->{rect}->{height}, 20, 'dock node has unchanged height');
77
78 cmd 'restart';
79
80 @docked = get_dock_clients;
81 is(@docked, 1, 'one dock client found');
82 $docknode = $docked[0];
83
84 is($docknode->{rect}->{height}, 20, 'dock node has unchanged height');
85
86
87 done_testing;