Commit f66f9762 authored by Andreea Pavel's avatar Andreea Pavel
Browse files

Backed out 7 changesets (bug 1519434) for mochiest failures e.g...

Backed out 7 changesets (bug 1519434) for mochiest failures e.g test_bug1165981.html on a CLOSED TREE

Backed out changeset 1314623831ad (bug 1519434)
Backed out changeset 6dd4fa67e209 (bug 1519434)
Backed out changeset b241c580b293 (bug 1519434)
Backed out changeset b48dca2f487f (bug 1519434)
Backed out changeset 49c64ed2e67b (bug 1519434)
Backed out changeset dd009a001c6c (bug 1519434)
Backed out changeset 5b6ec4d2f0ab (bug 1519434)
parent 37b6282d
...@@ -706,6 +706,7 @@ pref("accessibility.typeaheadfind.flashBar", 1); ...@@ -706,6 +706,7 @@ pref("accessibility.typeaheadfind.flashBar", 1);
pref("accessibility.support.url", "https://support.mozilla.org/%LOCALE%/kb/accessibility-services"); pref("accessibility.support.url", "https://support.mozilla.org/%LOCALE%/kb/accessibility-services");
pref("accessibility.indicator.enabled", false); pref("accessibility.indicator.enabled", false);
pref("plugins.click_to_play", true);
pref("plugins.testmode", false); pref("plugins.testmode", false);
// Should plugins that are hidden show the infobar UI? // Should plugins that are hidden show the infobar UI?
......
...@@ -126,11 +126,7 @@ var gPluginHandler = { ...@@ -126,11 +126,7 @@ var gPluginHandler = {
/** /**
* Called from the plugin doorhanger to set the new permissions for a plugin * Called from the plugin doorhanger to set the new permissions for a plugin
* and activate plugins if necessary. * and activate plugins if necessary.
* aNewState should be one of: * aNewState should be either "allownow" "allowalways" or "block"
* - "allownow"
* - "block"
* - "continue"
* - "continueblocking"
*/ */
_updatePluginPermission(aBrowser, aPluginInfo, aNewState) { _updatePluginPermission(aBrowser, aPluginInfo, aNewState) {
let permission; let permission;
...@@ -154,6 +150,16 @@ var gPluginHandler = { ...@@ -154,6 +150,16 @@ var gPluginHandler = {
notification.options.extraAttr = "active"; notification.options.extraAttr = "active";
break; break;
case "allowalways":
permission = Ci.nsIPermissionManager.ALLOW_ACTION;
expireType = Ci.nsIPermissionManager.EXPIRE_TIME;
expireTime = Date.now() +
Services.prefs.getIntPref(this.PREF_PERSISTENT_DAYS) * 24 * 60 * 60 * 1000;
histogram.add(1);
aPluginInfo.fallbackType = Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE;
notification.options.extraAttr = "active";
break;
case "block": case "block":
permission = Ci.nsIPermissionManager.PROMPT_ACTION; permission = Ci.nsIPermissionManager.PROMPT_ACTION;
expireType = Ci.nsIPermissionManager.EXPIRE_NEVER; expireType = Ci.nsIPermissionManager.EXPIRE_NEVER;
...@@ -174,6 +180,15 @@ var gPluginHandler = { ...@@ -174,6 +180,15 @@ var gPluginHandler = {
notification.options.extraAttr = "inactive"; notification.options.extraAttr = "inactive";
break; break;
case "blockalways":
permission = Ci.nsIObjectLoadingContent.PLUGIN_PERMISSION_PROMPT_ACTION_QUIET;
expireType = Ci.nsIPermissionManager.EXPIRE_NEVER;
expireTime = 0;
histogram.add(3);
aPluginInfo.fallbackType = Ci.nsIObjectLoadingContent.PLUGIN_CLICK_TO_PLAY_QUIET;
notification.options.extraAttr = "inactive";
break;
// In case a plugin has already been allowed/disallowed in another tab, the // In case a plugin has already been allowed/disallowed in another tab, the
// buttons matching the existing block state shouldn't change any permissions // buttons matching the existing block state shouldn't change any permissions
// but should run the plugin-enablement code below. // but should run the plugin-enablement code below.
...@@ -294,10 +309,12 @@ var gPluginHandler = { ...@@ -294,10 +309,12 @@ var gPluginHandler = {
let weakBrowser = Cu.getWeakReference(browser); let weakBrowser = Cu.getWeakReference(browser);
let mainAction = { let mainAction = {
callback: () => { callback: ({checkboxChecked}) => {
let browserRef = weakBrowser.get(); let browserRef = weakBrowser.get();
if (browserRef) { if (browserRef) {
if (pluginInfo.fallbackType == Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE) { if (checkboxChecked) {
this._updatePluginPermission(browserRef, pluginInfo, "allowalways");
} else if (pluginInfo.fallbackType == Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE) {
this._updatePluginPermission(browserRef, pluginInfo, "continue"); this._updatePluginPermission(browserRef, pluginInfo, "continue");
} else { } else {
this._updatePluginPermission(browserRef, pluginInfo, "allownow"); this._updatePluginPermission(browserRef, pluginInfo, "allownow");
...@@ -311,11 +328,16 @@ var gPluginHandler = { ...@@ -311,11 +328,16 @@ var gPluginHandler = {
let secondaryActions = null; let secondaryActions = null;
if (!isWindowPrivate) { if (!isWindowPrivate) {
options.checkbox = {
label: gNavigatorBundle.getString("flashActivate.remember"),
};
secondaryActions = [{ secondaryActions = [{
callback: () => { callback: ({checkboxChecked}) => {
let browserRef = weakBrowser.get(); let browserRef = weakBrowser.get();
if (browserRef) { if (browserRef) {
if (pluginInfo.fallbackType == Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE) { if (checkboxChecked) {
this._updatePluginPermission(browserRef, pluginInfo, "blockalways");
} else if (pluginInfo.fallbackType == Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE) {
this._updatePluginPermission(browserRef, pluginInfo, "block"); this._updatePluginPermission(browserRef, pluginInfo, "block");
} else { } else {
this._updatePluginPermission(browserRef, pluginInfo, "continueblocking"); this._updatePluginPermission(browserRef, pluginInfo, "continueblocking");
......
...@@ -1081,7 +1081,12 @@ var gIdentityHandler = { ...@@ -1081,7 +1081,12 @@ var gIdentityHandler = {
container.setAttribute("role", "group"); container.setAttribute("role", "group");
let img = document.createXULElement("image"); let img = document.createXULElement("image");
img.classList.add("identity-popup-permission-icon", aPermission.id + "-icon"); img.classList.add("identity-popup-permission-icon");
if (aPermission.id == "plugin:flash") {
img.classList.add("plugin-icon");
} else {
img.classList.add(aPermission.id + "-icon");
}
if (aPermission.state == SitePermissions.BLOCK) if (aPermission.state == SitePermissions.BLOCK)
img.classList.add("blocked-permission-icon"); img.classList.add("blocked-permission-icon");
......
...@@ -885,6 +885,8 @@ ...@@ -885,6 +885,8 @@
tooltiptext="&urlbar.autoplayMediaBlocked.tooltip;"/> tooltiptext="&urlbar.autoplayMediaBlocked.tooltip;"/>
<image data-permission-id="canvas" class="blocked-permission-icon canvas-icon" role="button" <image data-permission-id="canvas" class="blocked-permission-icon canvas-icon" role="button"
tooltiptext="&urlbar.canvasBlocked.tooltip;"/> tooltiptext="&urlbar.canvasBlocked.tooltip;"/>
<image data-permission-id="plugin:flash" class="blocked-permission-icon plugin-icon" role="button"
tooltiptext="&urlbar.flashPluginBlocked.tooltip;"/>
<image data-permission-id="midi" class="blocked-permission-icon midi-icon" role="button" <image data-permission-id="midi" class="blocked-permission-icon midi-icon" role="button"
tooltiptext="&urlbar.midiBlocked.tooltip;"/> tooltiptext="&urlbar.midiBlocked.tooltip;"/>
<image data-permission-id="install" class="blocked-permission-icon install-icon" role="button" <image data-permission-id="install" class="blocked-permission-icon install-icon" role="button"
......
...@@ -85,6 +85,11 @@ function initRow(aPartId) { ...@@ -85,6 +85,11 @@ function initRow(aPartId) {
return; return;
} }
// When flash permission state is "Hide", we show it as "Always Ask" in page info.
if (aPartId.startsWith("plugin") && state == SitePermissions.PROMPT_HIDE) {
defaultState == SitePermissions.UNKNOWN ? state = defaultState : state = SitePermissions.PROMPT;
}
if (state != defaultState) { if (state != defaultState) {
checkbox.checked = false; checkbox.checked = false;
command.removeAttribute("disabled"); command.removeAttribute("disabled");
......
...@@ -1038,6 +1038,7 @@ add_task(async function test_click_to_play_blocked_plugin() { ...@@ -1038,6 +1038,7 @@ add_task(async function test_click_to_play_blocked_plugin() {
{ {
maybeScreenshotsPresent: true, maybeScreenshotsPresent: true,
preCheckContextMenuFn() { preCheckContextMenuFn() {
pushPrefs(["plugins.click_to_play", true]);
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY);
}, },
postCheckContextMenuFn() { postCheckContextMenuFn() {
......
...@@ -6,6 +6,7 @@ add_task(async function() { ...@@ -6,6 +6,7 @@ add_task(async function() {
clearAllPluginPermissions(); clearAllPluginPermissions();
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
Services.prefs.clearUserPref("plugins.click_to_play");
Services.prefs.clearUserPref("extensions.blocklist.suppressUI"); Services.prefs.clearUserPref("extensions.blocklist.suppressUI");
gBrowser.removeCurrentTab(); gBrowser.removeCurrentTab();
window.focus(); window.focus();
...@@ -18,6 +19,7 @@ add_task(async function() { ...@@ -18,6 +19,7 @@ add_task(async function() {
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
Services.prefs.setBoolPref("plugins.click_to_play", true);
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
let bindingPromise = BrowserTestUtils.waitForContentEvent(gBrowser.selectedBrowser, "PluginBindingAttached", true, null, true); let bindingPromise = BrowserTestUtils.waitForContentEvent(gBrowser.selectedBrowser, "PluginBindingAttached", true, null, true);
await promiseTabLoadEvent(gBrowser.selectedTab, gTestRoot + "plugin_test.html"); await promiseTabLoadEvent(gBrowser.selectedTab, gTestRoot + "plugin_test.html");
......
...@@ -41,6 +41,7 @@ add_task(async function setup() { ...@@ -41,6 +41,7 @@ add_task(async function setup() {
env.set("MOZ_CRASHREPORTER_NO_REPORT", ""); env.set("MOZ_CRASHREPORTER_NO_REPORT", "");
env.set("MOZ_CRASHREPORTER_URL", SERVER_URL); env.set("MOZ_CRASHREPORTER_URL", SERVER_URL);
Services.prefs.setBoolPref("plugins.click_to_play", true);
Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true); Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
registerCleanupFunction(function cleanUp() { registerCleanupFunction(function cleanUp() {
...@@ -48,6 +49,7 @@ add_task(async function setup() { ...@@ -48,6 +49,7 @@ add_task(async function setup() {
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
env.set("MOZ_CRASHREPORTER_NO_REPORT", noReport); env.set("MOZ_CRASHREPORTER_NO_REPORT", noReport);
env.set("MOZ_CRASHREPORTER_URL", serverURL); env.set("MOZ_CRASHREPORTER_URL", serverURL);
Services.prefs.clearUserPref("plugins.click_to_play");
Services.prefs.clearUserPref("extensions.blocklist.suppressUI"); Services.prefs.clearUserPref("extensions.blocklist.suppressUI");
window.focus(); window.focus();
}); });
......
...@@ -6,6 +6,7 @@ add_task(async function() { ...@@ -6,6 +6,7 @@ add_task(async function() {
clearAllPluginPermissions(); clearAllPluginPermissions();
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
Services.prefs.clearUserPref("plugins.click_to_play");
Services.prefs.clearUserPref("extensions.blocklist.suppressUI"); Services.prefs.clearUserPref("extensions.blocklist.suppressUI");
gNewWindow.close(); gNewWindow.close();
await BrowserTestUtils.waitForEvent(gNewWindow, "unload", true); await BrowserTestUtils.waitForEvent(gNewWindow, "unload", true);
...@@ -15,6 +16,7 @@ add_task(async function() { ...@@ -15,6 +16,7 @@ add_task(async function() {
}); });
add_task(async function() { add_task(async function() {
Services.prefs.setBoolPref("plugins.click_to_play", true);
Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true); Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
......
...@@ -7,6 +7,7 @@ add_task(async function() { ...@@ -7,6 +7,7 @@ add_task(async function() {
clearAllPluginPermissions(); clearAllPluginPermissions();
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
Services.prefs.clearUserPref("plugins.click_to_play");
Services.prefs.clearUserPref("extensions.blocklist.suppressUI"); Services.prefs.clearUserPref("extensions.blocklist.suppressUI");
gBrowser.removeCurrentTab(); gBrowser.removeCurrentTab();
window.focus(); window.focus();
...@@ -18,6 +19,8 @@ add_task(async function() { ...@@ -18,6 +19,8 @@ add_task(async function() {
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
Services.prefs.setBoolPref("plugins.click_to_play", true);
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Second Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Second Test Plug-in");
......
...@@ -6,6 +6,7 @@ add_task(async function() { ...@@ -6,6 +6,7 @@ add_task(async function() {
clearAllPluginPermissions(); clearAllPluginPermissions();
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
Services.prefs.clearUserPref("plugins.click_to_play");
Services.prefs.clearUserPref("extensions.blocklist.suppressUI"); Services.prefs.clearUserPref("extensions.blocklist.suppressUI");
gBrowser.removeCurrentTab(); gBrowser.removeCurrentTab();
window.focus(); window.focus();
...@@ -17,6 +18,7 @@ add_task(async function() { ...@@ -17,6 +18,7 @@ add_task(async function() {
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
Services.prefs.setBoolPref("plugins.click_to_play", true);
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
await promiseTabLoadEvent(gBrowser.selectedTab, gTestRoot + "plugin_iframe.html"); await promiseTabLoadEvent(gBrowser.selectedTab, gTestRoot + "plugin_iframe.html");
......
...@@ -7,6 +7,7 @@ add_task(async function() { ...@@ -7,6 +7,7 @@ add_task(async function() {
clearAllPluginPermissions(); clearAllPluginPermissions();
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
Services.prefs.clearUserPref("plugins.click_to_play");
Services.prefs.clearUserPref("extensions.blocklist.suppressUI"); Services.prefs.clearUserPref("extensions.blocklist.suppressUI");
gBrowser.removeCurrentTab(); gBrowser.removeCurrentTab();
window.focus(); window.focus();
...@@ -14,6 +15,7 @@ add_task(async function() { ...@@ -14,6 +15,7 @@ add_task(async function() {
}); });
add_task(async function() { add_task(async function() {
Services.prefs.setBoolPref("plugins.click_to_play", true);
Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true); Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
......
...@@ -8,6 +8,7 @@ add_task(async function() { ...@@ -8,6 +8,7 @@ add_task(async function() {
clearAllPluginPermissions(); clearAllPluginPermissions();
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
Services.prefs.clearUserPref("plugins.click_to_play");
Services.prefs.clearUserPref("extensions.blocklist.suppressUI"); Services.prefs.clearUserPref("extensions.blocklist.suppressUI");
gBrowser.removeCurrentTab(); gBrowser.removeCurrentTab();
window.focus(); window.focus();
...@@ -16,6 +17,7 @@ add_task(async function() { ...@@ -16,6 +17,7 @@ add_task(async function() {
}); });
add_task(async function() { add_task(async function() {
Services.prefs.setBoolPref("plugins.click_to_play", true);
Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true); Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
let newTab = BrowserTestUtils.addTab(gBrowser); let newTab = BrowserTestUtils.addTab(gBrowser);
......
...@@ -7,6 +7,7 @@ add_task(async function() { ...@@ -7,6 +7,7 @@ add_task(async function() {
clearAllPluginPermissions(); clearAllPluginPermissions();
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
Services.prefs.clearUserPref("plugins.click_to_play");
Services.prefs.clearUserPref("extensions.blocklist.suppressUI"); Services.prefs.clearUserPref("extensions.blocklist.suppressUI");
gBrowser.removeCurrentTab(); gBrowser.removeCurrentTab();
window.focus(); window.focus();
...@@ -15,6 +16,7 @@ add_task(async function() { ...@@ -15,6 +16,7 @@ add_task(async function() {
}); });
add_task(async function() { add_task(async function() {
Services.prefs.setBoolPref("plugins.click_to_play", true);
Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true); Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
let newTab = BrowserTestUtils.addTab(gBrowser); let newTab = BrowserTestUtils.addTab(gBrowser);
......
...@@ -10,6 +10,7 @@ add_task(async function() { ...@@ -10,6 +10,7 @@ add_task(async function() {
clearAllPluginPermissions(); clearAllPluginPermissions();
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
Services.prefs.clearUserPref("plugins.click_to_play");
Services.prefs.clearUserPref("extensions.blocklist.suppressUI"); Services.prefs.clearUserPref("extensions.blocklist.suppressUI");
FullZoom.reset(); // must be called before closing the tab we zoomed! FullZoom.reset(); // must be called before closing the tab we zoomed!
gBrowser.removeCurrentTab(); gBrowser.removeCurrentTab();
...@@ -19,6 +20,7 @@ add_task(async function() { ...@@ -19,6 +20,7 @@ add_task(async function() {
}); });
add_task(async function() { add_task(async function() {
Services.prefs.setBoolPref("plugins.click_to_play", true);
Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true); Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
......
...@@ -11,6 +11,7 @@ add_task(async function() { ...@@ -11,6 +11,7 @@ add_task(async function() {
registerCleanupFunction(async function() { registerCleanupFunction(async function() {
clearAllPluginPermissions(); clearAllPluginPermissions();
updateAllTestPlugins(Ci.nsIPluginTag.STATE_ENABLED); updateAllTestPlugins(Ci.nsIPluginTag.STATE_ENABLED);
Services.prefs.clearUserPref("plugins.click_to_play");
Services.prefs.clearUserPref("extensions.blocklist.suppressUI"); Services.prefs.clearUserPref("extensions.blocklist.suppressUI");
await asyncSetAndUpdateBlocklist(gTestRoot + "blockNoPlugins", gTestBrowser); await asyncSetAndUpdateBlocklist(gTestRoot + "blockNoPlugins", gTestBrowser);
resetBlocklist(); resetBlocklist();
...@@ -27,6 +28,7 @@ add_task(async function() { ...@@ -27,6 +28,7 @@ add_task(async function() {
updateAllTestPlugins(Ci.nsIPluginTag.STATE_CLICKTOPLAY); updateAllTestPlugins(Ci.nsIPluginTag.STATE_CLICKTOPLAY);
Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true); Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
Services.prefs.setBoolPref("plugins.click_to_play", true);
// Prime the content process // Prime the content process
await promiseTabLoadEvent(gBrowser.selectedTab, "data:text/html,<html>hi</html>"); await promiseTabLoadEvent(gBrowser.selectedTab, "data:text/html,<html>hi</html>");
......
...@@ -6,6 +6,7 @@ add_task(async function() { ...@@ -6,6 +6,7 @@ add_task(async function() {
registerCleanupFunction(async function() { registerCleanupFunction(async function() {
clearAllPluginPermissions(); clearAllPluginPermissions();
Services.prefs.clearUserPref("extensions.blocklist.suppressUI"); Services.prefs.clearUserPref("extensions.blocklist.suppressUI");
Services.prefs.clearUserPref("plugins.click_to_play");
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
await asyncSetAndUpdateBlocklist(gTestRoot + "blockNoPlugins", gTestBrowser); await asyncSetAndUpdateBlocklist(gTestRoot + "blockNoPlugins", gTestBrowser);
...@@ -18,6 +19,7 @@ add_task(async function() { ...@@ -18,6 +19,7 @@ add_task(async function() {
add_task(async function() { add_task(async function() {
Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true); Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
Services.prefs.setBoolPref("plugins.click_to_play", true);
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
gTestBrowser = gBrowser.selectedBrowser; gTestBrowser = gBrowser.selectedBrowser;
......
...@@ -4,6 +4,7 @@ var gTestBrowser = null; ...@@ -4,6 +4,7 @@ var gTestBrowser = null;
add_task(async function() { add_task(async function() {
registerCleanupFunction(async function() { registerCleanupFunction(async function() {
clearAllPluginPermissions(); clearAllPluginPermissions();
Services.prefs.clearUserPref("plugins.click_to_play");
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
await asyncSetAndUpdateBlocklist(gTestRoot + "blockNoPlugins", gTestBrowser); await asyncSetAndUpdateBlocklist(gTestRoot + "blockNoPlugins", gTestBrowser);
...@@ -20,6 +21,7 @@ add_task(async function() { ...@@ -20,6 +21,7 @@ add_task(async function() {
gTestBrowser = gBrowser.selectedBrowser; gTestBrowser = gBrowser.selectedBrowser;
Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true); Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
Services.prefs.setBoolPref("plugins.click_to_play", true);
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Second Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Second Test Plug-in");
......
...@@ -13,6 +13,7 @@ add_task(async function() { ...@@ -13,6 +13,7 @@ add_task(async function() {
registerCleanupFunction(function() { registerCleanupFunction(function() {
gTestBrowser.removeEventListener("PluginBindingAttached", pluginBindingAttached, true, true); gTestBrowser.removeEventListener("PluginBindingAttached", pluginBindingAttached, true, true);
clearAllPluginPermissions(); clearAllPluginPermissions();
Services.prefs.clearUserPref("plugins.click_to_play");
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
gBrowser.removeCurrentTab(); gBrowser.removeCurrentTab();
...@@ -25,6 +26,8 @@ add_task(async function() { ...@@ -25,6 +26,8 @@ add_task(async function() {
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
gTestBrowser = gBrowser.selectedBrowser; gTestBrowser = gBrowser.selectedBrowser;
Services.prefs.setBoolPref("plugins.click_to_play", true);
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
BrowserTestUtils.addContentEventListener(gTestBrowser, "PluginBindingAttached", pluginBindingAttached, true, null, true); BrowserTestUtils.addContentEventListener(gTestBrowser, "PluginBindingAttached", pluginBindingAttached, true, null, true);
......
...@@ -5,6 +5,7 @@ var gWrapperClickCount = 0; ...@@ -5,6 +5,7 @@ var gWrapperClickCount = 0;
add_task(async function() { add_task(async function() {
registerCleanupFunction(function() { registerCleanupFunction(function() {
clearAllPluginPermissions(); clearAllPluginPermissions();
Services.prefs.clearUserPref("plugins.click_to_play");
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in"); setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
gBrowser.removeCurrentTab(); gBrowser.removeCurrentTab();
...@@ -14,6 +15,8 @@ add_task(async function() { ...@@ -14,6 +15,8 @@ add_task(async function() {
}); });
add_task(async function() { add_task(async function() {
Services.prefs.setBoolPref("plugins.click_to_play", true);
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
gTestBrowser = gBrowser.selectedBrowser; gTestBrowser = gBrowser.selectedBrowser;
......
Supports Markdown
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