-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
316 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 21 additions & 16 deletions
37
tests/modules/programs/firefox/container-id-out-of-range.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,32 @@ | ||
modulePath: | ||
{ config, lib, ... }: | ||
|
||
{ | ||
imports = [ ./setup-firefox-mock-overlay.nix ]; | ||
with lib; | ||
|
||
config = lib.mkIf config.test.enableBig { | ||
let | ||
|
||
firefoxMockOverlay = import ./setup-firefox-mock-overlay.nix modulePath; | ||
|
||
in { | ||
imports = [ firefoxMockOverlay ]; | ||
|
||
config = mkIf config.test.enableBig ({ | ||
test.asserts.assertions.expected = | ||
[ "Container id must be smaller than 4294967294 (2^32 - 2)" ]; | ||
} // setAttrByPath modulePath { | ||
enable = true; | ||
|
||
programs.firefox = { | ||
enable = true; | ||
|
||
profiles.my-profile = { | ||
isDefault = true; | ||
id = 1; | ||
profiles.my-profile = { | ||
isDefault = true; | ||
id = 1; | ||
|
||
containers = { | ||
"shopping" = { | ||
id = 4294967294; | ||
color = "blue"; | ||
icon = "circle"; | ||
}; | ||
containers = { | ||
"shopping" = { | ||
id = 4294967294; | ||
color = "blue"; | ||
icon = "circle"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}); | ||
} |
This file was deleted.
Oops, something went wrong.
27 changes: 16 additions & 11 deletions
27
tests/modules/programs/firefox/deprecated-native-messenger.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,26 @@ | ||
modulePath: | ||
{ config, lib, ... }: | ||
|
||
with lib; | ||
|
||
{ config, lib, ... }: | ||
let | ||
|
||
moduleName = concatStringsSep "." modulePath; | ||
|
||
{ | ||
imports = [ ./setup-firefox-mock-overlay.nix ]; | ||
firefoxMockOverlay = import ./setup-firefox-mock-overlay.nix modulePath; | ||
|
||
config = lib.mkIf config.test.enableBig { | ||
programs.firefox = { | ||
enable = true; | ||
enableGnomeExtensions = true; | ||
}; | ||
in { | ||
imports = [ firefoxMockOverlay ]; | ||
|
||
config = mkIf config.test.enableBig (setAttrByPath modulePath { | ||
enable = true; | ||
enableGnomeExtensions = true; | ||
} // { | ||
test.asserts.warnings.expected = ['' | ||
Using 'programs.firefox.enableGnomeExtensions' has been deprecated and | ||
Using '${moduleName}.enableGnomeExtensions' has been deprecated and | ||
will be removed in the future. Please change to overriding the package | ||
configuration using 'programs.firefox.package' instead. You can refer to | ||
configuration using '${moduleName}.package' instead. You can refer to | ||
its example for how to do this. | ||
'']; | ||
}; | ||
}); | ||
} |
55 changes: 31 additions & 24 deletions
55
tests/modules/programs/firefox/duplicate-container-ids.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,42 @@ | ||
modulePath: | ||
{ config, lib, ... }: | ||
|
||
{ | ||
imports = [ ./setup-firefox-mock-overlay.nix ]; | ||
with lib; | ||
|
||
config = lib.mkIf config.test.enableBig { | ||
let | ||
|
||
cfg = getAttrFromPath modulePath config; | ||
|
||
firefoxMockOverlay = import ./setup-firefox-mock-overlay.nix modulePath; | ||
|
||
in { | ||
imports = [ firefoxMockOverlay ]; | ||
|
||
config = mkIf config.test.enableBig ({ | ||
test.asserts.assertions.expected = ['' | ||
Must not have a Firefox container with an existing ID but | ||
Must not have a ${cfg.name} container with an existing ID but | ||
- ID 9 is used by dangerous, shopping'']; | ||
} // setAttrByPath modulePath { | ||
enable = true; | ||
|
||
profiles = { | ||
my-profile = { | ||
isDefault = true; | ||
id = 1; | ||
|
||
programs.firefox = { | ||
enable = true; | ||
|
||
profiles = { | ||
my-profile = { | ||
isDefault = true; | ||
id = 1; | ||
|
||
containers = { | ||
"shopping" = { | ||
id = 9; | ||
color = "blue"; | ||
icon = "circle"; | ||
}; | ||
"dangerous" = { | ||
id = 9; | ||
color = "red"; | ||
icon = "circle"; | ||
}; | ||
containers = { | ||
"shopping" = { | ||
id = 9; | ||
color = "blue"; | ||
icon = "circle"; | ||
}; | ||
"dangerous" = { | ||
id = 9; | ||
color = "red"; | ||
icon = "circle"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,30 @@ | ||
modulePath: | ||
{ config, lib, ... }: | ||
|
||
{ | ||
imports = [ ./setup-firefox-mock-overlay.nix ]; | ||
with lib; | ||
|
||
config = lib.mkIf config.test.enableBig { | ||
let | ||
|
||
cfg = getAttrFromPath modulePath config; | ||
|
||
firefoxMockOverlay = import ./setup-firefox-mock-overlay.nix modulePath; | ||
|
||
in { | ||
imports = [ firefoxMockOverlay ]; | ||
|
||
config = mkIf config.test.enableBig ({ | ||
test.asserts.assertions.expected = ['' | ||
Must not have a Firefox profile with an existing ID but | ||
Must not have a ${cfg.name} profile with an existing ID but | ||
- ID 1 is used by first, second'']; | ||
} // setAttrByPath modulePath { | ||
enable = true; | ||
|
||
programs.firefox = { | ||
enable = true; | ||
|
||
profiles = { | ||
first = { | ||
isDefault = true; | ||
id = 1; | ||
}; | ||
second = { id = 1; }; | ||
profiles = { | ||
first = { | ||
isDefault = true; | ||
id = 1; | ||
}; | ||
second = { id = 1; }; | ||
}; | ||
}; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
let name = "firefox"; | ||
|
||
in builtins.mapAttrs (test: module: import module [ "programs" name ]) { | ||
"${name}-profile-settings" = ./profile-settings.nix; | ||
"${name}-state-version-19_09" = ./state-version-19_09.nix; | ||
"${name}-deprecated-native-messenger" = ./deprecated-native-messenger.nix; | ||
"${name}-duplicate-profile-ids" = ./duplicate-profile-ids.nix; | ||
"${name}-duplicate-container-ids" = ./duplicate-container-ids.nix; | ||
"${name}-container-id-out-of-range" = ./container-id-out-of-range.nix; | ||
"${name}-policies" = ./policies.nix; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.