2 # vim:ts=4:sw=4:expandtab
4 # Please read the following documents before working on tests:
5 # • http://build.i3wm.org/docs/testsuite.html
8 # • http://build.i3wm.org/docs/lib-i3test.html
9 # (alternatively: perldoc ./testcases/lib/i3test.pm)
11 # • http://build.i3wm.org/docs/ipc.html
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 # (unless you are already familiar with Perl)
17 # Test that the window::floating event works correctly. This event should be
18 # emitted when a window transitions to or from the floating state.
19 # Bug still in: 4.8-7-gf4a8253
22 my $i3 = i3(get_socket_path());
25 my $cv = AnyEvent->condvar;
30 $cv->send($event) if $event->{change} eq 'floating';
42 my $win = open_window();
44 cmd '[id="' . $win->{id} . '"] floating enable';
47 isnt($e, 0, 'floating a container should send an ipc window event');
48 is($e->{container}->{window}, $win->{id}, 'the event should contain information about the window');
49 is($e->{container}->{floating}, 'user_on', 'the container should be floating');
51 $cv = AnyEvent->condvar;
52 cmd '[id="' . $win->{id} . '"] floating disable';
55 isnt($e, 0, 'disabling floating on a container should send an ipc window event');
56 is($e->{container}->{window}, $win->{id}, 'the event should contain information about the window');
57 is($e->{container}->{floating}, 'user_off', 'the container should not be floating');