]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/09-stacking.t
tests: Bugfix: 11-goto.t: use mktemp for generating a random mark, not base64
[i3/i3] / testcases / t / 09-stacking.t
index 083961fb22c5e93a26a651e9f1a03982c9966939..cc285f32788162d946c1dac5a47d2830d725d8ea 100644 (file)
@@ -4,39 +4,31 @@
 # the workspace to be empty).
 # TODO: skip it by default?
 
-use Test::More tests => 24;
-use Test::Deep;
+use i3test tests => 22;
 use X11::XCB qw(:all);
-use Data::Dumper;
 use Time::HiRes qw(sleep);
-use FindBin;
-use lib "$FindBin::Bin/lib";
-use i3test;
 
 BEGIN {
-    use_ok('IO::Socket::UNIX') or BAIL_OUT('Cannot load IO::Socket::UNIX');
     use_ok('X11::XCB::Connection') or BAIL_OUT('Cannot load X11::XCB::Connection');
 }
 
-X11::XCB::Connection->connect(':0');
+SKIP: {
+    skip "stacking test not yet updated", 21;
 
-my $sock = IO::Socket::UNIX->new(Peer => '/tmp/i3-ipc.sock');
-isa_ok($sock, 'IO::Socket::UNIX');
+my $x = X11::XCB::Connection->new;
 
-# Switch to the nineth workspace
-$sock->write(i3test::format_ipc_command("9"));
+my $i3 = i3;
 
-sleep(0.25);
+# Switch to the nineth workspace
+$i3->command('9')->recv;
 
 #####################################################################
 # Create two windows and make sure focus switching works
 #####################################################################
 
-my $top = i3test::open_standard_window;
-sleep(0.25);
-my $mid = i3test::open_standard_window;
-sleep(0.25);
-my $bottom = i3test::open_standard_window;
+my $top = i3test::open_standard_window($x);
+my $mid = i3test::open_standard_window($x);
+my $bottom = i3test::open_standard_window($x);
 sleep(0.25);
 
 diag("top id = " . $top->id);
@@ -50,12 +42,11 @@ diag("bottom id = " . $bottom->id);
 sub focus_after {
     my $msg = shift;
 
-    $sock->write(i3test::format_ipc_command($msg));
-    sleep(0.25);
-    return X11::XCB::Connection->input_focus;
+    $i3->command($msg)->recv;
+    return $x->input_focus;
 }
 
-$focus = X11::XCB::Connection->input_focus;
+$focus = $x->input_focus;
 is($focus, $bottom->id, "Latest window focused");
 
 $focus = focus_after("s");
@@ -87,7 +78,7 @@ is($focus, $top->id, "Top window still focused (focus after moving)");
 $focus = focus_after("h");
 is($focus, $bottom->id, "Bottom window focused (focus after moving)");
 
-my $new = i3test::open_standard_window;
+my $new = i3test::open_standard_window($x);
 sleep(0.25);
 
 # By now, we have this layout:
@@ -136,3 +127,4 @@ is($focus, $bottom->id, "Window above is bottom");
 $focus = focus_after("k");
 is($focus, $mid->id, "Window above is mid");
 
+}