Move is_num_fullscreen to Test.pm
This commit is contained in:
@ -21,15 +21,6 @@ use i3test;
|
||||
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
sub fullscreen_windows {
|
||||
my $ws = $tmp;
|
||||
$ws = shift if @_;
|
||||
|
||||
my $nodes = scalar grep { $_->{fullscreen_mode} != 0 } @{get_ws_content($ws)->[0]->{nodes}};
|
||||
my $cons = scalar grep { $_->{fullscreen_mode} != 0 } @{get_ws_content($ws)};
|
||||
return $nodes + $cons;
|
||||
}
|
||||
|
||||
##########################################################################################
|
||||
# map two windows in one container, fullscreen one of them and then move it to scratchpad
|
||||
##########################################################################################
|
||||
@ -41,7 +32,7 @@ my $second_win = open_window;
|
||||
cmd 'fullscreen';
|
||||
|
||||
# see if the window really is in fullscreen mode
|
||||
is(fullscreen_windows(), 1, 'amount of fullscreen windows after enabling fullscreen');
|
||||
is_num_fullscreen($tmp, 1, 'amount of fullscreen windows after enabling fullscreen');
|
||||
|
||||
# move window to scratchpad
|
||||
cmd 'move scratchpad';
|
||||
@ -57,7 +48,7 @@ cmd 'scratchpad show';
|
||||
cmd 'floating toggle';
|
||||
|
||||
# see if no window is in fullscreen mode
|
||||
is(fullscreen_windows(), 0, 'amount of fullscreen windows after showing previously fullscreened scratchpad window');
|
||||
is_num_fullscreen($tmp, 0, 'amount of fullscreen windows after showing previously fullscreened scratchpad window');
|
||||
|
||||
########################################################################################
|
||||
# move a window to scratchpad, focus parent container, make it fullscreen, focus a child
|
||||
@ -79,7 +70,7 @@ cmd 'fullscreen';
|
||||
cmd 'focus child';
|
||||
|
||||
# see if the window really is in fullscreen mode
|
||||
is(fullscreen_windows(), 1, 'amount of fullscreen windows after enabling fullscreen on parent');
|
||||
is_num_fullscreen($tmp, 1, 'amount of fullscreen windows after enabling fullscreen on parent');
|
||||
|
||||
##########################################################################
|
||||
# show a scratchpad window; no window should be in fullscreen mode anymore
|
||||
@ -89,6 +80,6 @@ is(fullscreen_windows(), 1, 'amount of fullscreen windows after enabling fullscr
|
||||
cmd 'scratchpad show';
|
||||
|
||||
# see if no window is in fullscreen mode
|
||||
is(fullscreen_windows(), 0, 'amount of fullscreen windows after showing a scratchpad window while a parent container was in fullscreen mode');
|
||||
is_num_fullscreen($tmp, 0, 'amount of fullscreen windows after showing a scratchpad window while a parent container was in fullscreen mode');
|
||||
|
||||
done_testing;
|
||||
|
Reference in New Issue
Block a user