]> git.sur5r.net Git - i3/i3/blob - testcases/t/225-ipc-window-fullscreen.t
Update ewmh focused only when new focus is different (#3496)
[i3/i3] / testcases / t / 225-ipc-window-fullscreen.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Please read the following documents before working on tests:
5 # • https://build.i3wm.org/docs/testsuite.html
6 #   (or docs/testsuite)
7 #
8 # • https://build.i3wm.org/docs/lib-i3test.html
9 #   (alternatively: perldoc ./testcases/lib/i3test.pm)
10 #
11 # • https://build.i3wm.org/docs/ipc.html
12 #   (or docs/ipc)
13 #
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 #   (unless you are already familiar with Perl)
16 #
17 # Tests that the ipc window::fullscreen_mode event works properly
18 #
19 # Bug still in: 4.7.2-135-g7deb23c
20 use i3test;
21
22 open_window;
23
24 sub fullscreen_subtest {
25     my ($want) = @_;
26     my @events = events_for(
27         sub { cmd 'fullscreen' },
28         'window');
29
30     is(scalar @events, 1, 'Received 1 event');
31     is($events[0]->{container}->{fullscreen_mode}, $want, "fullscreen_mode now $want");
32 }
33
34 subtest 'fullscreen on', \&fullscreen_subtest, 1;
35 subtest 'fullscreen off', \&fullscreen_subtest, 0;
36
37 done_testing;