]> git.sur5r.net Git - i3/i3/commitdiff
add testcase for crash on closing floating windows whose parent was killed
authorMichael Stapelberg <michael@stapelberg.de>
Tue, 1 Jun 2010 18:52:59 +0000 (20:52 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 1 Jun 2010 18:52:59 +0000 (20:52 +0200)
testcases/t/27-regress-floating-parent.t [new file with mode: 0644]

diff --git a/testcases/t/27-regress-floating-parent.t b/testcases/t/27-regress-floating-parent.t
new file mode 100644 (file)
index 0000000..827f920
--- /dev/null
@@ -0,0 +1,40 @@
+#!perl
+# vim:ts=4:sw=4:expandtab
+#
+# Regression: make a container floating, kill its parent, make it tiling again
+#
+use i3test tests => 3;
+use X11::XCB qw(:all);
+use v5.10;
+
+my $i3 = i3("/tmp/nestedcons");
+
+my $tmp = get_unused_workspace();
+$i3->command("workspace $tmp")->recv;
+
+$i3->command('open')->recv;
+$i3->command('open')->recv;
+my $old = get_focused($tmp);
+$i3->command('split v')->recv;
+$i3->command('open')->recv;
+my $floating = get_focused($tmp);
+diag("focused floating: " . get_focused($tmp));
+$i3->command('mode toggle')->recv;
+# TODO: eliminate this race conditition
+sleep 1;
+$i3->command(qq|[con_id="$old"] focus|)->recv;
+is(get_focused($tmp), $old, 'old container focused');
+
+$i3->command('kill')->recv;
+$i3->command('kill')->recv;
+$i3->command(qq|[con_id="$floating"] focus|)->recv;
+is(get_focused($tmp), $floating, 'floating window focused');
+
+sleep 1;
+$i3->command('mode toggle')->recv;
+
+my $tree = $i3->get_workspaces->recv;
+my @nodes = @{$tree->{nodes}};
+ok(@nodes > 0, 'i3 still lives');
+
+diag( "Testing i3, Perl $], $^X" );