mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-12 13:18:57 +03:00
make mumble vm test more robust
This test should have a more robust retry loop and handles wrong focus on all windows.
This commit is contained in:
parent
e087b0d12f
commit
7baf620218
2 changed files with 75 additions and 29 deletions
|
@ -566,14 +566,25 @@ sub getWindowNames {
|
|||
}
|
||||
|
||||
|
||||
sub hasWindow {
|
||||
my ($self, $regexp) = @_;
|
||||
my @names = $self->getWindowNames;
|
||||
foreach my $n (@names) {
|
||||
if ($n =~ /$regexp/) {
|
||||
$self->log("match '$n' on '$regexp'");
|
||||
return 1;
|
||||
} else {
|
||||
$self->log("no match '$n' on '$regexp'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub waitForWindow {
|
||||
my ($self, $regexp) = @_;
|
||||
$self->nest("waiting for a window to appear", sub {
|
||||
retry sub {
|
||||
my @names = $self->getWindowNames;
|
||||
foreach my $n (@names) {
|
||||
return 1 if $n =~ /$regexp/;
|
||||
}
|
||||
return $self->hasWindow($regexp)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue