X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=testcases%2Ft%2F113-urgent.t;h=5ee61a4d2b887c34a2776e3920a27743ffefe2df;hb=c7ea8c42b679be191e843f653f5024846ce42fe9;hp=7954408fa2bf30efaa30d590f0c16ef1fedf2ea2;hpb=0adbffb38621192c416ac52aa6b82ac57fb6394d;p=i3%2Fi3 diff --git a/testcases/t/113-urgent.t b/testcases/t/113-urgent.t index 7954408f..5ee61a4d 100644 --- a/testcases/t/113-urgent.t +++ b/testcases/t/113-urgent.t @@ -2,15 +2,8 @@ # vim:ts=4:sw=4:expandtab use i3test; -use X11::XCB qw(:all); use List::Util qw(first); -BEGIN { - use_ok('X11::XCB::Connection') or BAIL_OUT('Cannot load X11::XCB::Connection'); -} - -my $x = X11::XCB::Connection->new; - my $tmp = fresh_workspace; ##################################################################### @@ -19,8 +12,8 @@ my $tmp = fresh_workspace; cmd 'split v'; -my $top = open_window($x); -my $bottom = open_window($x); +my $top = open_window; +my $bottom = open_window; my @urgent = grep { $_->{urgent} } @{get_ws_content($tmp)}; is(@urgent, 0, 'no window got the urgent flag'); @@ -31,12 +24,12 @@ is(@urgent, 0, 'no window got the urgent flag'); # Add the urgency hint, switch to a different workspace and back again ##################################################################### $top->add_hint('urgency'); -sync_with_i3($x); +sync_with_i3; -@content = @{get_ws_content($tmp)}; +my @content = @{get_ws_content($tmp)}; @urgent = grep { $_->{urgent} } @content; -$top_info = first { $_->{window} == $top->id } @content; -$bottom_info = first { $_->{window} == $bottom->id } @content; +my $top_info = first { $_->{window} == $top->id } @content; +my $bottom_info = first { $_->{window} == $bottom->id } @content; ok($top_info->{urgent}, 'top window is marked urgent'); ok(!$bottom_info->{urgent}, 'bottom window is not marked urgent'); @@ -48,7 +41,7 @@ cmd '[id="' . $top->id . '"] focus'; is(@urgent, 0, 'no window got the urgent flag after focusing'); $top->add_hint('urgency'); -sync_with_i3($x); +sync_with_i3; @urgent = grep { $_->{urgent} } @{get_ws_content($tmp)}; is(@urgent, 0, 'no window got the urgent flag after re-setting urgency hint'); @@ -62,7 +55,7 @@ ok(!$ws->{urgent}, 'urgent flag not set on workspace'); my $otmp = fresh_workspace; $top->add_hint('urgency'); -sync_with_i3($x); +sync_with_i3; $ws = get_ws($tmp); ok($ws->{urgent}, 'urgent flag set on workspace');