Backed out changeset 87138e223c91 (bug 916542) for mochitest-bc orange. a=backout
authorRyan VanderMeulen <ryanvm@gmail.com>
Mon, 07 Oct 2013 13:17:45 -0400
changeset 160597 decf58f0d59656ffd2944a7c71ced2ca23a4bc64
parent 160596 bbb0113e12169c814487fe8df76c680a191b8192
child 160598 f89590e5824a1731c879d23a33a066bc81ff51dd
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs916542
milestone26.0a2
backs out87138e223c910508ffb860ef52b48f8802434e77
Backed out changeset 87138e223c91 (bug 916542) for mochitest-bc orange. a=backout CLOSED TREE
browser/base/content/browser-plugins.js
browser/base/content/test/Makefile.in
browser/base/content/test/browser_CTP_nonplugins.js
--- a/browser/base/content/browser-plugins.js
+++ b/browser/base/content/browser-plugins.js
@@ -790,19 +790,17 @@ var gPluginHandler = {
 
   _showClickToPlayNotification: function PH_showClickToPlayNotification(aBrowser, aPrimaryPlugin) {
     let notification = PopupNotifications.getNotification("click-to-play-plugins", aBrowser);
 
     let contentWindow = aBrowser.contentWindow;
     let contentDoc = aBrowser.contentDocument;
     let cwu = contentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
                            .getInterface(Ci.nsIDOMWindowUtils);
-    // cwu.plugins may contain non-plugin <object>s, filter them out
-    let plugins = cwu.plugins.filter((plugin) =>
-      plugin.getContentTypeForMIMEType(plugin.actualType) == Ci.nsIObjectLoadingContent.TYPE_PLUGIN);
+    let plugins = cwu.plugins;
     if (plugins.length == 0) {
       if (notification) {
         PopupNotifications.remove(notification);
       }
       return;
     }
 
     let icon = 'plugins-notification-icon';
--- a/browser/base/content/test/Makefile.in
+++ b/browser/base/content/test/Makefile.in
@@ -187,17 +187,16 @@ MOCHITEST_BROWSER_FILES = \
                  browser_mixedcontent_securityflags.js \
                  browser_clearplugindata_noage.html \
                  browser_clearplugindata.html \
                  browser_clearplugindata.js \
                  browser_contentAreaClick.js \
                  browser_contextSearchTabPosition.js \
                  browser_CTP_drag_drop.js \
                  browser_CTP_data_urls.js \
-                 browser_CTP_nonplugins.js \
                  browser_ctrlTab.js \
                  browser_customize_popupNotification.js \
                  browser_customize.js \
                  browser_disablechrome.js \
                  browser_discovery.js \
                  browser_duplicateIDs.js \
                  browser_findbarClose.js \
                  browser_fullscreen-window-open.js \
deleted file mode 100644
--- a/browser/base/content/test/browser_CTP_nonplugins.js
+++ /dev/null
@@ -1,160 +0,0 @@
-var rootDir = getRootDirectory(gTestPath);
-const gTestRoot = rootDir;
-const gHttpTestRoot = rootDir.replace("chrome://mochitests/content/", "http://127.0.0.1:8888/");
-
-var gTestBrowser = null;
-var gNextTest = null;
-var gPluginHost = Components.classes["@mozilla.org/plugin/host;1"].getService(Components.interfaces.nsIPluginHost);
-var gRunNextTestAfterPluginRemoved = false;
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-// This listens for the next opened tab and checks it is of the right url.
-// opencallback is called when the new tab is fully loaded
-// closecallback is called when the tab is closed
-function TabOpenListener(url, opencallback, closecallback) {
-  this.url = url;
-  this.opencallback = opencallback;
-  this.closecallback = closecallback;
-
-  gBrowser.tabContainer.addEventListener("TabOpen", this, false);
-}
-
-TabOpenListener.prototype = {
-  url: null,
-  opencallback: null,
-  closecallback: null,
-  tab: null,
-  browser: null,
-
-  handleEvent: function(event) {
-    if (event.type == "TabOpen") {
-      gBrowser.tabContainer.removeEventListener("TabOpen", this, false);
-      this.tab = event.originalTarget;
-      this.browser = this.tab.linkedBrowser;
-      gBrowser.addEventListener("pageshow", this, false);
-    } else if (event.type == "pageshow") {
-      if (event.target.location.href != this.url)
-        return;
-      gBrowser.removeEventListener("pageshow", this, false);
-      this.tab.addEventListener("TabClose", this, false);
-      var url = this.browser.contentDocument.location.href;
-      is(url, this.url, "Should have opened the correct tab");
-      this.opencallback(this.tab, this.browser.contentWindow);
-    } else if (event.type == "TabClose") {
-      if (event.originalTarget != this.tab)
-        return;
-      this.tab.removeEventListener("TabClose", this, false);
-      this.opencallback = null;
-      this.tab = null;
-      this.browser = null;
-      // Let the window close complete
-      executeSoon(this.closecallback);
-      this.closecallback = null;
-    }
-  }
-};
-
-function test() {
-  waitForExplicitFinish();
-  registerCleanupFunction(function() {
-    clearAllPluginPermissions();
-    Services.prefs.clearUserPref("extensions.blocklist.suppressUI");
-    gTestBrowser.removeEventListener("PluginRemoved", handlePluginRemoved, true, true);
-  });
-  Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
-
-  var newTab = gBrowser.addTab();
-  gBrowser.selectedTab = newTab;
-  gTestBrowser = gBrowser.selectedBrowser;
-  gTestBrowser.addEventListener("load", pageLoad, true);
-  gTestBrowser.addEventListener("PluginRemoved", handlePluginRemoved, true, true);
-
-  Services.prefs.setBoolPref("plugins.click_to_play", true);
-  setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY);
-
-  prepareTest(runAfterPluginBindingAttached(test1), gHttpTestRoot + "plugin_two_types.html");
-}
-
-function finishTest() {
-  clearAllPluginPermissions();
-  gTestBrowser.removeEventListener("load", pageLoad, true);
-  gBrowser.removeCurrentTab();
-  window.focus();
-  finish();
-}
-
-function pageLoad() {
-  // The plugin events are async dispatched and can come after the load event
-  // This just allows the events to fire before we then go on to test the states
-  executeSoon(gNextTest);
-}
-
-function prepareTest(nextTest, url) {
-  gNextTest = nextTest;
-  gTestBrowser.contentWindow.location = url;
-}
-
-// Due to layout being async, "PluginBindAttached" may trigger later.
-// This wraps a function to force a layout flush, thus triggering it,
-// and schedules the function execution so they're definitely executed
-// afterwards.
-function runAfterPluginBindingAttached(func) {
-  return function() {
-    let doc = gTestBrowser.contentDocument;
-    let elems = doc.getElementsByTagName('embed');
-    if (elems.length < 1) {
-      elems = doc.getElementsByTagName('object');
-    }
-    elems[0].clientTop;
-    executeSoon(func);
-  };
-}
-
-function handlePluginRemoved() {
-  if (gRunNextTestAfterPluginRemoved) {
-    executeSoon(gNextTest);
-    gRunNextTestAfterPluginRemoved = false;
-  }
-}
-
-function runAfterPluginRemoved(func) {
-  gNextTest = func;
-  gRunNextTestAfterPluginRemoved = true;
-}
-
-// Test that the click-to-play notification is not shown for non-plugin object elements
-
-function test1() {
-  let popupNotification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
-  ok(popupNotification, "Test 1, Should have a click-to-play notification");
-
-  let plugin = gTestBrowser.contentDocument.getElementById("secondtestA");
-  plugin.parentNode.removeChild(plugin);
-  plugin = gTestBrowser.contentDocument.getElementById("secondtestB");
-  plugin.parentNode.removeChild(plugin);
-
-  let image = gTestBrowser.contentDocument.createElement("object");
-  image.type = "image/png";
-  image.data = "moz.png";
-  gTestBrowser.contentDocument.body.appendChild(image);
-
-  runAfterPluginRemoved(test2);
-}
-
-function test2() {
-  let popupNotification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
-  ok(popupNotification, "Test 2, Should have a click-to-play notification");
-
-  let plugin = gTestBrowser.contentDocument.getElementById("test");
-  plugin.parentNode.removeChild(plugin);
-
-  runAfterPluginRemoved(() => executeSoon(test3));
-}
-
-function test3() {
-  let popupNotification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
-  ok(!popupNotification, "Test 3, Should not have a click-to-play notification");
-
-  finishTest();
-}