]> git.sur5r.net Git - i3/i3/blob - testcases/t/27-regress-floating-parent.t
Test 16 fixed expectation of the (root) focused field to exist in the tree and always...
[i3/i3] / testcases / t / 27-regress-floating-parent.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Regression: make a container floating, kill its parent, make it tiling again
5 #
6 use i3test tests => 3;
7 use X11::XCB qw(:all);
8
9 my $i3 = i3("/tmp/nestedcons");
10
11 my $tmp = get_unused_workspace();
12 $i3->command("workspace $tmp")->recv;
13
14 $i3->command('open')->recv;
15 $i3->command('open')->recv;
16 my $old = get_focused($tmp);
17 $i3->command('split v')->recv;
18 $i3->command('open')->recv;
19 my $floating = get_focused($tmp);
20 diag("focused floating: " . get_focused($tmp));
21 $i3->command('mode toggle')->recv;
22 # TODO: eliminate this race conditition
23 sleep 1;
24 $i3->command(qq|[con_id="$old"] focus|)->recv;
25 is(get_focused($tmp), $old, 'old container focused');
26
27 $i3->command('kill')->recv;
28 $i3->command('kill')->recv;
29 $i3->command(qq|[con_id="$floating"] focus|)->recv;
30 is(get_focused($tmp), $floating, 'floating window focused');
31
32 sleep 1;
33 $i3->command('mode toggle')->recv;
34
35 my $tree = $i3->get_workspaces->recv;
36 my @nodes = @{$tree->{nodes}};
37 ok(@nodes > 0, 'i3 still lives');
38
39 diag( "Testing i3, Perl $], $^X" );