2010-06-01 20:52:59 +02:00
|
|
|
#!perl
|
|
|
|
# vim:ts=4:sw=4:expandtab
|
|
|
|
#
|
2012-09-10 14:09:01 +02:00
|
|
|
# Please read the following documents before working on tests:
|
2017-09-24 10:19:50 +02:00
|
|
|
# • https://build.i3wm.org/docs/testsuite.html
|
2012-09-10 14:09:01 +02:00
|
|
|
# (or docs/testsuite)
|
|
|
|
#
|
2017-09-24 10:19:50 +02:00
|
|
|
# • https://build.i3wm.org/docs/lib-i3test.html
|
2012-09-10 14:09:01 +02:00
|
|
|
# (alternatively: perldoc ./testcases/lib/i3test.pm)
|
|
|
|
#
|
2017-09-24 10:19:50 +02:00
|
|
|
# • https://build.i3wm.org/docs/ipc.html
|
2012-09-10 14:09:01 +02:00
|
|
|
# (or docs/ipc)
|
|
|
|
#
|
|
|
|
# • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
|
|
|
|
# (unless you are already familiar with Perl)
|
|
|
|
#
|
2010-06-01 20:52:59 +02:00
|
|
|
# Regression: make a container floating, kill its parent, make it tiling again
|
|
|
|
#
|
2011-03-09 20:25:17 +01:00
|
|
|
use i3test;
|
2010-06-01 20:52:59 +02:00
|
|
|
|
2011-03-09 20:25:17 +01:00
|
|
|
my $tmp = fresh_workspace;
|
2010-06-01 20:52:59 +02:00
|
|
|
|
2011-03-09 20:25:17 +01:00
|
|
|
cmd 'open';
|
2010-11-28 21:11:14 +01:00
|
|
|
my $left = get_focused($tmp);
|
2011-03-09 20:25:17 +01:00
|
|
|
cmd 'open';
|
2010-06-01 20:52:59 +02:00
|
|
|
my $old = get_focused($tmp);
|
2011-03-09 20:25:17 +01:00
|
|
|
cmd 'split v';
|
|
|
|
cmd 'open';
|
2010-06-01 20:52:59 +02:00
|
|
|
my $floating = get_focused($tmp);
|
|
|
|
diag("focused floating: " . get_focused($tmp));
|
2011-03-09 20:25:17 +01:00
|
|
|
cmd 'mode toggle';
|
2011-11-23 12:57:13 +01:00
|
|
|
sync_with_i3;
|
2010-11-28 21:11:14 +01:00
|
|
|
|
|
|
|
# kill old container
|
2011-03-09 20:25:17 +01:00
|
|
|
cmd qq|[con_id="$old"] focus|;
|
2010-06-01 20:52:59 +02:00
|
|
|
is(get_focused($tmp), $old, 'old container focused');
|
2011-03-09 20:25:17 +01:00
|
|
|
cmd 'kill';
|
2010-11-28 21:11:14 +01:00
|
|
|
|
|
|
|
# kill left container
|
2011-03-09 20:25:17 +01:00
|
|
|
cmd qq|[con_id="$left"] focus|;
|
2010-11-28 21:11:14 +01:00
|
|
|
is(get_focused($tmp), $left, 'old container focused');
|
2011-03-09 20:25:17 +01:00
|
|
|
cmd 'kill';
|
2010-11-28 21:11:14 +01:00
|
|
|
|
|
|
|
# focus floating window, make it tiling again
|
2011-03-09 20:25:17 +01:00
|
|
|
cmd qq|[con_id="$floating"] focus|;
|
2010-06-01 20:52:59 +02:00
|
|
|
is(get_focused($tmp), $floating, 'floating window focused');
|
|
|
|
|
2011-11-23 12:57:13 +01:00
|
|
|
sync_with_i3;
|
2011-03-09 20:25:17 +01:00
|
|
|
cmd 'mode toggle';
|
2010-06-01 20:52:59 +02:00
|
|
|
|
2011-01-28 01:21:38 +01:00
|
|
|
does_i3_live;
|
2010-06-01 20:52:59 +02:00
|
|
|
|
2011-03-09 20:25:17 +01:00
|
|
|
done_testing;
|