]> git.sur5r.net Git - i3/i3/blob - testcases/t/13-urgent.t
make testcases use AnyEvent::I3
[i3/i3] / testcases / t / 13-urgent.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 # Beware that this test uses workspace 9 to perform some tests (it expects
4 # the workspace to be empty).
5 # TODO: skip it by default?
6
7 use Test::More tests => 7;
8 use Test::Deep;
9 use X11::XCB qw(:all);
10 use Data::Dumper;
11 use Time::HiRes qw(sleep);
12 use FindBin;
13 use Digest::SHA1 qw(sha1_base64);
14 use lib "$FindBin::Bin/lib";
15 use i3test;
16 use AnyEvent::I3;
17
18 BEGIN {
19     use_ok('X11::XCB::Connection') or BAIL_OUT('Cannot load X11::XCB::Connection');
20 }
21
22 my $x = X11::XCB::Connection->new;
23
24 my $i3 = i3;
25
26 # Switch to the nineth workspace
27 $i3->command('9')->recv;
28
29 #####################################################################
30 # Create two windows and put them in stacking mode
31 #####################################################################
32
33 my $top = i3test::open_standard_window($x);
34 sleep 0.25;
35 my $bottom = i3test::open_standard_window($x);
36 sleep 0.25;
37
38 $i3->command('s')->recv;
39
40 #####################################################################
41 # Add the urgency hint, switch to a different workspace and back again
42 #####################################################################
43 $top->add_hint('urgency');
44 sleep 1;
45
46 $i3->command('1')->recv;
47 $i3->command('9')->recv;
48 $i3->command('1')->recv;
49
50 my $std = i3test::open_standard_window($x);
51 sleep 0.25;
52 $std->add_hint('urgency');
53 sleep 1;