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::urgent event works correctly. The window::urgent event
18 # should be emitted when a window becomes urgent or loses its urgent status.
24 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
26 force_display_urgency_hint 0ms
29 my $i3 = i3(get_socket_path());
36 $cv->send($event) if $event->{change} eq 'urgent';
48 $cv = AnyEvent->condvar;
50 my $win = open_window;
51 my $dummy_win = open_window;
53 $win->add_hint('urgency');
54 my $event = $cv->recv;
56 isnt($event, 0, 'an urgent con should emit the window::urgent event');
57 is($event->{container}->{window}, $win->{id}, 'the event should contain information about the window');
58 is($event->{container}->{urgent}, 1, 'the container should be urgent');
60 $cv = AnyEvent->condvar;
61 $win->delete_hint('urgency');
62 my $event = $cv->recv;
64 isnt($event, 0, 'an urgent con should emit the window::urgent event');
65 is($event->{container}->{window}, $win->{id}, 'the event should contain information about the window');
66 is($event->{container}->{urgent}, 0, 'the container should not be urgent');