mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1568994 - Convert Enterprise policy AppUpdateURL to work with the new update url mechanism r=mkaply,mhowell
Differential Revision: https://phabricator.services.mozilla.com/D45869 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
b7a4f22235
commit
2b3d684f4e
@ -90,9 +90,8 @@ var Policies = {
|
||||
},
|
||||
|
||||
AppUpdateURL: {
|
||||
onBeforeAddons(manager, param) {
|
||||
setDefaultPref("app.update.url", param.href);
|
||||
},
|
||||
// No implementation needed here. UpdateService.jsm will check for this
|
||||
// policy directly when determining the update URL.
|
||||
},
|
||||
|
||||
Authentication: {
|
||||
|
@ -3,6 +3,10 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
let { Checker } = ChromeUtils.import(
|
||||
"resource://gre/modules/UpdateService.jsm"
|
||||
);
|
||||
|
||||
add_task(async function test_app_update_URL() {
|
||||
await setupPolicyEngineWithJson({
|
||||
policies: {
|
||||
@ -16,10 +20,8 @@ add_task(async function test_app_update_URL() {
|
||||
"Engine is active"
|
||||
);
|
||||
|
||||
// The app.update.url preference is read from the default preferences.
|
||||
let expected = Services.prefs
|
||||
.getDefaultBranch(null)
|
||||
.getCharPref("app.update.url", undefined);
|
||||
let checker = new Checker();
|
||||
let expected = await checker.getUpdateURL();
|
||||
|
||||
equal("https://www.example.com/", expected, "Correct app update URL");
|
||||
});
|
||||
|
@ -3863,6 +3863,13 @@ Checker.prototype = {
|
||||
|
||||
let url = Services.appinfo.updateURL;
|
||||
|
||||
if (Services.policies) {
|
||||
let policies = Services.policies.getActivePolicies();
|
||||
if (policies && "AppUpdateURL" in policies) {
|
||||
url = policies.AppUpdateURL.toString();
|
||||
}
|
||||
}
|
||||
|
||||
if (!url) {
|
||||
LOG("Checker:getUpdateURL - update URL not defined");
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user