diff options
Diffstat (limited to 'browser/components/enterprisepolicies')
16 files changed, 357 insertions, 27 deletions
diff --git a/browser/components/enterprisepolicies/Policies.sys.mjs b/browser/components/enterprisepolicies/Policies.sys.mjs index 41fc89957c..fd15c244cc 100644 --- a/browser/components/enterprisepolicies/Policies.sys.mjs +++ b/browser/components/enterprisepolicies/Policies.sys.mjs @@ -81,23 +81,23 @@ export var Policies = { // Used for cleaning up policies. // Use the same timing that you used for setting up the policy. _cleanup: { - onBeforeAddons(manager) { + onBeforeAddons() { if (Cu.isInAutomation || isXpcshell) { console.log("_cleanup from onBeforeAddons"); clearBlockedAboutPages(); } }, - onProfileAfterChange(manager) { + onProfileAfterChange() { if (Cu.isInAutomation || isXpcshell) { console.log("_cleanup from onProfileAfterChange"); } }, - onBeforeUIStartup(manager) { + onBeforeUIStartup() { if (Cu.isInAutomation || isXpcshell) { console.log("_cleanup from onBeforeUIStartup"); } }, - onAllWindowsRestored(manager) { + onAllWindowsRestored() { if (Cu.isInAutomation || isXpcshell) { console.log("_cleanup from onAllWindowsRestored"); } @@ -112,7 +112,7 @@ export var Policies = { AllowedDomainsForApps: { onBeforeAddons(manager, param) { - Services.obs.addObserver(function (subject, topic, data) { + Services.obs.addObserver(function (subject) { let channel = subject.QueryInterface(Ci.nsIHttpChannel); if (channel.URI.host.endsWith(".google.com")) { channel.setRequestHeader("X-GoogApps-Allowed-Domains", param, true); @@ -540,6 +540,15 @@ export var Policies = { param.DenyUrlRegexList ); } + if ("AgentName" in param) { + setAndLockPref("browser.contentanalysis.agent_name", param.AgentName); + } + if ("ClientSignature" in param) { + setAndLockPref( + "browser.contentanalysis.client_signature", + param.ClientSignature + ); + } let boolPrefs = [ ["IsPerUser", "is_per_user"], ["ShowBlockedResult", "show_blocked_result"], @@ -1802,6 +1811,8 @@ export var Policies = { "places.", "pref.", "print.", + "privacy.userContext.enabled", + "privacy.userContext.ui.enabled", "signon.", "spellchecker.", "toolkit.legacyUserProfileCustomizations.stylesheets", @@ -1981,13 +1992,11 @@ export var Policies = { onBeforeAddons(manager, param) { if (param.Locked) { manager.disallowFeature("changeProxySettings"); - lazy.ProxyPolicies.configureProxySettings(param, setAndLockPref); - } else { - lazy.ProxyPolicies.configureProxySettings( - param, - PoliciesUtils.setDefaultPref - ); } + lazy.ProxyPolicies.configureProxySettings( + param, + PoliciesUtils.setDefaultPref + ); }, }, @@ -2023,6 +2032,13 @@ export var Policies = { setAndLockPref("privacy.clearOnShutdown.sessions", param); setAndLockPref("privacy.clearOnShutdown.siteSettings", param); setAndLockPref("privacy.clearOnShutdown.offlineApps", param); + setAndLockPref( + "privacy.clearOnShutdown_v2.historyFormDataAndDownloads", + param + ); + setAndLockPref("privacy.clearOnShutdown_v2.cookiesAndStorage", param); + setAndLockPref("privacy.clearOnShutdown_v2.cache", param); + setAndLockPref("privacy.clearOnShutdown_v2.siteSettings", param); } else { let locked = true; // Needed to preserve original behavior in perpetuity. @@ -2042,12 +2058,22 @@ export var Policies = { param.Cache, locked ); + PoliciesUtils.setDefaultPref( + "privacy.clearOnShutdown_v2.cache", + param.Cache, + locked + ); } else { PoliciesUtils.setDefaultPref( "privacy.clearOnShutdown.cache", false, lockDefaultPrefs ); + PoliciesUtils.setDefaultPref( + "privacy.clearOnShutdown_v2.cache", + false, + lockDefaultPrefs + ); } if ("Cookies" in param) { PoliciesUtils.setDefaultPref( @@ -2055,12 +2081,26 @@ export var Policies = { param.Cookies, locked ); + + // We set cookiesAndStorage to follow lock and pref + // settings for cookies, and deprecate offlineApps + // and sessions in the new clear on shutdown dialog - Bug 1853996 + PoliciesUtils.setDefaultPref( + "privacy.clearOnShutdown_v2.cookiesAndStorage", + param.Cookies, + locked + ); } else { PoliciesUtils.setDefaultPref( "privacy.clearOnShutdown.cookies", false, lockDefaultPrefs ); + PoliciesUtils.setDefaultPref( + "privacy.clearOnShutdown_v2.cookiesAndStorage", + false, + lockDefaultPrefs + ); } if ("Downloads" in param) { PoliciesUtils.setDefaultPref( @@ -2094,12 +2134,26 @@ export var Policies = { param.History, locked ); + + // We set historyFormDataAndDownloads to follow lock and pref + // settings for history, and deprecate formdata and downloads + // in the new clear on shutdown dialog - Bug 1853996 + PoliciesUtils.setDefaultPref( + "privacy.clearOnShutdown_v2.historyFormDataAndDownloads", + param.History, + locked + ); } else { PoliciesUtils.setDefaultPref( "privacy.clearOnShutdown.history", false, lockDefaultPrefs ); + PoliciesUtils.setDefaultPref( + "privacy.clearOnShutdown_v2.historyFormDataAndDownloads", + false, + lockDefaultPrefs + ); } if ("Sessions" in param) { PoliciesUtils.setDefaultPref( @@ -2120,6 +2174,11 @@ export var Policies = { param.SiteSettings, locked ); + PoliciesUtils.setDefaultPref( + "privacy.clearOnShutdown_v2.siteSettings", + param.SiteSettings, + locked + ); } if ("OfflineApps" in param) { PoliciesUtils.setDefaultPref( @@ -2390,6 +2449,12 @@ export var Policies = { }, }, + TranslateEnabled: { + onBeforeAddons(manager, param) { + setAndLockPref("browser.translations.enable", param); + }, + }, + UserMessaging: { onBeforeAddons(manager, param) { if ("WhatsNew" in param) { @@ -2790,7 +2855,7 @@ function clearBlockedAboutPages() { gBlockedAboutPages = []; } -function blockAboutPage(manager, feature, neededOnContentProcess = false) { +function blockAboutPage(manager, feature) { addChromeURLBlocker(); gBlockedAboutPages.push(feature); @@ -2826,7 +2891,7 @@ let ChromeURLBlockPolicy = { } return Ci.nsIContentPolicy.ACCEPT; }, - shouldProcess(contentLocation, loadInfo) { + shouldProcess() { return Ci.nsIContentPolicy.ACCEPT; }, classDescription: "Policy Engine Content Policy", diff --git a/browser/components/enterprisepolicies/helpers/ProxyPolicies.sys.mjs b/browser/components/enterprisepolicies/helpers/ProxyPolicies.sys.mjs index 393b9bb85e..80968956ac 100644 --- a/browser/components/enterprisepolicies/helpers/ProxyPolicies.sys.mjs +++ b/browser/components/enterprisepolicies/helpers/ProxyPolicies.sys.mjs @@ -29,6 +29,22 @@ export var PROXY_TYPES_MAP = new Map([ ["autoConfig", Ci.nsIProtocolProxyService.PROXYCONFIG_PAC], ]); +let proxyPreferences = [ + "network.proxy.type", + "network.proxy.autoconfig_url", + "network.proxy.socks_remote_dns", + "signon.autologin.proxy", + "network.proxy.socks_version", + "network.proxy.no_proxies_on", + "network.proxy.share_proxy_settings", + "network.proxy.http", + "network.proxy.http_port", + "network.proxy.ssl", + "network.proxy.ssl_port", + "network.proxy.socks", + "network.proxy.socks_port", +]; + export var ProxyPolicies = { configureProxySettings(param, setPref) { if (param.Mode) { @@ -105,5 +121,13 @@ export var ProxyPolicies = { if (param.SOCKSProxy) { setProxyHostAndPort("socks", param.SOCKSProxy); } + + // All preferences should be locked regardless of whether or not a + // specific value was set. + if (param.Locked) { + for (let preference of proxyPreferences) { + Services.prefs.lockPref(preference); + } + } }, }; diff --git a/browser/components/enterprisepolicies/helpers/WebsiteFilter.sys.mjs b/browser/components/enterprisepolicies/helpers/WebsiteFilter.sys.mjs index 81f7955f27..26bae7acd9 100644 --- a/browser/components/enterprisepolicies/helpers/WebsiteFilter.sys.mjs +++ b/browser/components/enterprisepolicies/helpers/WebsiteFilter.sys.mjs @@ -130,10 +130,10 @@ export let WebsiteFilter = { } return Ci.nsIContentPolicy.ACCEPT; }, - shouldProcess(contentLocation, loadInfo) { + shouldProcess() { return Ci.nsIContentPolicy.ACCEPT; }, - observe(subject, topic, data) { + observe(subject) { try { let channel = subject.QueryInterface(Ci.nsIHttpChannel); if ( diff --git a/browser/components/enterprisepolicies/schemas/policies-schema.json b/browser/components/enterprisepolicies/schemas/policies-schema.json index a1ccaed74f..3c578f2c4b 100644 --- a/browser/components/enterprisepolicies/schemas/policies-schema.json +++ b/browser/components/enterprisepolicies/schemas/policies-schema.json @@ -253,6 +253,12 @@ "DenyUrlRegexList": { "type": "string" }, + "AgentName": { + "type": "string" + }, + "ClientSignature": { + "type": "string" + }, "IsPerUser": { "type": "boolean" }, @@ -662,6 +668,9 @@ "items": { "type": "string" } + }, + "temporarily_allow_weak_signatures": { + "type": "boolean" } } } @@ -691,6 +700,9 @@ "default_area": { "type": "string", "enum": ["navbar", "menupanel"] + }, + "temporarily_allow_weak_signatures": { + "type": "boolean" } } } @@ -1422,6 +1434,10 @@ "required": ["Title", "URL"] }, + "TranslateEnabled": { + "type": "boolean" + }, + "UserMessaging": { "type": "object", "properties": { diff --git a/browser/components/enterprisepolicies/tests/browser/browser.toml b/browser/components/enterprisepolicies/tests/browser/browser.toml index 25ac681e5b..0517bb6557 100644 --- a/browser/components/enterprisepolicies/tests/browser/browser.toml +++ b/browser/components/enterprisepolicies/tests/browser/browser.toml @@ -117,6 +117,8 @@ https_first_disabled = true ["browser_policy_support_menu.js"] +["browser_policy_translateenabled.js"] + ["browser_policy_usermessaging.js"] ["browser_policy_websitefilter.js"] diff --git a/browser/components/enterprisepolicies/tests/browser/browser_policy_pageinfo_permissions.js b/browser/components/enterprisepolicies/tests/browser/browser_policy_pageinfo_permissions.js index 4921464782..2fc7892c8f 100644 --- a/browser/components/enterprisepolicies/tests/browser/browser_policy_pageinfo_permissions.js +++ b/browser/components/enterprisepolicies/tests/browser/browser_policy_pageinfo_permissions.js @@ -58,8 +58,8 @@ add_task(async function test_pageinfo_permissions() { "xr", ]; - await BrowserTestUtils.withNewTab(TEST_ORIGIN, async function (browser) { - let pageInfo = BrowserPageInfo(TEST_ORIGIN, "permTab"); + await BrowserTestUtils.withNewTab(TEST_ORIGIN, async function () { + let pageInfo = BrowserCommands.pageInfo(TEST_ORIGIN, "permTab"); await BrowserTestUtils.waitForEvent(pageInfo, "load"); for (let i = 0; i < permissions.length; i++) { diff --git a/browser/components/enterprisepolicies/tests/browser/browser_policy_translateenabled.js b/browser/components/enterprisepolicies/tests/browser/browser_policy_translateenabled.js new file mode 100644 index 0000000000..3658cf6388 --- /dev/null +++ b/browser/components/enterprisepolicies/tests/browser/browser_policy_translateenabled.js @@ -0,0 +1,53 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +add_setup(async function setup() { + await setupPolicyEngineWithJson({ + policies: { + TranslateEnabled: false, + }, + }); +}); + +add_task(async function test_translate_pref_disabled() { + is( + Services.prefs.getBoolPref("browser.translations.enable"), + false, + "The translations pref should be disabled when the enterprise policy is active." + ); +}); + +add_task(async function test_translate_button_disabled() { + // Since testing will apply the policy after the browser has already started, + // we will need to open a new window to actually see changes from the policy + let win = await BrowserTestUtils.openNewBrowserWindow(); + + let appMenuButton = win.document.getElementById("PanelUI-menu-button"); + let viewShown = BrowserTestUtils.waitForEvent( + win.PanelUI.mainView, + "ViewShown" + ); + + appMenuButton.click(); + await viewShown; + + let translateSiteButton = win.document.getElementById( + "appMenu-translate-button" + ); + + is( + translateSiteButton.hidden, + true, + "The app-menu translate button should be hidden when the enterprise policy is active." + ); + + is( + translateSiteButton.disabled, + true, + "The app-menu translate button should be disabled when the enterprise policy is active." + ); + + await BrowserTestUtils.closeWindow(win); +}); diff --git 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 index 2f68436882..929f0470da 100644 --- 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 @@ -96,7 +96,7 @@ function waitForAboutDialog() { var domwindow = aXULWindow.docShell.domWindow; domwindow.addEventListener("load", aboutDialogOnLoad, true); }, - onCloseWindow: aXULWindow => {}, + onCloseWindow: () => {}, }; Services.wm.addListener(listener); diff --git a/browser/components/enterprisepolicies/tests/browser/disable_developer_tools/browser_policy_disable_developer_tools.js b/browser/components/enterprisepolicies/tests/browser/disable_developer_tools/browser_policy_disable_developer_tools.js index 27794aabbb..585218a016 100644 --- a/browser/components/enterprisepolicies/tests/browser/disable_developer_tools/browser_policy_disable_developer_tools.js +++ b/browser/components/enterprisepolicies/tests/browser/disable_developer_tools/browser_policy_disable_developer_tools.js @@ -73,7 +73,7 @@ async function testPageBlockedByPolicy(page, policyJSON) { async browser => { BrowserTestUtils.startLoadingURIString(browser, page); await BrowserTestUtils.browserLoaded(browser, false, page, true); - await SpecialPowers.spawn(browser, [page], async function (innerPage) { + await SpecialPowers.spawn(browser, [page], async function () { ok( content.document.documentURI.startsWith( "about:neterror?e=blockedByPolicy" diff --git a/browser/components/enterprisepolicies/tests/browser/head.js b/browser/components/enterprisepolicies/tests/browser/head.js index bb08173aa9..dfa01fad0e 100644 --- a/browser/components/enterprisepolicies/tests/browser/head.js +++ b/browser/components/enterprisepolicies/tests/browser/head.js @@ -237,7 +237,7 @@ async function testPageBlockedByPolicy(page, policyJSON) { async browser => { BrowserTestUtils.startLoadingURIString(browser, page); await BrowserTestUtils.browserLoaded(browser, false, page, true); - await SpecialPowers.spawn(browser, [page], async function (innerPage) { + await SpecialPowers.spawn(browser, [page], async function () { ok( content.document.documentURI.startsWith( "about:neterror?e=blockedByPolicy" diff --git a/browser/components/enterprisepolicies/tests/xpcshell/head.js b/browser/components/enterprisepolicies/tests/xpcshell/head.js index 8b81261538..3881760ed4 100644 --- a/browser/components/enterprisepolicies/tests/xpcshell/head.js +++ b/browser/components/enterprisepolicies/tests/xpcshell/head.js @@ -116,7 +116,7 @@ function checkUserPref(prefName, prefValue) { ); } -function checkClearPref(prefName, prefValue) { +function checkClearPref(prefName) { equal( Services.prefs.prefHasUserValue(prefName), false, diff --git a/browser/components/enterprisepolicies/tests/xpcshell/test_extensionsettings.js b/browser/components/enterprisepolicies/tests/xpcshell/test_extensionsettings.js index ee329a65f8..22a6269cce 100644 --- a/browser/components/enterprisepolicies/tests/xpcshell/test_extensionsettings.js +++ b/browser/components/enterprisepolicies/tests/xpcshell/test_extensionsettings.js @@ -21,7 +21,7 @@ let themeID = "policytheme@mozilla.com"; let fileURL; -add_task(async function setup() { +add_setup(async function setup() { await AddonTestUtils.promiseStartupManager(); let webExtensionFile = AddonTestUtils.createTempWebExtensionFile({ @@ -34,6 +34,10 @@ add_task(async function setup() { }, }); + server.registerFile( + "/data/amosigned-sha1only.xpi", + do_get_file("amosigned-sha1only.xpi") + ); server.registerFile("/data/policy_test.xpi", webExtensionFile); fileURL = Services.io .newFileURI(webExtensionFile) @@ -289,3 +293,112 @@ add_task(async function test_addon_normalinstalled_file() { await addon.uninstall(); }); + +add_task(async function test_allow_weak_signatures() { + // Make sure weak signatures are restricted. + const resetWeakSignaturePref = + AddonTestUtils.setWeakSignatureInstallAllowed(false); + + const id = "amosigned-xpi@tests.mozilla.org"; + const perAddonSettings = { + installation_mode: "normal_installed", + install_url: BASE_URL + "/amosigned-sha1only.xpi", + }; + + info( + "Sanity check: expect install to fail if not allowed through enterprise policy settings" + ); + await Promise.all([ + AddonTestUtils.promiseInstallEvent("onDownloadFailed"), + setupPolicyEngineWithJson({ + policies: { + ExtensionSettings: { + [id]: { ...perAddonSettings }, + }, + }, + }), + ]); + let addon = await AddonManager.getAddonByID(id); + equal(addon, null, "Add-on not installed"); + + info( + "Expect install to be allowed through per-addon enterprise policy settings" + ); + await Promise.all([ + AddonTestUtils.promiseInstallEvent("onInstallEnded"), + setupPolicyEngineWithJson({ + policies: { + ExtensionSettings: { + [id]: { + ...perAddonSettings, + temporarily_allow_weak_signatures: true, + }, + }, + }, + }), + ]); + addon = await AddonManager.getAddonByID(id); + notEqual(addon, null, "Add-on not installed"); + await addon.uninstall(); + + info( + "Expect install to be allowed through global enterprise policy settings" + ); + await Promise.all([ + AddonTestUtils.promiseInstallEvent("onInstallEnded"), + setupPolicyEngineWithJson({ + policies: { + ExtensionSettings: { + "*": { temporarily_allow_weak_signatures: true }, + [id]: { ...perAddonSettings }, + }, + }, + }), + ]); + addon = await AddonManager.getAddonByID(id); + notEqual(addon, null, "Add-on installed"); + await addon.uninstall(); + + info( + "Expect install to fail if allowed globally but disallowed by per-addon settings" + ); + await Promise.all([ + AddonTestUtils.promiseInstallEvent("onDownloadFailed"), + setupPolicyEngineWithJson({ + policies: { + ExtensionSettings: { + "*": { temporarily_allow_weak_signatures: true }, + [id]: { + ...perAddonSettings, + temporarily_allow_weak_signatures: false, + }, + }, + }, + }), + ]); + addon = await AddonManager.getAddonByID(id); + equal(addon, null, "Add-on not installed"); + + info( + "Expect install to be allowed through per addon setting when globally disallowed" + ); + await Promise.all([ + AddonTestUtils.promiseInstallEvent("onInstallEnded"), + setupPolicyEngineWithJson({ + policies: { + ExtensionSettings: { + "*": { temporarily_allow_weak_signatures: false }, + [id]: { + ...perAddonSettings, + temporarily_allow_weak_signatures: true, + }, + }, + }, + }), + ]); + addon = await AddonManager.getAddonByID(id); + notEqual(addon, null, "Add-on installed"); + await addon.uninstall(); + + resetWeakSignaturePref(); +}); diff --git a/browser/components/enterprisepolicies/tests/xpcshell/test_requestedlocales.js b/browser/components/enterprisepolicies/tests/xpcshell/test_requestedlocales.js index 5908b2d35c..bfed2491be 100644 --- a/browser/components/enterprisepolicies/tests/xpcshell/test_requestedlocales.js +++ b/browser/components/enterprisepolicies/tests/xpcshell/test_requestedlocales.js @@ -12,7 +12,7 @@ const REQ_LOC_CHANGE_EVENT = "intl:requested-locales-changed"; function promiseLocaleChanged(requestedLocale) { return new Promise(resolve => { let localeObserver = { - observe(aSubject, aTopic, aData) { + observe(aSubject, aTopic) { switch (aTopic) { case REQ_LOC_CHANGE_EVENT: let reqLocs = Services.locale.requestedLocales; @@ -26,10 +26,10 @@ function promiseLocaleChanged(requestedLocale) { }); } -function promiseLocaleNotChanged(requestedLocale) { +function promiseLocaleNotChanged() { return new Promise(resolve => { let localeObserver = { - observe(aSubject, aTopic, aData) { + observe(aSubject, aTopic) { switch (aTopic) { case REQ_LOC_CHANGE_EVENT: ok(false, "Locale should not change."); diff --git a/browser/components/enterprisepolicies/tests/xpcshell/test_simple_pref_policies.js b/browser/components/enterprisepolicies/tests/xpcshell/test_simple_pref_policies.js index 82caee16a7..c0952d0627 100644 --- a/browser/components/enterprisepolicies/tests/xpcshell/test_simple_pref_policies.js +++ b/browser/components/enterprisepolicies/tests/xpcshell/test_simple_pref_policies.js @@ -227,6 +227,10 @@ const POLICIES_TESTS = [ "privacy.clearOnShutdown.sessions": true, "privacy.clearOnShutdown.siteSettings": true, "privacy.clearOnShutdown.offlineApps": true, + "privacy.clearOnShutdown_v2.historyFormDataAndDownloads": true, + "privacy.clearOnShutdown_v2.cookiesAndStorage": true, + "privacy.clearOnShutdown_v2.cache": true, + "privacy.clearOnShutdown_v2.siteSettings": true, }, }, @@ -244,6 +248,10 @@ const POLICIES_TESTS = [ "privacy.clearOnShutdown.sessions": false, "privacy.clearOnShutdown.siteSettings": false, "privacy.clearOnShutdown.offlineApps": false, + "privacy.clearOnShutdown_v2.historyFormDataAndDownloads": false, + "privacy.clearOnShutdown_v2.cookiesAndStorage": false, + "privacy.clearOnShutdown_v2.cache": false, + "privacy.clearOnShutdown_v2.siteSettings": false, }, }, @@ -261,6 +269,9 @@ const POLICIES_TESTS = [ "privacy.clearOnShutdown.formdata": false, "privacy.clearOnShutdown.history": false, "privacy.clearOnShutdown.sessions": false, + "privacy.clearOnShutdown_v2.historyFormDataAndDownloads": false, + "privacy.clearOnShutdown_v2.cookiesAndStorage": false, + "privacy.clearOnShutdown_v2.cache": true, }, }, @@ -278,6 +289,9 @@ const POLICIES_TESTS = [ "privacy.clearOnShutdown.formdata": false, "privacy.clearOnShutdown.history": false, "privacy.clearOnShutdown.sessions": false, + "privacy.clearOnShutdown_v2.historyFormDataAndDownloads": false, + "privacy.clearOnShutdown_v2.cookiesAndStorage": true, + "privacy.clearOnShutdown_v2.cache": false, }, }, @@ -295,6 +309,9 @@ const POLICIES_TESTS = [ "privacy.clearOnShutdown.formdata": false, "privacy.clearOnShutdown.history": false, "privacy.clearOnShutdown.sessions": false, + "privacy.clearOnShutdown_v2.historyFormDataAndDownloads": false, + "privacy.clearOnShutdown_v2.cookiesAndStorage": false, + "privacy.clearOnShutdown_v2.cache": false, }, }, @@ -312,6 +329,9 @@ const POLICIES_TESTS = [ "privacy.clearOnShutdown.formdata": true, "privacy.clearOnShutdown.history": false, "privacy.clearOnShutdown.sessions": false, + "privacy.clearOnShutdown_v2.historyFormDataAndDownloads": false, + "privacy.clearOnShutdown_v2.cookiesAndStorage": false, + "privacy.clearOnShutdown_v2.cache": false, }, }, @@ -329,6 +349,9 @@ const POLICIES_TESTS = [ "privacy.clearOnShutdown.formdata": false, "privacy.clearOnShutdown.history": true, "privacy.clearOnShutdown.sessions": false, + "privacy.clearOnShutdown_v2.historyFormDataAndDownloads": true, + "privacy.clearOnShutdown_v2.cookiesAndStorage": false, + "privacy.clearOnShutdown_v2.cache": false, }, }, @@ -346,6 +369,9 @@ const POLICIES_TESTS = [ "privacy.clearOnShutdown.formdata": false, "privacy.clearOnShutdown.history": false, "privacy.clearOnShutdown.sessions": true, + "privacy.clearOnShutdown_v2.historyFormDataAndDownloads": false, + "privacy.clearOnShutdown_v2.cookiesAndStorage": false, + "privacy.clearOnShutdown_v2.cache": false, }, }, @@ -364,6 +390,10 @@ const POLICIES_TESTS = [ "privacy.clearOnShutdown.history": false, "privacy.clearOnShutdown.sessions": false, "privacy.clearOnShutdown.siteSettings": true, + "privacy.clearOnShutdown_v2.historyFormDataAndDownloads": false, + "privacy.clearOnShutdown_v2.cookiesAndStorage": false, + "privacy.clearOnShutdown_v2.cache": false, + "privacy.clearOnShutdown_v2.siteSettings": true, }, }, @@ -382,6 +412,9 @@ const POLICIES_TESTS = [ "privacy.clearOnShutdown.history": false, "privacy.clearOnShutdown.sessions": false, "privacy.clearOnShutdown.offlineApps": true, + "privacy.clearOnShutdown_v2.historyFormDataAndDownloads": false, + "privacy.clearOnShutdown_v2.cookiesAndStorage": false, + "privacy.clearOnShutdown_v2.cache": false, }, }, @@ -396,6 +429,7 @@ const POLICIES_TESTS = [ lockedPrefs: { "privacy.sanitize.sanitizeOnShutdown": true, "privacy.clearOnShutdown.cache": true, + "privacy.clearOnShutdown_v2.cache": true, }, unlockedPrefs: { "privacy.clearOnShutdown.cookies": false, @@ -403,6 +437,8 @@ const POLICIES_TESTS = [ "privacy.clearOnShutdown.formdata": false, "privacy.clearOnShutdown.history": false, "privacy.clearOnShutdown.sessions": false, + "privacy.clearOnShutdown_v2.historyFormDataAndDownloads": false, + "privacy.clearOnShutdown_v2.cookiesAndStorage": false, }, }, @@ -418,12 +454,15 @@ const POLICIES_TESTS = [ "privacy.sanitize.sanitizeOnShutdown": true, "privacy.clearOnShutdown.cache": true, "privacy.clearOnShutdown.cookies": false, + "privacy.clearOnShutdown_v2.cache": true, + "privacy.clearOnShutdown_v2.cookiesAndStorage": false, }, unlockedPrefs: { "privacy.clearOnShutdown.downloads": false, "privacy.clearOnShutdown.formdata": false, "privacy.clearOnShutdown.history": false, "privacy.clearOnShutdown.sessions": false, + "privacy.clearOnShutdown_v2.historyFormDataAndDownloads": false, }, }, @@ -442,6 +481,9 @@ const POLICIES_TESTS = [ "privacy.clearOnShutdown.formdata": false, "privacy.clearOnShutdown.history": false, "privacy.clearOnShutdown.sessions": false, + "privacy.clearOnShutdown_v2.historyFormDataAndDownloads": false, + "privacy.clearOnShutdown_v2.cookiesAndStorage": false, + "privacy.clearOnShutdown_v2.cache": true, }, }, @@ -1045,6 +1087,18 @@ const POLICIES_TESTS = [ "extensions.formautofill.creditCards.enabled": false, }, }, + + // POLICY: Proxy - locking if no values are set + { + policies: { + Proxy: { + Locked: true, + }, + }, + lockedPrefs: { + "network.proxy.type": 5, + }, + }, ]; add_task(async function test_policy_simple_prefs() { diff --git a/browser/components/enterprisepolicies/tests/xpcshell/test_sorted_alphabetically.js b/browser/components/enterprisepolicies/tests/xpcshell/test_sorted_alphabetically.js index 0d246c850c..73755b1dbc 100644 --- a/browser/components/enterprisepolicies/tests/xpcshell/test_sorted_alphabetically.js +++ b/browser/components/enterprisepolicies/tests/xpcshell/test_sorted_alphabetically.js @@ -32,7 +32,7 @@ add_task(async function test_policies_sorted() { ); checkArrayIsSorted( Object.keys(Policies), - "Policies.jsm is alphabetically sorted." + "Policies.sys.mjs is alphabetically sorted." ); }); diff --git a/browser/components/enterprisepolicies/tests/xpcshell/xpcshell.toml b/browser/components/enterprisepolicies/tests/xpcshell/xpcshell.toml index 69dd3e5103..b21e0f9022 100644 --- a/browser/components/enterprisepolicies/tests/xpcshell/xpcshell.toml +++ b/browser/components/enterprisepolicies/tests/xpcshell/xpcshell.toml @@ -2,7 +2,10 @@ skip-if = ["os == 'android'"] # bug 1730213 firefox-appdir = "browser" head = "head.js" -support-files = ["policytest_v0.1.xpi"] +support-files = [ + "policytest_v0.1.xpi", + "../../../../../toolkit/mozapps/extensions/test/xpinstall/amosigned-sha1only.xpi" +] ["test_3rdparty.js"] |