summaryrefslogtreecommitdiffstats
path: root/browser/base/content/test/plugins/browser_bug787619.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2018-02-03 06:00:38 -0500
committerMatt A. Tobin <email@mattatobin.com>2018-02-03 06:00:38 -0500
commit8148615da179fdd60f19018e13b4e94b95609cc6 (patch)
tree771fccdd99fa3adf35fdd2c81d8197b415a89b91 /browser/base/content/test/plugins/browser_bug787619.js
parent494802c1be7888025b95260d23db187467d2b9dd (diff)
downloadUXP-8148615da179fdd60f19018e13b4e94b95609cc6.tar
UXP-8148615da179fdd60f19018e13b4e94b95609cc6.tar.gz
UXP-8148615da179fdd60f19018e13b4e94b95609cc6.tar.lz
UXP-8148615da179fdd60f19018e13b4e94b95609cc6.tar.xz
UXP-8148615da179fdd60f19018e13b4e94b95609cc6.zip
Remove browser tests - Part 1: The Tests (except for experiments)
Diffstat (limited to 'browser/base/content/test/plugins/browser_bug787619.js')
-rw-r--r--browser/base/content/test/plugins/browser_bug787619.js65
1 files changed, 0 insertions, 65 deletions
diff --git a/browser/base/content/test/plugins/browser_bug787619.js b/browser/base/content/test/plugins/browser_bug787619.js
deleted file mode 100644
index bfd52258c..000000000
--- a/browser/base/content/test/plugins/browser_bug787619.js
+++ /dev/null
@@ -1,65 +0,0 @@
-var gTestRoot = getRootDirectory(gTestPath).replace("chrome://mochitests/content/", "http://127.0.0.1:8888/");
-var gTestBrowser = null;
-var gWrapperClickCount = 0;
-
-add_task(function* () {
- registerCleanupFunction(function () {
- clearAllPluginPermissions();
- Services.prefs.clearUserPref("plugins.click_to_play");
- setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
- setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
- gBrowser.removeCurrentTab();
- window.focus();
- gTestBrowser = null;
- });
-});
-
-add_task(function* () {
- Services.prefs.setBoolPref("plugins.click_to_play", true);
-
- gBrowser.selectedTab = gBrowser.addTab();
- gTestBrowser = gBrowser.selectedBrowser;
-
- setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
-
- let testRoot = getRootDirectory(gTestPath).replace("chrome://mochitests/content/", "http://127.0.0.1:8888/");
- yield promiseTabLoadEvent(gBrowser.selectedTab, testRoot + "plugin_bug787619.html");
-
- // Due to layout being async, "PluginBindAttached" may trigger later.
- // This forces a layout flush, thus triggering it, and schedules the
- // test so it is definitely executed afterwards.
- yield promiseUpdatePluginBindings(gTestBrowser);
-
- // check plugin state
- let pluginInfo = yield promiseForPluginInfo("plugin");
- ok(!pluginInfo.activated, "1a plugin should not be activated");
-
- // click the overlay to prompt
- let promise = promisePopupNotification("click-to-play-plugins");
- yield ContentTask.spawn(gTestBrowser, {}, function* () {
- let plugin = content.document.getElementById("plugin");
- let bounds = plugin.getBoundingClientRect();
- let left = (bounds.left + bounds.right) / 2;
- let top = (bounds.top + bounds.bottom) / 2;
- let utils = content.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
- .getInterface(Components.interfaces.nsIDOMWindowUtils);
- utils.sendMouseEvent("mousedown", left, top, 0, 1, 0, false, 0, 0);
- utils.sendMouseEvent("mouseup", left, top, 0, 1, 0, false, 0, 0);
- });
- yield promise;
-
- // check plugin state
- pluginInfo = yield promiseForPluginInfo("plugin");
- ok(!pluginInfo.activated, "1b plugin should not be activated");
-
- let condition = () => !PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser).dismissed &&
- PopupNotifications.panel.firstChild;
- yield promiseForCondition(condition);
- PopupNotifications.panel.firstChild._primaryButton.click();
-
- // check plugin state
- pluginInfo = yield promiseForPluginInfo("plugin");
- ok(pluginInfo.activated, "plugin should be activated");
-
- is(gWrapperClickCount, 0, 'wrapper should not have received any clicks');
-});