3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #180796 from squalus/librewolf-tests

This commit is contained in:
Martin Weinelt 2022-07-10 14:16:24 +02:00 committed by GitHub
commit 09b76341b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 6 deletions

View file

@ -278,6 +278,7 @@ in {
libreddit = handleTest ./libreddit.nix {};
libresprite = handleTest ./libresprite.nix {};
libreswan = handleTest ./libreswan.nix {};
librewolf = handleTest ./firefox.nix { firefoxPackage = pkgs.librewolf; };
lidarr = handleTest ./lidarr.nix {};
lightdm = handleTest ./lightdm.nix {};
limesurvey = handleTest ./limesurvey.nix {};

View file

@ -1,5 +1,14 @@
import ./make-test-python.nix ({ pkgs, firefoxPackage, ... }: {
name = "firefox";
import ./make-test-python.nix ({ pkgs, firefoxPackage, ... }:
let firefoxPackage' = firefoxPackage.override (args: {
extraPrefsFiles = (args.extraPrefsFiles or []) ++ [
# make sure that autoplay is enabled by default for the audio test
(builtins.toString (builtins.toFile "autoplay-pref.js" ''defaultPref("media.autoplay.default",0);''))
];
});
in
{
name = firefoxPackage'.unwrapped.binaryName;
meta = with pkgs.lib.maintainers; {
maintainers = [ eelco shlevy ];
};
@ -9,7 +18,7 @@ import ./make-test-python.nix ({ pkgs, firefoxPackage, ... }: {
{ imports = [ ./common/x11.nix ];
environment.systemPackages = [
firefoxPackage
firefoxPackage'
pkgs.xdotool
];
@ -88,7 +97,7 @@ import ./make-test-python.nix ({ pkgs, firefoxPackage, ... }: {
with subtest("Wait until Firefox has finished loading the Valgrind docs page"):
machine.execute(
"xterm -e 'firefox file://${pkgs.valgrind.doc}/share/doc/valgrind/html/index.html' >&2 &"
"xterm -e '${firefoxPackage'.unwrapped.binaryName} file://${pkgs.valgrind.doc}/share/doc/valgrind/html/index.html' >&2 &"
)
machine.wait_for_window("Valgrind")
machine.sleep(40)
@ -96,7 +105,7 @@ import ./make-test-python.nix ({ pkgs, firefoxPackage, ... }: {
with subtest("Check whether Firefox can play sound"):
with record_audio(machine):
machine.succeed(
"firefox file://${pkgs.sound-theme-freedesktop}/share/sounds/freedesktop/stereo/phone-incoming-call.oga >&2 &"
"${firefoxPackage'.unwrapped.binaryName} file://${pkgs.sound-theme-freedesktop}/share/sounds/freedesktop/stereo/phone-incoming-call.oga >&2 &"
)
wait_for_sound(machine)
machine.copy_from_vm("/tmp/record.wav")

View file

@ -1,4 +1,4 @@
{ stdenv, lib, callPackage, buildMozillaMach }:
{ stdenv, lib, callPackage, buildMozillaMach, nixosTests }:
let
librewolf-src = callPackage ./librewolf.nix { };
@ -22,6 +22,7 @@ in
maxSilent = 14400; # 4h, double the default of 7200s (c.f. #129212, #129115)
license = lib.licenses.mpl20;
};
tests = [ nixosTests.librewolf ];
updateScript = callPackage ./update.nix {
attrPath = "librewolf-unwrapped";
};