]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/150-regress-dock-restart.t
Merge branch 'release-4.16.1'
[i3/i3] / testcases / t / 150-regress-dock-restart.t
index e294e6bd3de9fe70dc312f72bf19011577adfcc4..0fb15a565483c519361cf32b8cd34b555caee46c 100644 (file)
@@ -1,17 +1,23 @@
 #!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)
+#
 # Regression test for inplace restarting with dock clients
 #
-use X11::XCB qw(:all);
 use i3test;
 
-BEGIN {
-    use_ok('X11::XCB::Window');
-}
-
-my $x = X11::XCB::Connection->new;
-
 my $tmp = fresh_workspace;
 
 #####################################################################
@@ -25,7 +31,7 @@ is(@docked, 0, 'no dock clients yet');
 
 # open a dock client
 
-my $window = open_window($x, {
+my $window = open_window({
         background_color => '#FF0000',
         window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'),
     });
@@ -45,8 +51,6 @@ is($docknode->{rect}->{height}, 30, 'dock node has unchanged height');
 # perform an inplace-restart
 cmd 'restart';
 
-sleep 0.25;
-
 does_i3_live;
 
 
@@ -62,7 +66,7 @@ is($docknode->{rect}->{height}, 30, 'dock node has unchanged height after restar
 
 $window->destroy;
 
-wait_for_unmap $x;
+wait_for_unmap $window;
 
 @docked = get_dock_clients;
 is(@docked, 0, 'no dock clients found');
@@ -71,7 +75,7 @@ is(@docked, 0, 'no dock clients found');
 # create a dock client with a 1px border
 #####################################################################
 
-$window = open_window($x, {
+$window = open_window({
         border => 1,
         rect => [ 0, 0, 30, 20 ],
         background_color => '#00FF00',
@@ -85,7 +89,6 @@ $docknode = $docked[0];
 is($docknode->{rect}->{height}, 20, 'dock node has unchanged height');
 
 cmd 'restart';
-sleep 0.25;
 
 @docked = get_dock_clients;
 is(@docked, 1, 'one dock client found');