]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/12-floating-resize.t
implement configure requests, adapt testcase
[i3/i3] / testcases / t / 12-floating-resize.t
index d908d345b0066b3f261553be8aa4cf8749ab517d..42ca43c097efcc695765de3a7bb300a3a4212e86 100644 (file)
@@ -4,30 +4,19 @@
 # the workspace to be empty).
 # TODO: skip it by default?
 
-use Test::More tests => 17;
-use Test::Deep;
+use i3test tests => 15;
 use X11::XCB qw(:all);
-use Data::Dumper;
 use Time::HiRes qw(sleep);
-use FindBin;
-use Digest::SHA1 qw(sha1_base64);
-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');
 }
 
 my $x = X11::XCB::Connection->new;
 
-my $sock = IO::Socket::UNIX->new(Peer => '/tmp/i3-ipc.sock');
-isa_ok($sock, 'IO::Socket::UNIX');
-
-# Switch to the nineth workspace
-$sock->write(i3test::format_ipc_command("9"));
-
-sleep 0.25;
+my $i3 = i3("/tmp/nestedcons");
+my $tmp = get_unused_workspace();
+$i3->command("workspace $tmp")->recv;
 
 #####################################################################
 # Create a floating window and see if resizing works
@@ -39,7 +28,7 @@ my $window = $x->root->create_child(
     rect => [ 0, 0, 30, 30],
     background_color => '#C0C0C0',
     # replace the type with 'utility' as soon as the coercion works again in X11::XCB
-    type => $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY'),
+    window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY'),
 );
 
 isa_ok($window, 'X11::XCB::Window');
@@ -78,13 +67,11 @@ sub test_resize {
 test_resize;
 
 # Test borderless
-$sock->write(i3test::format_ipc_command("bb"));
-sleep 0.25;
+$i3->command('border none')->recv;
 
 test_resize;
 
 # Test with 1-px-border
-$sock->write(i3test::format_ipc_command("bp"));
-sleep 0.25;
+$i3->command('border 1pixel')->recv;
 
 test_resize;