From 9be4199e13433c5c0b9e61f8cc962623436158c4 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Tue, 12 Sep 2017 09:18:40 +0000 Subject: [PATCH] 533-randr15.t: Add test for bar output name canonicalization --- testcases/t/533-randr15.t | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/testcases/t/533-randr15.t b/testcases/t/533-randr15.t index e22e8116..5b81194a 100644 --- a/testcases/t/533-randr15.t +++ b/testcases/t/533-randr15.t @@ -20,10 +20,16 @@ use File::Temp qw(tempfile); use i3test i3_autostart => 0; +my $monitor_name = 'i3-fake-monitor'; +my $output_name = 'i3-fake-output'; + my $config = < 1); @@ -42,7 +48,6 @@ my $reply = pack('cxSLLLLx[LLL]', # Manually intern _NET_CURRENT_DESKTOP as $x->atom will not create atoms if # they are not yet interned. -my $monitor_name = 'i3-fake-monitor'; my $atom_cookie = $x->intern_atom(0, length($monitor_name), $monitor_name); my $monitor_name_atom = $x->intern_atom_reply($atom_cookie->{sequence})->{atom}; @@ -68,7 +73,6 @@ close($outfh); # Prepare a RRGetOutputInfo reply as well; see RRGetOutputInfo in # https://www.x.org/releases/current/doc/randrproto/randrproto.txt -my $output_name = 'i3-fake-output'; ($outfh, my $outname_moninfo) = tempfile('i3-randr15reply-XXXXXX', UNLINK => 1); my $moninfo = pack('cxSLLLx[LLccSSSS]S a* x!4', 1, # reply @@ -100,6 +104,17 @@ is_deeply($output_data->{rect}, { y => 0, }, "Fake output at 3840x2160+0+0"); +# Verify that i3 canonicalizes RandR output names to i3 output names +# (RandR monitor names) for bar configs + +my $bars = i3->get_bar_config()->recv; +is(@$bars, 1, 'one bar configured'); + +my $bar_id = shift @$bars; + +my $bar_config = i3->get_bar_config($bar_id)->recv; +is_deeply($bar_config->{outputs}, [ $monitor_name ], 'bar_config output name is normalized'); + exit_gracefully($pid); ################################################################################ -- 2.39.5