diff options
author | Matt A. Tobin <email@mattatobin.com> | 2018-02-03 06:00:38 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2018-02-03 06:00:38 -0500 |
commit | 8148615da179fdd60f19018e13b4e94b95609cc6 (patch) | |
tree | 771fccdd99fa3adf35fdd2c81d8197b415a89b91 /browser/base/content/test/plugins/browser_bug820497.js | |
parent | 494802c1be7888025b95260d23db187467d2b9dd (diff) | |
download | UXP-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_bug820497.js')
-rw-r--r-- | browser/base/content/test/plugins/browser_bug820497.js | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/browser/base/content/test/plugins/browser_bug820497.js b/browser/base/content/test/plugins/browser_bug820497.js deleted file mode 100644 index b2e0f5268..000000000 --- a/browser/base/content/test/plugins/browser_bug820497.js +++ /dev/null @@ -1,71 +0,0 @@ -var gTestRoot = getRootDirectory(gTestPath).replace("chrome://mochitests/content/", "http://127.0.0.1:8888/"); -var gTestBrowser = null; -var gNumPluginBindingsAttached = 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"); - setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Second Test Plug-in"); - - gTestBrowser.addEventListener("PluginBindingAttached", function () { gNumPluginBindingsAttached++ }, true, true); - - yield promiseTabLoadEvent(gBrowser.selectedTab, gTestRoot + "plugin_bug820497.html"); - - yield promiseForCondition(function () { return gNumPluginBindingsAttached == 1; }); - - yield ContentTask.spawn(gTestBrowser, null, () => { - // Note we add the second plugin in the code farther down, so there's - // no way we got here with anything but one plugin loaded. - let doc = content.document; - let testplugin = doc.getElementById("test"); - ok(testplugin, "should have test plugin"); - let secondtestplugin = doc.getElementById("secondtest"); - ok(!secondtestplugin, "should not yet have second test plugin"); - }); - - yield promisePopupNotification("click-to-play-plugins"); - let notification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser); - ok(notification, "should have a click-to-play notification"); - - yield promiseForNotificationShown(notification); - - is(notification.options.pluginData.size, 1, "should be 1 type of plugin in the popup notification"); - - yield ContentTask.spawn(gTestBrowser, {}, function* () { - XPCNativeWrapper.unwrap(content).addSecondPlugin(); - }); - - yield promiseForCondition(function () { return gNumPluginBindingsAttached == 2; }); - - yield ContentTask.spawn(gTestBrowser, null, () => { - let doc = content.document; - let testplugin = doc.getElementById("test"); - ok(testplugin, "should have test plugin"); - let secondtestplugin = doc.getElementById("secondtest"); - ok(secondtestplugin, "should have second test plugin"); - }); - - notification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser); - - ok(notification, "should have popup notification"); - - yield promiseForNotificationShown(notification); - - is(notification.options.pluginData.size, 2, "aited too long for 2 types of plugins in popup notification"); -}); |