Bug 1529312 - Allow DontCheckDefaultBrower policy to be false r=Felipe

Differential Revision: https://phabricator.services.mozilla.com/D20525
This commit is contained in:
Michael Kaply
2019-02-22 16:15:55 +00:00
parent 6c3dc248ae
commit 41eaa5f8bb
2 changed files with 16 additions and 1 deletions

View File

@@ -485,7 +485,7 @@ var Policies = {
"DontCheckDefaultBrowser": {
onBeforeUIStartup(manager, param) {
setAndLockPref("browser.shell.checkDefaultBrowser", false);
setAndLockPref("browser.shell.checkDefaultBrowser", !param);
},
},

View File

@@ -25,3 +25,18 @@ add_task(async function test_default_browser_check() {
is(ShellService.shouldCheckDefaultBrowser, false, "Policy is enforced");
});
add_task(async function test_default_browser_check() {
await setupPolicyEngineWithJson({
"policies": {
"DontCheckDefaultBrowser": false,
},
});
is(ShellService.shouldCheckDefaultBrowser, true, "Policy changed it to check");
// Try to change it to false and check that it doesn't take effect
ShellService.shouldCheckDefaultBrowser = false;
is(ShellService.shouldCheckDefaultBrowser, true, "Policy is enforced");
});