tests: lib/i3test: Remove open_standard_window, introduce open_window

open_window has a better API than open_standard_window. It uses named
parameters and supplies default values for everything you don’t specify. This
way, you can use every feature which X11::XCB::Window supports.
This commit is contained in:
Michael Stapelberg
2011-09-24 15:11:37 +01:00
parent c3eb9f6c45
commit de5286da59
38 changed files with 207 additions and 386 deletions

View File

@ -11,7 +11,6 @@ BEGIN {
my $x = X11::XCB::Connection->new;
my $i3 = i3(get_socket_path());
my $tmp = fresh_workspace;
cmd 'split h';
@ -20,13 +19,9 @@ cmd 'split h';
# Create two windows and make sure focus switching works
#####################################################################
my $top = open_standard_window($x);
my $mid = open_standard_window($x);
my $bottom = open_standard_window($x);
diag("top id = " . $top->id);
diag("mid id = " . $mid->id);
diag("bottom id = " . $bottom->id);
my $top = open_window($x);
my $mid = open_window($x);
my $bottom = open_window($x);
#
# Returns the input focus after sending the given command to i3 via IPC
@ -55,7 +50,7 @@ my $random_mark = sha1_base64(rand());
$focus = focus_after(qq|[con_mark="$random_mark"] focus|);
is($focus, $mid->id, "focus unchanged");
$i3->command("mark $random_mark")->recv;
cmd "mark $random_mark";
$focus = focus_after('focus left');
is($focus, $top->id, "Top window focused");