]> git.sur5r.net Git - i3/i3/blob - testcases/t/41-resize.t
Merge branch 'tree' into next
[i3/i3] / testcases / t / 41-resize.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 # Tests resizing tiling containers
4 use i3test;
5 use X11::XCB qw(:all);
6
7 BEGIN {
8     use_ok('X11::XCB::Window');
9 }
10
11 my $x = X11::XCB::Connection->new;
12
13 my $tmp = fresh_workspace;
14
15 cmd 'split v';
16
17 my $top = open_standard_window($x);
18 sleep 0.25;
19 my $bottom = open_standard_window($x);
20 sleep 0.25;
21
22 diag("top = " . $top->id . ", bottom = " . $bottom->id);
23
24 is($x->input_focus, $bottom->id, 'Bottom window focused');
25
26 ############################################################
27 # resize
28 ############################################################
29
30 cmd 'resize grow up 10 px or 25 ppt';
31
32 my ($nodes, $focus) = get_ws_content($tmp);
33
34 is($nodes->[0]->{percent}, 0.25, 'top window got only 25%');
35 is($nodes->[1]->{percent}, 0.75, 'bottom window got 75%');
36
37
38 ############################################################
39 # split and check if the 'percent' factor is still correct
40 ############################################################
41
42 cmd 'split h';
43
44 ($nodes, $focus) = get_ws_content($tmp);
45
46 is($nodes->[0]->{percent}, 0.25, 'top window got only 25%');
47 is($nodes->[1]->{percent}, 0.75, 'bottom window got 75%');
48
49 done_testing;