Commit a72b687b authored by Felipe Gomes's avatar Felipe Gomes
Browse files

Bug 1429141 - Policy: Don't check if Firefox is the default browser on startup. r=Gijs

MozReview-Commit-ID: DMpGbNkhRN6
parent fafa9a9a
......@@ -35,6 +35,12 @@ this.Policies = {
}
}
},
"dont_check_default_browser": {
onBeforeUIStartup(manager, param) {
setAndLockPref("browser.shell.checkDefaultBrowser", false);
}
}
};
/*
......
......@@ -6,6 +6,14 @@
"description": "Blocks access to the about:config page.",
"first_available": "60.0",
"type": "boolean",
"enum": [true]
},
"dont_check_default_browser": {
"description": "Don't check for the default browser on startup.",
"first_available": "60.0",
"type": "boolean",
"enum": [true]
}
......
......@@ -3,6 +3,7 @@ prefs =
browser.policies.enabled=true
support-files =
head.js
config_dont_check_default_browser.json
config_setAndLockPref.json
config_simple_policies.json
config_broken_json.json
......@@ -11,3 +12,4 @@ support-files =
[browser_policies_setAndLockPref_API.js]
[browser_policies_simple_policies.js]
[browser_policies_validate_and_parse_API.js]
[browser_policy_default_browser_check.js]
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { ShellService } = Cu.import("resource:///modules/ShellService.jsm", {});
add_task(async function test_default_browser_check() {
ShellService._checkedThisSession = false;
// On a normal profile, the default is true. However, this gets set to false on the
// testing profile. Let's start with true for a sanity check.
ShellService.shouldCheckDefaultBrowser = true;
is(ShellService.shouldCheckDefaultBrowser, true, "Sanity check");
await setupPolicyEngineWithJson("config_dont_check_default_browser.json");
is(ShellService.shouldCheckDefaultBrowser, false, "Policy changed it to not check");
// Try to change it to true and check that it doesn't take effect
ShellService.shouldCheckDefaultBrowser = true;
is(ShellService.shouldCheckDefaultBrowser, false, "Policy is enforced");
});
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment