]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/170-force_focus_wrapping.t
Merge pull request #3435 from vivien/i3-msg/subscribe
[i3/i3] / testcases / t / 170-force_focus_wrapping.t
index d2f15a655aa68916e860b5472a1cf23485ee138d..20641b0a84da9a007def3aca8f609a469d357adb 100644 (file)
@@ -1,12 +1,22 @@
 #!perl
 # vim:ts=4:sw=4:expandtab
-# !NO_I3_INSTANCE! will prevent complete-run.pl from starting i3
+#
+# 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 if the 'force_focus_wrapping' config directive works correctly.
 #
-use i3test;
-
-my $x = i3test::X11->new;
+use i3test i3_autostart => 0;
 
 #####################################################################
 # 1: test the wrapping behaviour without force_focus_wrapping
@@ -23,13 +33,13 @@ my $tmp = fresh_workspace;
 
 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
 
-my $first = open_window($x);
-my $second = open_window($x);
+my $first = open_window;
+my $second = open_window;
 
 cmd 'layout tabbed';
 cmd 'focus parent';
 
-my $third = open_window($x);
+my $third = open_window;
 is($x->input_focus, $third->id, 'third window focused');
 
 cmd 'focus left';
@@ -64,15 +74,13 @@ $tmp = fresh_workspace;
 
 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
 
-$first = open_window($x);
-$second = open_window($x);
+$first = open_window;
+$second = open_window;
 
 cmd 'layout tabbed';
 cmd 'focus parent';
 
-$third = open_window($x);
-
-sync_with_i3($x);
+$third = open_window;
 
 is($x->input_focus, $third->id, 'third window focused');