Bug 1420514 - Replace app.update.enabled with app.update.disabledForTesting in enterprise policy tests
MozReview-Commit-ID: HfPvQjmZ7mo
--- a/browser/components/enterprisepolicies/tests/browser/browser_policy_app_update.js
+++ b/browser/components/enterprisepolicies/tests/browser/browser_policy_app_update.js
@@ -6,14 +6,16 @@ var updateService = Cc["@mozilla.org/upd
getService(Ci.nsIApplicationUpdateService);
// This test is intended to ensure that nsIUpdateService::canCheckForUpdates
// is true before the "DisableAppUpdate" policy is applied. Testing that
// nsIUpdateService::canCheckForUpdates is false after the "DisableAppUpdate"
// policy is applied needs to occur in a different test since the policy does
// not properly take effect unless it is applied during application startup.
add_task(async function test_updates_pre_policy() {
+ await SpecialPowers.pushPrefEnv({"set": [["app.update.disabledForTesting", false]]});
+
is(Services.policies.isAllowed("appUpdate"), true,
"Since no policies have been set, appUpdate should be allowed by default");
is(updateService.canCheckForUpdates, true,
"Should be able to check for updates before any policies are in effect.");
});
--- a/browser/components/enterprisepolicies/tests/browser/disable_app_update/browser.ini
+++ b/browser/components/enterprisepolicies/tests/browser/disable_app_update/browser.ini
@@ -1,9 +1,9 @@
[DEFAULT]
prefs =
- app.update.enabled=true
+ app.update.disabledForTesting=false
app.update.auto=true
browser.policies.alternatePath='<test-root>/browser/components/enterprisepolicies/tests/browser/disable_app_update/config_disable_app_update.json'
support-files =
config_disable_app_update.json
[browser_policy_disable_app_update.js]
--- a/browser/components/enterprisepolicies/tests/browser/disable_app_update/browser_policy_disable_app_update.js
+++ b/browser/components/enterprisepolicies/tests/browser/disable_app_update/browser_policy_disable_app_update.js
@@ -13,16 +13,14 @@ add_task(async function test_updates_pos
"Should not be able to check for updates with DisableAppUpdate enabled.");
});
add_task(async function test_update_preferences_ui() {
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:preferences");
await ContentTask.spawn(tab.linkedBrowser, null, async function() {
let updateRadioGroup = content.document.getElementById("updateRadioGroup");
- is(updateRadioGroup.disabled, true,
+ is(updateRadioGroup.hidden, true,
"Update choices should be diabled when app update is locked by policy");
- is(updateRadioGroup.value, "manual",
- "Update choice should be set to \"manual\" when app update is disabled by policy");
});
BrowserTestUtils.removeTab(tab);
});