lol

nixos/tests/firefox: use the module

This should exercise the module a bit in the test, and also removes an awkward override.

K900 e6f5980d 60421a16

+14 -16
+14 -16
nixos/tests/firefox.nix
··· 1 1 import ./make-test-python.nix ({ pkgs, firefoxPackage, ... }: 2 - let firefoxPackage' = firefoxPackage.override (args: { 3 - extraPrefsFiles = (args.extraPrefsFiles or []) ++ [ 4 - # make sure that autoplay is enabled by default for the audio test 5 - (builtins.toString (builtins.toFile "autoplay-pref.js" ''defaultPref("media.autoplay.default",0);'')) 6 - ]; 7 - }); 2 + { 3 + name = firefoxPackage.pname; 8 4 9 - in 10 - { 11 - name = firefoxPackage'.unwrapped.pname; 12 5 meta = with pkgs.lib.maintainers; { 13 6 maintainers = [ eelco shlevy ]; 14 7 }; ··· 17 10 { pkgs, ... }: 18 11 19 12 { imports = [ ./common/x11.nix ]; 20 - environment.systemPackages = [ 21 - firefoxPackage' 22 - pkgs.xdotool 23 - ]; 13 + environment.systemPackages = [ pkgs.xdotool ]; 14 + 15 + programs.firefox = { 16 + enable = true; 17 + preferences."media.autoplay.default" = 0; 18 + package = firefoxPackage; 19 + }; 24 20 25 21 # Create a virtual sound device, with mixing 26 22 # and all, for recording audio. ··· 58 54 59 55 }; 60 56 61 - testScript = '' 57 + testScript = let 58 + exe = firefoxPackage.unwrapped.binaryName; 59 + in '' 62 60 from contextlib import contextmanager 63 61 64 62 ··· 97 95 98 96 with subtest("Wait until Firefox has finished loading the Valgrind docs page"): 99 97 machine.execute( 100 - "xterm -e '${firefoxPackage'.unwrapped.binaryName} file://${pkgs.valgrind.doc}/share/doc/valgrind/html/index.html' >&2 &" 98 + "xterm -e '${exe} file://${pkgs.valgrind.doc}/share/doc/valgrind/html/index.html' >&2 &" 101 99 ) 102 100 machine.wait_for_window("Valgrind") 103 101 machine.sleep(40) ··· 105 103 with subtest("Check whether Firefox can play sound"): 106 104 with record_audio(machine): 107 105 machine.succeed( 108 - "${firefoxPackage'.unwrapped.binaryName} file://${pkgs.sound-theme-freedesktop}/share/sounds/freedesktop/stereo/phone-incoming-call.oga >&2 &" 106 + "${exe} file://${pkgs.sound-theme-freedesktop}/share/sounds/freedesktop/stereo/phone-incoming-call.oga >&2 &" 109 107 ) 110 108 wait_for_sound(machine) 111 109 machine.copy_from_vm("/tmp/record.wav")