Backed out changeset 3fdff178b58d (bug 1558898) for multiple failure on browser_private_clicktoplay.js

--HG--
extra : rebase_source : ff00939691ce9b4466b4f9c5781fa22b16600ed4
This commit is contained in:
Oana Pop Rus 2019-06-27 14:29:44 +03:00
parent ca7c3716eb
commit a89dd5c308
2 changed files with 23 additions and 17 deletions

View File

@ -156,7 +156,7 @@ var gPluginHandler = {
case "block":
permission = Ci.nsIPermissionManager.PROMPT_ACTION;
expireType = Ci.nsIPermissionManager.EXPIRE_SESSION;
expireType = Ci.nsIPermissionManager.EXPIRE_NEVER;
expireTime = 0;
histogram.add(2);
switch (aPluginInfo.blocklistState) {
@ -259,6 +259,8 @@ var gPluginHandler = {
if (plugins.length == 1) {
let pluginInfo = plugins[0];
let isWindowPrivate = PrivateBrowsingUtils.isWindowPrivate(window);
let active = pluginInfo.fallbackType == Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE;
let options = {
@ -306,21 +308,25 @@ var gPluginHandler = {
accessKey: gNavigatorBundle.getString("flashActivate.allow.accesskey"),
dismiss: true,
};
let secondaryActions = [{
callback: () => {
let browserRef = weakBrowser.get();
if (browserRef) {
if (pluginInfo.fallbackType == Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE) {
this._updatePluginPermission(browserRef, pluginInfo, "block");
} else {
this._updatePluginPermission(browserRef, pluginInfo, "continueblocking");
let secondaryActions = null;
if (!isWindowPrivate) {
secondaryActions = [{
callback: () => {
let browserRef = weakBrowser.get();
if (browserRef) {
if (pluginInfo.fallbackType == Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE) {
this._updatePluginPermission(browserRef, pluginInfo, "block");
} else {
this._updatePluginPermission(browserRef, pluginInfo, "continueblocking");
}
}
}
},
label: gNavigatorBundle.getString("flashActivate.noAllow"),
accessKey: gNavigatorBundle.getString("flashActivate.noAllow.accesskey"),
dismiss: true,
}];
},
label: gNavigatorBundle.getString("flashActivate.noAllow"),
accessKey: gNavigatorBundle.getString("flashActivate.noAllow.accesskey"),
dismiss: true,
}];
}
PopupNotifications.show(browser, "click-to-play-plugins",
description, "plugins-notification-icon",

View File

@ -125,8 +125,8 @@ add_task(async function test2c() {
"Shown");
popupNotification.reshow();
await promiseShown;
is(gPrivateWindow.PopupNotifications.panel.firstElementChild.secondaryButton.hidden, false,
"Test 2c, Activated plugin in a private window should have visible 'Block' button.");
is(gPrivateWindow.PopupNotifications.panel.firstElementChild.secondaryButton.hidden, true,
"Test 2c, Activated plugin in a private window should not have visible 'Block' button.");
is(gPrivateWindow.PopupNotifications.panel.firstElementChild.checkbox.hidden, true,
"Test 2c, Activated plugin in a private window should not have visible 'Remember' checkbox.");