nixos/tests/chromium: Detect popup using OCR.

This will make the test a lot more reliable, because we no longer need
to press ESC multiple times hoping that it will close the popup.

Unfortunately in order to run this test I needed to locally revert the
gyp update from a305e6855d.

With the old gyp version however the test runs fine and it's able to
properly detect the popup.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
aszlig 2015-05-22 11:23:09 +02:00
parent dfbd1ddb8b
commit 5f50f23013
No known key found for this signature in database
GPG key ID: D0EBD0EC8C2DC961

View file

@ -9,6 +9,8 @@ import ./make-test.nix (
}: rec {
name = "chromium";
enableOCR = true;
machine.imports = [ ./common/x11.nix ];
machine.virtualisation.memorySize = 1024;
@ -106,15 +108,11 @@ import ./make-test.nix (
"ulimit -c unlimited; ".
"$pkg/bin/chromium $args \"$url\" & disown"
);
$machine->waitForText(qr/Type to search or enter a URL to navigate/);
$machine->waitUntilSucceeds("${xdo "check-startup" ''
search --sync --onlyvisible --name "startup done"
# close first start help popup
key -delay 1000 Escape
# XXX: This is to make sure the popup is closed, but we better do
# screenshots to detect visual changes.
key -delay 2000 Escape
key -delay 3000 Escape
key -delay 4000 Escape
windowfocus --sync
windowactivate --sync
''}");