]> git.sur5r.net Git - i3/i3/blob - testcases/t/74-border-config.t
Merge branch 'master' into next
[i3/i3] / testcases / t / 74-border-config.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 # !NO_I3_INSTANCE! will prevent complete-run.pl from starting i3
4 #
5 # Tests the new_window and new_float config option.
6 #
7
8 use i3test;
9
10 my $x = X11::XCB::Connection->new;
11
12 #####################################################################
13 # 1: check that new windows start with 'normal' border unless configured
14 # otherwise
15 #####################################################################
16
17 my $config = <<EOT;
18 # i3 config file (v4)
19 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
20 EOT
21
22 my $process = launch_with_config($config);
23
24 my $tmp = fresh_workspace;
25
26 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
27
28 my $first = open_window($x);
29
30 my @content = @{get_ws_content($tmp)};
31 ok(@content == 1, 'one container opened');
32 is($content[0]->{border}, 'normal', 'border normal by default');
33
34 exit_gracefully($process->pid);
35
36 #####################################################################
37 # 2: check that new tiling windows start with '1pixel' border when
38 # configured
39 #####################################################################
40
41 $config = <<EOT;
42 # i3 config file (v4)
43 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
44
45 new_window 1pixel
46 EOT
47
48 $process = launch_with_config($config);
49
50 $tmp = fresh_workspace;
51
52 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
53
54 $first = open_window($x);
55
56 @content = @{get_ws_content($tmp)};
57 ok(@content == 1, 'one container opened');
58 is($content[0]->{border}, '1pixel', 'border normal by default');
59
60 exit_gracefully($process->pid);
61
62 #####################################################################
63 # 3: check that new floating windows start with 'normal' border unless
64 # configured otherwise
65 #####################################################################
66
67 $config = <<EOT;
68 # i3 config file (v4)
69 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
70 EOT
71
72 $process = launch_with_config($config);
73
74 $tmp = fresh_workspace;
75
76 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
77
78 $first = open_floating_window($x);
79
80 my $wscontent = get_ws($tmp);
81 my @floating = @{$wscontent->{floating_nodes}};
82 ok(@floating == 1, 'one floating container opened');
83 my $floatingcon = $floating[0];
84 is($floatingcon->{nodes}->[0]->{border}, 'normal', 'border normal by default');
85
86 exit_gracefully($process->pid);
87
88 #####################################################################
89 # 4: check that new floating windows start with '1pixel' border when
90 # configured
91 #####################################################################
92
93 $config = <<EOT;
94 # i3 config file (v4)
95 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
96
97 new_float 1pixel
98 EOT
99
100 $process = launch_with_config($config);
101
102 $tmp = fresh_workspace;
103
104 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
105
106 $first = open_floating_window($x);
107
108 $wscontent = get_ws($tmp);
109 @floating = @{$wscontent->{floating_nodes}};
110 ok(@floating == 1, 'one floating container opened');
111 $floatingcon = $floating[0];
112 is($floatingcon->{nodes}->[0]->{border}, '1pixel', 'border normal by default');
113
114 exit_gracefully($process->pid);
115
116 done_testing;