From 293517fb2ef7036b7df2e5ea64db5c9b6b268766 Mon Sep 17 00:00:00 2001 From: Maik Fischer Date: Tue, 22 Nov 2011 01:00:54 +0100 Subject: [PATCH] testcases: drop open_floating_window()s $x parameter, use global --- testcases/lib/i3test.pm | 2 +- testcases/t/104-focus-stack.t | 2 +- testcases/t/112-floating-resize.t | 2 +- testcases/t/114-client-leader.t | 4 ++-- testcases/t/124-move.t | 2 +- testcases/t/135-floating-focus.t | 6 +++--- testcases/t/136-floating-ws-empty.t | 2 +- testcases/t/137-floating-unmap.t | 2 +- testcases/t/138-floating-attach.t | 4 ++-- testcases/t/146-floating-reinsert.t | 2 +- testcases/t/174-border-config.t | 4 ++-- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/testcases/lib/i3test.pm b/testcases/lib/i3test.pm index 1ddaa52b..d3d8ad04 100644 --- a/testcases/lib/i3test.pm +++ b/testcases/lib/i3test.pm @@ -181,7 +181,7 @@ sub open_window { # Thin wrapper around open_window which sets window_type to # _NET_WM_WINDOW_TYPE_UTILITY to make the window floating. sub open_floating_window { - my ($x, $args) = @_; + my ($args) = @_; my %args = ($args ? %$args : ()); $args{window_type} = $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY'); diff --git a/testcases/t/104-focus-stack.t b/testcases/t/104-focus-stack.t index f72cd75f..3b3fe74d 100644 --- a/testcases/t/104-focus-stack.t +++ b/testcases/t/104-focus-stack.t @@ -15,7 +15,7 @@ my $tiled_right = open_window; my $focus = $x->input_focus; # Create a floating window which is smaller than the minimum enforced size of i3 -my $window = open_floating_window($x); +my $window = open_floating_window; is($x->input_focus, $window->id, 'floating window focused'); diff --git a/testcases/t/112-floating-resize.t b/testcases/t/112-floating-resize.t index a428df4f..fe9803e6 100644 --- a/testcases/t/112-floating-resize.t +++ b/testcases/t/112-floating-resize.t @@ -9,7 +9,7 @@ fresh_workspace; # Create a floating window and see if resizing works ##################################################################### -my $window = open_floating_window($x); +my $window = open_floating_window; # See if configurerequests cause window movements (they should not) my ($a, $t) = $window->rect; diff --git a/testcases/t/114-client-leader.t b/testcases/t/114-client-leader.t index 3b0bddc0..497bad9e 100644 --- a/testcases/t/114-client-leader.t +++ b/testcases/t/114-client-leader.t @@ -18,7 +18,7 @@ my $right = open_window({ name => 'Right' }); my ($abs, $rgeom) = $right->rect; -my $child = open_floating_window($x, { +my $child = open_floating_window({ dont_map => 1, name => 'Child window', }); @@ -31,7 +31,7 @@ my $cgeom; ($abs, $cgeom) = $child->rect; cmp_ok($cgeom->x, '>=', $rgeom->x, 'Child X >= right container X'); -my $child2 = open_floating_window($x, { +my $child2 = open_floating_window({ dont_map => 1, name => 'Child window 2', }); diff --git a/testcases/t/124-move.t b/testcases/t/124-move.t index 9d7a235f..a078a9e8 100644 --- a/testcases/t/124-move.t +++ b/testcases/t/124-move.t @@ -136,7 +136,7 @@ is(@{$content}, 1, 'only one nodes on this workspace'); ###################################################################### $tmp = fresh_workspace; -my $floatwin = open_floating_window($x); +my $floatwin = open_floating_window; my ($absolute_before, $top_before) = $floatwin->rect; cmd 'move left'; diff --git a/testcases/t/135-floating-focus.t b/testcases/t/135-floating-focus.t index 37d141b1..f5182e1b 100644 --- a/testcases/t/135-floating-focus.t +++ b/testcases/t/135-floating-focus.t @@ -176,9 +176,9 @@ is($x->input_focus, $second->id, 'second (floating) container focused'); $tmp = fresh_workspace; -$first = open_floating_window($x, { background_color => '#ff0000' });# window 10 -$second = open_floating_window($x, { background_color => '#00ff00' }); # window 11 -$third = open_floating_window($x, { background_color => '#0000ff' }); # window 12 +$first = open_floating_window({ background_color => '#ff0000' });# window 10 +$second = open_floating_window({ background_color => '#00ff00' }); # window 11 +$third = open_floating_window({ background_color => '#0000ff' }); # window 12 sync_with_i3($x); diff --git a/testcases/t/136-floating-ws-empty.t b/testcases/t/136-floating-ws-empty.t index 1666884e..f17b0ec1 100644 --- a/testcases/t/136-floating-ws-empty.t +++ b/testcases/t/136-floating-ws-empty.t @@ -15,7 +15,7 @@ my $tmp = fresh_workspace; ok(workspace_exists($tmp), "workspace $tmp exists"); # Create a floating window which is smaller than the minimum enforced size of i3 -my $window = open_floating_window($x); +my $window = open_floating_window; ok($window->mapped, 'Window is mapped'); # switch to a different workspace, see if the window is still mapped? diff --git a/testcases/t/137-floating-unmap.t b/testcases/t/137-floating-unmap.t index 29762594..0d126fea 100644 --- a/testcases/t/137-floating-unmap.t +++ b/testcases/t/137-floating-unmap.t @@ -14,7 +14,7 @@ my $tmp = fresh_workspace; ############################################################################# # Create a floating window which is smaller than the minimum enforced size of i3 -my $window = open_floating_window($x); +my $window = open_floating_window; ok($window->mapped, 'Window is mapped'); # switch to a different workspace, see if the window is still mapped? diff --git a/testcases/t/138-floating-attach.t b/testcases/t/138-floating-attach.t index 71f10ef5..db86e1ca 100644 --- a/testcases/t/138-floating-attach.t +++ b/testcases/t/138-floating-attach.t @@ -14,7 +14,7 @@ my $tmp = fresh_workspace; ############################################################################# # Create a floating window -my $window = open_floating_window($x); +my $window = open_floating_window; ok($window->mapped, 'Window is mapped'); my $ws = get_ws($tmp); @@ -47,7 +47,7 @@ is(@{$ws->{floating_nodes}}, 0, 'no floating nodes so far'); is(@{$ws->{nodes}}, 1, 'one tiling node (stacked con)'); # Create a floating window -$window = open_floating_window($x); +$window = open_floating_window; ok($window->mapped, 'Window is mapped'); $ws = get_ws($tmp); diff --git a/testcases/t/146-floating-reinsert.t b/testcases/t/146-floating-reinsert.t index c3a4512a..ca209e1c 100644 --- a/testcases/t/146-floating-reinsert.t +++ b/testcases/t/146-floating-reinsert.t @@ -18,7 +18,7 @@ my ($nodes, $focus) = get_ws_content($tmp); ############################################################################# # Create a floating window -my $window = open_floating_window($x); +my $window = open_floating_window; ok($window->mapped, 'Window is mapped'); ($nodes, $focus) = get_ws_content($tmp); diff --git a/testcases/t/174-border-config.t b/testcases/t/174-border-config.t index 6196b684..009f5094 100644 --- a/testcases/t/174-border-config.t +++ b/testcases/t/174-border-config.t @@ -73,7 +73,7 @@ $tmp = fresh_workspace; ok(@{get_ws_content($tmp)} == 0, 'no containers yet'); -$first = open_floating_window($x); +$first = open_floating_window; my $wscontent = get_ws($tmp); my @floating = @{$wscontent->{floating_nodes}}; @@ -101,7 +101,7 @@ $tmp = fresh_workspace; ok(@{get_ws_content($tmp)} == 0, 'no containers yet'); -$first = open_floating_window($x); +$first = open_floating_window; $wscontent = get_ws($tmp); @floating = @{$wscontent->{floating_nodes}}; -- 2.39.5