2 # vim:ts=4:sw=4:expandtab
4 # Please read the following documents before working on tests:
5 # • http://build.i3wm.org/docs/testsuite.html
8 # • http://build.i3wm.org/docs/lib-i3test.html
9 # (alternatively: perldoc ./testcases/lib/i3test.pm)
11 # • http://build.i3wm.org/docs/ipc.html
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 # (unless you are already familiar with Perl)
17 # Tests the new_window and new_float config option.
20 use i3test i3_autostart => 0;
22 #####################################################################
23 # 1: check that new windows start with 'normal' border unless configured
25 #####################################################################
29 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
32 my $pid = launch_with_config($config);
34 my $tmp = fresh_workspace;
36 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
38 my $first = open_window;
40 my @content = @{get_ws_content($tmp)};
41 ok(@content == 1, 'one container opened');
42 is($content[0]->{border}, 'normal', 'border normal by default');
44 exit_gracefully($pid);
46 #####################################################################
47 # 2: check that new tiling windows start with '1pixel' border when
49 #####################################################################
53 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
58 $pid = launch_with_config($config);
60 $tmp = fresh_workspace;
62 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
66 @content = @{get_ws_content($tmp)};
67 ok(@content == 1, 'one container opened');
68 is($content[0]->{border}, 'pixel', 'border pixel by default');
69 is($content[0]->{current_border_width}, 1, 'border width pixels 1 (default)');
71 exit_gracefully($pid);
73 #####################################################################
74 # 3: check that new floating windows start with 'normal' border unless
75 # configured otherwise
76 #####################################################################
80 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
83 $pid = launch_with_config($config);
85 $tmp = fresh_workspace;
87 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
89 $first = open_floating_window;
91 my $wscontent = get_ws($tmp);
92 my @floating = @{$wscontent->{floating_nodes}};
93 ok(@floating == 1, 'one floating container opened');
94 my $floatingcon = $floating[0];
95 is($floatingcon->{nodes}->[0]->{border}, 'normal', 'border normal by default');
97 exit_gracefully($pid);
99 #####################################################################
100 # 4: check that new floating windows start with '1pixel' border when
102 #####################################################################
105 # i3 config file (v4)
106 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
111 $pid = launch_with_config($config);
113 $tmp = fresh_workspace;
115 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
117 $first = open_floating_window;
119 $wscontent = get_ws($tmp);
120 @floating = @{$wscontent->{floating_nodes}};
121 ok(@floating == 1, 'one floating container opened');
122 $floatingcon = $floating[0];
123 is($floatingcon->{nodes}->[0]->{border}, 'pixel', 'border pixel by default');
125 exit_gracefully($pid);