]> git.sur5r.net Git - i3/i3/commitdiff
add testcase for previous bugfix (floating window size)
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 11 Aug 2012 22:36:44 +0000 (00:36 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 11 Aug 2012 22:36:44 +0000 (00:36 +0200)
testcases/t/194-regress-floating-size.t [new file with mode: 0644]

diff --git a/testcases/t/194-regress-floating-size.t b/testcases/t/194-regress-floating-size.t
new file mode 100644 (file)
index 0000000..ccbfaae
--- /dev/null
@@ -0,0 +1,43 @@
+#!perl
+# vim:ts=4:sw=4:expandtab
+# Verifies that the size requested by floating windows is set by i3, no matter
+# to which value the new_window option is set.
+# ticket #770, bug still present in commit ae88accf6fe3817ff42d0d51be1965071194766e
+use i3test i3_autostart => 0;
+
+sub test_with_new_window_value {
+    my ($value) = @_;
+
+    my $config = <<EOT;
+# i3 config file (v4)
+font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
+EOT
+
+    if (defined($value)) {
+        $config .= "new_window $value\n";
+        diag("testing with new_window $value");
+    } else {
+        diag("testing without new_window");
+    }
+
+    my $pid = launch_with_config($config);
+
+    my $tmp = fresh_workspace;
+
+    my $window = open_floating_window({ rect => [ 0, 0, 400, 150 ] });
+
+    my ($absolute, $top) = $window->rect;
+
+    ok($window->mapped, 'Window is mapped');
+    cmp_ok($absolute->{width}, '==', 400, 'requested width kept');
+    cmp_ok($absolute->{height}, '==', 150, 'requested height kept');
+
+    exit_gracefully($pid);
+}
+
+test_with_new_window_value(undef);
+test_with_new_window_value('1pixel');
+test_with_new_window_value('normal');
+test_with_new_window_value('none');
+
+done_testing;