Commit 80ca203b authored by Gijs Kruitbosch's avatar Gijs Kruitbosch
Browse files

Bug 1519434 - make Flash 'always allow' enterprise policy mean 'ask', r=mkaply

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

--HG--
extra : moz-landing-system : lando
parent c4f72aca
......@@ -696,13 +696,10 @@ var Policies = {
const FLASH_NEVER_ACTIVATE = 0;
const FLASH_ASK_TO_ACTIVATE = 1;
const FLASH_ALWAYS_ACTIVATE = 2;
let flashPrefVal;
if (param.Default === undefined) {
if (param.Default === undefined || param.Default) {
flashPrefVal = FLASH_ASK_TO_ACTIVATE;
} else if (param.Default) {
flashPrefVal = FLASH_ALWAYS_ACTIVATE;
} else {
flashPrefVal = FLASH_NEVER_ACTIVATE;
}
......
......@@ -2,7 +2,6 @@
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const labelTextAlwaysActivate = "Always Activate";
const labelTextAskToActivate = "Ask to Activate";
const labelTextNeverActivate = "Never Activate";
......@@ -29,8 +28,10 @@ async function assert_flash_locked_status(win, locked, expectedLabelText) {
// are expected to be disabled if locked is true.
for (const item of pluginOptions.querySelectorAll("panel-item")) {
const actionName = item.getAttribute("action");
if (!item.hasAttribute("checked") && actionName !== "expand" &&
actionName !== "preferences") {
if (actionName.includes("always")) {
ok(item.hidden, `Plugin action "${actionName}" should be hidden.`);
} else if (!item.hasAttribute("checked") && actionName !== "expand" &&
actionName !== "preferences") {
is(item.shadowRoot.querySelector("button").disabled, locked,
`Plugin action "${actionName}" should be ${locked ? "disabled" : "enabled"}`);
}
......@@ -71,7 +72,7 @@ add_task(async function test_enabled() {
});
const testCase = () => test_flash_status({
expectedLabelText: labelTextAlwaysActivate,
expectedLabelText: labelTextAskToActivate,
locked: false,
});
await testOnAboutAddonsType("XUL", testCase);
......@@ -91,7 +92,7 @@ add_task(async function test_enabled_locked() {
});
const testCase = () => test_flash_status({
expectedLabelText: labelTextAlwaysActivate,
expectedLabelText: labelTextAskToActivate,
locked: true,
});
await testOnAboutAddonsType("XUL", testCase);
......
Markdown is supported
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