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
This commit is contained in:
Gijs Kruitbosch 2019-06-13 08:42:51 +00:00
parent d48b3702d3
commit 3db5095b08
2 changed files with 7 additions and 9 deletions

View File

@ -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;
}

View File

@ -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);