From 3a9d94bba4bcb2650519c9e07674050aa35d2043 Mon Sep 17 00:00:00 2001 From: Maik Fischer Date: Tue, 22 Nov 2011 01:27:08 +0100 Subject: [PATCH] testcases: don't sync_with_i3() before $x->input_focus since input_focus calls it anyways --- testcases/lib/i3test.pm | 2 -- testcases/t/101-focus.t | 1 - testcases/t/111-goto.t | 1 - testcases/t/135-floating-focus.t | 30 -------------------------- testcases/t/140-focus-lost.t | 2 -- testcases/t/141-resize.t | 2 -- testcases/t/156-fullscreen-focus.t | 3 --- testcases/t/163-wm-state.t | 2 -- testcases/t/164-kill-win-vs-client.t | 2 -- testcases/t/167-workspace_layout.t | 4 ---- testcases/t/170-force_focus_wrapping.t | 2 -- 11 files changed, 51 deletions(-) diff --git a/testcases/lib/i3test.pm b/testcases/lib/i3test.pm index d1a17865..44ce7f23 100644 --- a/testcases/lib/i3test.pm +++ b/testcases/lib/i3test.pm @@ -173,8 +173,6 @@ sub open_window { $window->map; wait_for_map($window); - # We sync with i3 here to make sure $x->input_focus is updated. - sync_with_i3(); return $window; } diff --git a/testcases/t/101-focus.t b/testcases/t/101-focus.t index 8f6038e6..8a795c46 100644 --- a/testcases/t/101-focus.t +++ b/testcases/t/101-focus.t @@ -25,7 +25,6 @@ sub focus_after { my $msg = shift; cmd $msg; - sync_with_i3; return $x->input_focus; } diff --git a/testcases/t/111-goto.t b/testcases/t/111-goto.t index fa9aaf3c..dd60d9cf 100644 --- a/testcases/t/111-goto.t +++ b/testcases/t/111-goto.t @@ -24,7 +24,6 @@ sub focus_after { my $msg = shift; cmd $msg; - sync_with_i3; return $x->input_focus; } diff --git a/testcases/t/135-floating-focus.t b/testcases/t/135-floating-focus.t index 4955618f..c7218130 100644 --- a/testcases/t/135-floating-focus.t +++ b/testcases/t/135-floating-focus.t @@ -36,8 +36,6 @@ cmd 'floating enable'; cmd '[id="' . $second->id . '"] focus'; -sync_with_i3; - is($x->input_focus, $second->id, 'second con focused'); cmd 'floating enable'; @@ -67,8 +65,6 @@ cmd 'floating enable'; cmd '[id="' . $second->id . '"] focus'; -sync_with_i3; - is($x->input_focus, $second->id, 'second con focused'); cmd 'floating enable'; @@ -103,8 +99,6 @@ cmd 'floating enable'; cmd '[id="' . $second->id . '"] focus'; -sync_with_i3; - is($x->input_focus, $second->id, 'second con focused'); cmd 'floating enable'; @@ -132,8 +126,6 @@ $tmp = fresh_workspace; $first = open_window({ background_color => '#ff0000' }); # window 8 $second = open_window({ background_color => '#00ff00' }); # window 9 -sync_with_i3; - is($x->input_focus, $second->id, 'second container focused'); cmd 'floating enable'; @@ -142,32 +134,22 @@ is($x->input_focus, $second->id, 'second container focused'); cmd 'focus tiling'; -sync_with_i3; - is($x->input_focus, $first->id, 'first (tiling) container focused'); cmd 'focus floating'; -sync_with_i3; - is($x->input_focus, $second->id, 'second (floating) container focused'); cmd 'focus floating'; -sync_with_i3; - is($x->input_focus, $second->id, 'second (floating) container still focused'); cmd 'focus mode_toggle'; -sync_with_i3; - is($x->input_focus, $first->id, 'first (tiling) container focused'); cmd 'focus mode_toggle'; -sync_with_i3; - is($x->input_focus, $second->id, 'second (floating) container focused'); ############################################################################# @@ -180,38 +162,26 @@ $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; - is($x->input_focus, $third->id, 'third container focused'); cmd 'focus left'; -sync_with_i3; - is($x->input_focus, $second->id, 'second container focused'); cmd 'focus left'; -sync_with_i3; - is($x->input_focus, $first->id, 'first container focused'); cmd 'focus left'; -sync_with_i3; - is($x->input_focus, $third->id, 'focus wrapped to third container'); cmd 'focus right'; -sync_with_i3; - is($x->input_focus, $first->id, 'focus wrapped to first container'); cmd 'focus right'; -sync_with_i3; - is($x->input_focus, $second->id, 'focus on second container'); done_testing; diff --git a/testcases/t/140-focus-lost.t b/testcases/t/140-focus-lost.t index e7388fd9..2d3c1570 100644 --- a/testcases/t/140-focus-lost.t +++ b/testcases/t/140-focus-lost.t @@ -22,8 +22,6 @@ my $left = open_window; my $mid = open_window; my $right = open_window; -sync_with_i3; - diag("left = " . $left->id . ", mid = " . $mid->id . ", right = " . $right->id); is($x->input_focus, $right->id, 'Right window focused'); diff --git a/testcases/t/141-resize.t b/testcases/t/141-resize.t index 3f332ce1..0b429fb0 100644 --- a/testcases/t/141-resize.t +++ b/testcases/t/141-resize.t @@ -10,8 +10,6 @@ cmd 'split v'; my $top = open_window; my $bottom = open_window; -sync_with_i3; - diag("top = " . $top->id . ", bottom = " . $bottom->id); is($x->input_focus, $bottom->id, 'Bottom window focused'); diff --git a/testcases/t/156-fullscreen-focus.t b/testcases/t/156-fullscreen-focus.t index 75133cae..c7646e41 100644 --- a/testcases/t/156-fullscreen-focus.t +++ b/testcases/t/156-fullscreen-focus.t @@ -57,9 +57,6 @@ my $tmp2 = get_unused_workspace; cmd "move workspace $tmp2"; # verify that the third window has the focus - -sync_with_i3; - is($x->input_focus, $third->id, 'third window focused'); done_testing; diff --git a/testcases/t/163-wm-state.t b/testcases/t/163-wm-state.t index b14dd5b5..6df2bcbd 100644 --- a/testcases/t/163-wm-state.t +++ b/testcases/t/163-wm-state.t @@ -9,8 +9,6 @@ use X11::XCB qw(ICCCM_WM_STATE_NORMAL ICCCM_WM_STATE_WITHDRAWN); my $window = open_window; -sync_with_i3; - is($window->state, ICCCM_WM_STATE_NORMAL, 'WM_STATE normal'); $window->unmap; diff --git a/testcases/t/164-kill-win-vs-client.t b/testcases/t/164-kill-win-vs-client.t index 5c112341..165a32ce 100644 --- a/testcases/t/164-kill-win-vs-client.t +++ b/testcases/t/164-kill-win-vs-client.t @@ -14,8 +14,6 @@ sub two_windows { my $first = open_window; my $second = open_window; - sync_with_i3; - is($x->input_focus, $second->id, 'second window focused'); ok(@{get_ws_content($tmp)} == 2, 'two containers opened'); diff --git a/testcases/t/167-workspace_layout.t b/testcases/t/167-workspace_layout.t index e6704d24..aeb700ba 100644 --- a/testcases/t/167-workspace_layout.t +++ b/testcases/t/167-workspace_layout.t @@ -26,8 +26,6 @@ ok(@{get_ws_content($tmp)} == 0, 'no containers yet'); my $first = open_window; my $second = open_window; -sync_with_i3; - is($x->input_focus, $second->id, 'second window focused'); my @content = @{get_ws_content($tmp)}; ok(@content == 2, 'two containers opened'); @@ -56,8 +54,6 @@ ok(@{get_ws_content($tmp)} == 0, 'no containers yet'); $first = open_window; $second = open_window; -sync_with_i3; - is($x->input_focus, $second->id, 'second window focused'); @content = @{get_ws_content($tmp)}; ok(@content == 1, 'one con at workspace level'); diff --git a/testcases/t/170-force_focus_wrapping.t b/testcases/t/170-force_focus_wrapping.t index 69d14688..30458b00 100644 --- a/testcases/t/170-force_focus_wrapping.t +++ b/testcases/t/170-force_focus_wrapping.t @@ -70,8 +70,6 @@ cmd 'focus parent'; $third = open_window; -sync_with_i3; - is($x->input_focus, $third->id, 'third window focused'); cmd 'focus left'; -- 2.39.5