tests: add test for dock client + restart

This commit is contained in:
Michael Stapelberg
2011-02-21 12:21:02 +01:00
parent a678c16bc9
commit 0f97b1fef6
3 changed files with 127 additions and 19 deletions

View File

@ -11,7 +11,7 @@ use List::Util qw(first);
use v5.10;
use Exporter ();
our @EXPORT = qw(get_workspace_names get_unused_workspace get_ws_content get_ws get_focused open_empty_con open_standard_window cmd does_i3_live);
our @EXPORT = qw(get_workspace_names get_unused_workspace get_ws_content get_ws get_focused open_empty_con open_standard_window get_dock_clients cmd does_i3_live);
my $tester = Test::Builder->new();
@ -129,6 +129,19 @@ sub get_focused {
return $lf;
}
sub get_dock_clients {
my $tree = i3("/tmp/nestedcons")->get_tree->recv;
my @outputs = @{$tree->{nodes}};
# Children of all dockareas
my @docked;
for my $output (@outputs) {
@docked = (@docked, map { @{$_->{nodes}} }
grep { $_->{type} == 5 }
@{$output->{nodes}});
}
return @docked;
}
sub cmd {
i3("/tmp/nestedcons")->command(@_)->recv
}