aboutsummaryrefslogtreecommitdiff
path: root/testcases/t/225-ipc-window-fullscreen.t
blob: bc150546906e94e625e0c3a6fb8d920aa2480399 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!perl
# vim:ts=4:sw=4:expandtab
#
# Please read the following documents before working on tests:
# • https://build.i3wm.org/docs/testsuite.html
#   (or docs/testsuite)
#
# • https://build.i3wm.org/docs/lib-i3test.html
#   (alternatively: perldoc ./testcases/lib/i3test.pm)
#
# • https://build.i3wm.org/docs/ipc.html
#   (or docs/ipc)
#
# • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
#   (unless you are already familiar with Perl)
#
# Tests that the ipc window::fullscreen_mode event works properly
#
# Bug still in: 4.7.2-135-g7deb23c
use i3test;

open_window;

sub fullscreen_subtest {
    my ($want) = @_;
    my @events = events_for(
	sub { cmd 'fullscreen' },
	'window');

    is(scalar @events, 1, 'Received 1 event');
    is($events[0]->{container}->{fullscreen_mode}, $want, "fullscreen_mode now $want");
}

subtest 'fullscreen on', \&fullscreen_subtest, 1;
subtest 'fullscreen off', \&fullscreen_subtest, 0;

done_testing;