]> git.sur5r.net Git - i3/i3/blob - testcases/t/31-stacking-order.t
Merge i3bar into next
[i3/i3] / testcases / t / 31-stacking-order.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Check if stacking containers can be used independantly of
5 # the split mode (horizontal/vertical) of the underlying
6 # container.
7 #
8 use i3test;
9
10 my $i3 = i3(get_socket_path());
11
12 my $tmp = fresh_workspace;
13
14 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
15
16 # Enforce vertical split mode
17 cmd 'split v';
18
19 my $first = open_empty_con($i3);
20 my $second = open_empty_con($i3);
21
22 isnt($first, $second, 'two different containers opened');
23
24 ##############################################################
25 # change mode to stacking and cycle through the containers
26 ##############################################################
27
28 cmd 'layout stacking';
29 is(get_focused($tmp), $second, 'second container still focused');
30
31 cmd 'focus down';
32 is(get_focused($tmp), $first, 'first container focused');
33
34 cmd 'focus up';
35 is(get_focused($tmp), $second, 'second container focused again');
36
37 ##############################################################
38 # now change the orientation to horizontal and cycle
39 ##############################################################
40
41 cmd 'focus parent';
42 cmd 'split h';
43 cmd 'focus child';
44
45 cmd 'focus down';
46 is(get_focused($tmp), $first, 'first container focused');
47
48 cmd 'focus up';
49 is(get_focused($tmp), $second, 'second container focused again');
50
51
52 done_testing;