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

Differential Revision: https://phabricator.services.mozilla.com/D20525

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Michael Kaply 2019-02-22 16:15:55 +00:00
parent 9b8862951b
commit 288d46045d
2 changed files with 16 additions and 1 deletions

View File

@ -485,7 +485,7 @@ var Policies = {
"DontCheckDefaultBrowser": { "DontCheckDefaultBrowser": {
onBeforeUIStartup(manager, param) { 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"); 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");
});