1import ./make-test.nix ({ pkgs, ... }: {
2 name = "firefox";
3 meta = with pkgs.stdenv.lib.maintainers; {
4 maintainers = [ eelco chaoflow shlevy ];
5 };
6
7 machine =
8 { config, pkgs, ... }:
9
10 { imports = [ ./common/x11.nix ];
11 environment.systemPackages = [ pkgs.firefox pkgs.xdotool ];
12 };
13
14 testScript =
15 ''
16 $machine->waitForX;
17 $machine->execute("xterm -e 'firefox file://${pkgs.valgrind.doc}/share/doc/valgrind/html/index.html' &");
18 $machine->waitForWindow(qr/Valgrind/);
19 $machine->sleep(40); # wait until Firefox has finished loading the page
20 $machine->execute("xdotool key space"); # do I want to make Firefox the
21 # default browser? I just want to close the dialog
22 $machine->sleep(2); # wait until Firefox hides the default browser window
23 $machine->execute("xdotool key F12");
24 $machine->sleep(10); # wait until Firefox draws the developer tool panel
25 $machine->succeed("xwininfo -root -tree | grep Valgrind");
26 $machine->screenshot("screen");
27 '';
28
29})