]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/206-fullscreen-scratchpad.t
Move is_num_fullscreen to Test.pm
[i3/i3] / testcases / t / 206-fullscreen-scratchpad.t
index c098f23fbe6e7036a27fe5185216859cf4ea729c..95245099332f991f736f36868a74d591c62f5ac4 100644 (file)
@@ -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;