]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/529-net-wm-desktop.t
tests: use i3_config arg instead of precisely one launch_with_config
[i3/i3] / testcases / t / 529-net-wm-desktop.t
index 42b488d952efc886b89c9cfb20741846d66848bb..63c0b6a6d14f022c8bc4545e7384d5b68da02dc7 100644 (file)
 #
 # Tests for _NET_WM_DESKTOP.
 # Ticket: #2153
-use i3test i3_autostart => 0;
+use i3test i3_config => <<EOT;
+# i3 config file (v4)
+font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
+
+bar {
+    status_command i3status
+}
+EOT
 use X11::XCB qw(:all);
 
 ###############################################################################
@@ -78,26 +85,6 @@ sub open_window_with_net_wm_desktop {
     return $window;
 }
 
-# We need to kill all windows in between tests since they survive the i3 restart
-# and will interfere with the following tests.
-sub kill_windows {
-    sync_with_i3;
-    cmd '[title="Window.*"] kill';
-}
-
-###############################################################################
-
-my $config = <<EOT;
-# i3 config file (v4)
-font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
-
-bar {
-    status_command i3status
-}
-EOT
-
-my $pid = launch_with_config($config);
-
 ###############################################################################
 # Upon managing a window which does not set _NET_WM_DESKTOP, the property is
 # set on the window.
@@ -108,7 +95,7 @@ my $con = open_window;
 
 is(get_net_wm_desktop($con), 0, '_NET_WM_DESKTOP is set upon managing a window');
 
-kill_windows;
+kill_all_windows;
 
 ###############################################################################
 # Upon managing a window which sets _NET_WM_DESKTOP, the window is moved to
@@ -127,7 +114,7 @@ $con = open_window_with_net_wm_desktop(1);
 is(get_net_wm_desktop($con), 1, '_NET_WM_DESKTOP still has the correct value');
 is_num_children('1', 2, 'The window was moved to workspace 1');
 
-kill_windows;
+kill_all_windows;
 
 ###############################################################################
 # Upon managing a window which sets _NET_WM_DESKTOP to the appropriate value,
@@ -141,7 +128,7 @@ is(get_net_wm_desktop($con), 0xFFFFFFFF, '_NET_WM_DESKTOP still has the correct
 is(@{get_ws('0')->{floating_nodes}}, 1, 'The window is floating');
 ok(get_ws('0')->{floating_nodes}->[0]->{nodes}->[0]->{sticky}, 'The window is sticky');
 
-kill_windows;
+kill_all_windows;
 
 ###############################################################################
 # _NET_WM_DESKTOP is updated when the window is moved to another workspace
@@ -159,7 +146,7 @@ cmd 'move window to workspace 1';
 
 is(get_net_wm_desktop($con), 1, '_NET_WM_DESKTOP is updated when moving the window');
 
-kill_windows;
+kill_all_windows;
 
 ###############################################################################
 # _NET_WM_DESKTOP is updated when the floating window is moved to another
@@ -178,7 +165,7 @@ cmd 'move window to workspace 1';
 
 is(get_net_wm_desktop($con), 1, '_NET_WM_DESKTOP is updated when moving the window');
 
-kill_windows;
+kill_all_windows;
 
 ###############################################################################
 # _NET_WM_DESKTOP is removed when the window is withdrawn.
@@ -192,7 +179,7 @@ wait_for_unmap($con);
 
 is(get_net_wm_desktop($con), undef, '_NET_WM_DESKTOP is removed');
 
-kill_windows;
+kill_all_windows;
 
 ###############################################################################
 # A _NET_WM_DESKTOP client message sent to the root window moves a window
@@ -214,7 +201,7 @@ is_num_children('0', 1, 'The window is no longer on workspace 0');
 is_num_children('1', 2, 'The window is now on workspace 1');
 is(get_net_wm_desktop($con), 1, '_NET_WM_DESKTOP is updated');
 
-kill_windows;
+kill_all_windows;
 
 ###############################################################################
 # A _NET_WM_DESKTOP client message sent to the root window can make a window
@@ -230,7 +217,7 @@ is(get_net_wm_desktop($con), 0xFFFFFFFF, '_NET_WM_DESKTOP is updated');
 is(@{get_ws('0')->{floating_nodes}}, 1, 'The window is floating');
 ok(get_ws('0')->{floating_nodes}->[0]->{nodes}->[0]->{sticky}, 'The window is sticky');
 
-kill_windows;
+kill_all_windows;
 
 ###############################################################################
 # _NET_WM_DESKTOP is updated when a new workspace with a lower number is
@@ -244,7 +231,7 @@ is(get_net_wm_desktop($con), 0, '_NET_WM_DESKTOP is set sanity check)');
 cmd 'workspace 0';
 is(get_net_wm_desktop($con), 1, '_NET_WM_DESKTOP is updated');
 
-kill_windows;
+kill_all_windows;
 
 ###############################################################################
 # _NET_WM_DESKTOP is updated when a window is made sticky by command.
@@ -258,7 +245,7 @@ is(get_net_wm_desktop($con), 0, '_NET_WM_DESKTOP is set sanity check)');
 cmd 'sticky enable';
 is(get_net_wm_desktop($con), 0xFFFFFFFF, '_NET_WM_DESKTOP is updated');
 
-kill_windows;
+kill_all_windows;
 
 ###############################################################################
 # _NET_WM_DESKTOP is updated when a window is made sticky by client message.
@@ -282,7 +269,7 @@ sync_with_i3;
 
 is(get_net_wm_desktop($con), 0xFFFFFFFF, '_NET_WM_DESKTOP is updated');
 
-kill_windows;
+kill_all_windows;
 
 ###############################################################################
 # _NET_WM_DESKTOP is updated when a window is moved to the scratchpad.
@@ -299,10 +286,8 @@ is(get_net_wm_desktop($con), 0xFFFFFFFF, '_NET_WM_DESKTOP is updated');
 cmd 'scratchpad show';
 is(get_net_wm_desktop($con), 0, '_NET_WM_DESKTOP is set sanity check)');
 
-kill_windows;
+kill_all_windows;
 
 ###############################################################################
 
-exit_gracefully($pid);
-
 done_testing;