From 7e05a0700a78f07a07fda7a3b77eb244755296e9 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 21 Feb 2012 13:40:53 +0100 Subject: [PATCH] =?utf8?q?tests:=20don=E2=80=99t=20wait=20for=20window=20m?= =?utf8?q?ap=20event=20in=20open=5Fspecial?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Since the window doesn’t get mapped at all in these tests (it’s assigned to an invisible workspace), this saves us a timeout of 2 seconds :). --- testcases/t/166-assign.t | 7 ++++++- testcases/t/173-regress-focus-assign.t | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/testcases/t/166-assign.t b/testcases/t/166-assign.t index 458e9655..38797565 100644 --- a/testcases/t/166-assign.t +++ b/testcases/t/166-assign.t @@ -30,10 +30,15 @@ sub open_special { my $wm_class = delete($args{wm_class}) || 'special'; $args{name} //= 'special window'; - return open_window( + # We use dont_map because i3 will not map the window on the current + # workspace. Thus, open_window would time out in wait_for_map (2 seconds). + my $window = open_window( %args, before_map => sub { set_wm_class($_->id, $wm_class, $wm_class) }, + dont_map => 1, ); + $window->map; + return $window; } ##################################################################### diff --git a/testcases/t/173-regress-focus-assign.t b/testcases/t/173-regress-focus-assign.t index 65fcd829..22306db6 100644 --- a/testcases/t/173-regress-focus-assign.t +++ b/testcases/t/173-regress-focus-assign.t @@ -31,10 +31,15 @@ sub open_special { my $wm_class = delete($args{wm_class}) || 'special'; $args{name} //= 'special window'; - return open_window( + # We use dont_map because i3 will not map the window on the current + # workspace. Thus, open_window would time out in wait_for_map (2 seconds). + my $window = open_window( %args, before_map => sub { set_wm_class($_->id, $wm_class, $wm_class) }, + dont_map => 1, ); + $window->map; + return $window; } ##################################################################### -- 2.39.5