Backed out changeset 8d5db16d7f39 (bug 1196834) for e10s browser_bug1163570.js failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Mon, 24 Aug 2015 15:42:15 -0400
changeset 259087 9d67edd311f51efea70b387cd85b28c9603cc6b0
parent 259086 6f0bf5a7187c09a83bd7d64fba1e74a83744eda3
child 259088 692a0e1e46a6805a266c86dd1de5cec2ede1b930
push id29268
push userryanvm@gmail.com
push dateTue, 25 Aug 2015 00:37:23 +0000
treeherdermozilla-central@08015770c9d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1196834, 1163570
milestone43.0a1
backs out8d5db16d7f39201ed43ccbe9dc2622b166aca447
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 8d5db16d7f39 (bug 1196834) for e10s browser_bug1163570.js failures. CLOSED TREE
dom/plugins/test/mochitest/browser.ini
dom/plugins/test/mochitest/browser_bug1163570.js
dom/plugins/test/mochitest/plugin_test.html
dom/plugins/test/moz.build
dom/plugins/test/testplugin/nptest.cpp
dom/plugins/test/testplugin/nptest_platform.h
dom/plugins/test/testplugin/nptest_windows.cpp
deleted file mode 100644
--- a/dom/plugins/test/mochitest/browser.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[DEFAULT]
-support-files =
-  plugin_test.html
-
-[browser_bug1163570.js]
-skip-if = (!e10s)
deleted file mode 100644
--- a/dom/plugins/test/mochitest/browser_bug1163570.js
+++ /dev/null
@@ -1,140 +0,0 @@
-let gTestRoot = getRootDirectory(gTestPath).replace("chrome://mochitests/content/", "http://127.0.0.1:8888/");
-
-// Returns the chrome side nsIPluginTag for this plugin
-function getTestPlugin(aName) {
-  let pluginName = aName || "Test Plug-in";
-  let ph = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
-  let tags = ph.getPluginTags();
-
-  // Find the test plugin
-  for (let i = 0; i < tags.length; i++) {
-    if (tags[i].name == pluginName)
-      return tags[i];
-  }
-  ok(false, "Unable to find plugin");
-  return null;
-}
-
-// Set the test plugin state, disabling features like click-to-play
-function setTestPluginEnabledState(newEnabledState, pluginName) {
-  let name = pluginName || "Test Plug-in";
-  let plugin = getTestPlugin(name);
-  plugin.enabledState = newEnabledState;
-}
-
-// simple tab load helper, pilfered from browser plugin tests
-function promiseTabLoad(tab, url, eventType="load") {
-  return new Promise((resolve, reject) => {
-    function handle(event) {
-      if (event.originalTarget != tab.linkedBrowser.contentDocument ||
-          event.target.location.href == "about:blank" ||
-          (url && event.target.location.href != url)) {
-        return;
-      }
-      clearTimeout(timeout);
-      tab.linkedBrowser.removeEventListener(eventType, handle, true);
-      resolve(event);
-    }
-
-    let timeout = setTimeout(() => {
-      tab.linkedBrowser.removeEventListener(eventType, handle, true);
-      reject(new Error("Timed out while waiting for a '" + eventType + "'' event"));
-    }, 30000);
-
-    tab.linkedBrowser.addEventListener(eventType, handle, true, true);
-    if (url) {
-      tab.linkedBrowser.loadURI(url);
-    }
-  });
-}
-
-// dom event listener helper
-function promiseWaitForEvent(object, eventName, capturing = false, chrome = false) {
-  return new Promise((resolve) => {
-    function listener(event) {
-      object.removeEventListener(eventName, listener, capturing, chrome);
-      resolve(event);
-    }
-    object.addEventListener(eventName, listener, capturing, chrome);
-  });
-}
-
-add_task(function* () {
-  registerCleanupFunction(function () {
-    Services.prefs.clearUserPref("browser.uiCustomization.disableAnimation");
-    window.focus();
-  });
-});
-
-add_task(function* () {
-  Services.prefs.setBoolPref("browser.uiCustomization.disableAnimation", true);
-  setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
-
-  let pluginTab = gBrowser.selectedTab = gBrowser.addTab();
-  let customizeTab = gBrowser.addTab();
-
-  yield promiseTabLoad(pluginTab, gTestRoot + "plugin_test.html");
-  yield promiseTabLoad(customizeTab, "about:customizing");
-
-  let result = yield ContentTask.spawn(gBrowser.selectedBrowser, null, function*() {
-    let doc = content.document;
-    let plugin = doc.getElementById("testplugin");
-    return !!plugin;
-  });
-
-  is(result, true, "plugin is loaded");
-
-  let cpromise = promiseWaitForEvent(window.gNavToolbox, "customizationready");
-  let ppromise = promiseWaitForEvent(window, "MozAfterPaint");
-  gBrowser.selectedTab = customizeTab;
-  yield cpromise;
-  yield ppromise;
-
-  // We're going to switch tabs using actual mouse clicks, which helps
-  // reproduce this bug.
-  let tabStripContainer = document.getElementById("tabbrowser-tabs");
-
-  // diagnosis if front end layout changes
-  info("-> " + tabStripContainer.tagName); // tabs
-  info("-> " + tabStripContainer.firstChild.tagName); // tab
-  info("-> " + tabStripContainer.childNodes[0].label); // test harness tab
-  info("-> " + tabStripContainer.childNodes[1].label); // plugin tab
-  info("-> " + tabStripContainer.childNodes[2].label); // customize tab
-
-  for (let iteration = 0; iteration < 5; iteration++) {
-    cpromise = promiseWaitForEvent(window.gNavToolbox, "aftercustomization");
-    ppromise = promiseWaitForEvent(window, "MozAfterPaint");
-    EventUtils.synthesizeMouseAtCenter(tabStripContainer.childNodes[1], {}, window);
-    yield cpromise;
-    yield ppromise;
-
-    result = yield ContentTask.spawn(pluginTab.linkedBrowser, null, function*() {
-      let doc = content.document;
-      let plugin = doc.getElementById("testplugin");
-      return XPCNativeWrapper.unwrap(plugin).nativeWidgetIsVisible();
-    });
-
-    is(result, true, "plugin is visible");
-
-    cpromise = promiseWaitForEvent(window.gNavToolbox, "customizationready");
-    ppromise = promiseWaitForEvent(window, "MozAfterPaint");
-    EventUtils.synthesizeMouseAtCenter(tabStripContainer.childNodes[2], {}, window);
-    yield cpromise;
-    yield ppromise;
-
-    result = yield ContentTask.spawn(pluginTab.linkedBrowser, null, function*() {
-      let doc = content.document;
-      let plugin = doc.getElementById("testplugin");
-      return XPCNativeWrapper.unwrap(plugin).nativeWidgetIsVisible();
-    });
-    is(result, false, "plugin is hidden");
-  }
-
-  // wait for customize view to shutdown cleanly otherwise we get
-  // a ton of error spew on shutdown.
-  cpromise = promiseWaitForEvent(window.gNavToolbox, "aftercustomization");
-  gBrowser.removeTab(customizeTab);
-  yield cpromise;
-
-  gBrowser.removeTab(pluginTab);
-});
deleted file mode 100644
--- a/dom/plugins/test/mochitest/plugin_test.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-</head>
-<body>
-  <embed id="testplugin" type="application/x-test" drawmode="solid" color="ff00ff00" wmode="window"
-         style="position:absolute; top:50px; left:50px; width:500px; height:250px">
-</body>
-</html>
--- a/dom/plugins/test/moz.build
+++ b/dom/plugins/test/moz.build
@@ -6,10 +6,9 @@
 
 DIRS += ['testplugin', 'testaddon']
 
 XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'cocoa', 'windows'):
     MOCHITEST_MANIFESTS += ['mochitest/mochitest.ini']
     MOCHITEST_CHROME_MANIFESTS += ['mochitest/chrome.ini']
-    BROWSER_CHROME_MANIFESTS += ['mochitest/browser.ini']
 
--- a/dom/plugins/test/testplugin/nptest.cpp
+++ b/dom/plugins/test/testplugin/nptest.cpp
@@ -166,17 +166,16 @@ static bool setSitesWithDataCapabilities
 static bool getLastKeyText(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
 static bool getNPNVdocumentOrigin(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
 static bool getMouseUpEventCount(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
 static bool queryContentsScaleFactor(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
 static bool echoString(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
 static bool startAudioPlayback(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
 static bool stopAudioPlayback(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
 static bool getAudioMuted(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
-static bool nativeWidgetIsVisible(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
 
 static const NPUTF8* sPluginMethodIdentifierNames[] = {
   "npnEvaluateTest",
   "npnInvokeTest",
   "npnInvokeDefaultTest",
   "setUndefinedValueTest",
   "identifierToStringTest",
   "timerTest",
@@ -236,17 +235,16 @@ static const NPUTF8* sPluginMethodIdenti
   "getLastKeyText",
   "getNPNVdocumentOrigin",
   "getMouseUpEventCount",
   "queryContentsScaleFactor",
   "echoString",
   "startAudioPlayback",
   "stopAudioPlayback",
   "audioMuted",
-  "nativeWidgetIsVisible",
 };
 static NPIdentifier sPluginMethodIdentifiers[MOZ_ARRAY_LENGTH(sPluginMethodIdentifierNames)];
 static const ScriptableFunction sPluginMethodFunctions[] = {
   npnEvaluateTest,
   npnInvokeTest,
   npnInvokeDefaultTest,
   setUndefinedValueTest,
   identifierToStringTest,
@@ -307,17 +305,16 @@ static const ScriptableFunction sPluginM
   getLastKeyText,
   getNPNVdocumentOrigin,
   getMouseUpEventCount,
   queryContentsScaleFactor,
   echoString,
   startAudioPlayback,
   stopAudioPlayback,
   getAudioMuted,
-  nativeWidgetIsVisible,
 };
 
 static_assert(MOZ_ARRAY_LENGTH(sPluginMethodIdentifierNames) ==
               MOZ_ARRAY_LENGTH(sPluginMethodFunctions),
               "Arrays should have the same size");
 
 static const NPUTF8* sPluginPropertyIdentifierNames[] = {
   "propertyAndMethod"
@@ -3319,37 +3316,16 @@ bool
 destroySharedGfxStuff(NPObject* npobj, const NPVariant* args,
                         uint32_t argCount, NPVariant* result)
 {
   // XXX Not implemented!
   return false;
 }
 #endif
 
-#if defined(XP_WIN)
-bool
-nativeWidgetIsVisible(NPObject* npobj, const NPVariant* args,
-                        uint32_t argCount, NPVariant* result)
-{
-  NPP npp = static_cast<TestNPObject*>(npobj)->npp;
-  InstanceData* id = static_cast<InstanceData*>(npp->pdata);
-  bool visible = pluginNativeWidgetIsVisible(id);
-  BOOLEAN_TO_NPVARIANT(visible, *result);
-  return true;
-}
-#else
-bool
-nativeWidgetIsVisible(NPObject* npobj, const NPVariant* args,
-                      uint32_t argCount, NPVariant* result)
-{
-  // XXX Not implemented!
-  return false;
-}
-#endif
-
 bool
 callOnDestroy(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result)
 {
   NPP npp = static_cast<TestNPObject*>(npobj)->npp;
   InstanceData* id = static_cast<InstanceData*>(npp->pdata);
 
   if (id->callOnDestroy)
     return false;
--- a/dom/plugins/test/testplugin/nptest_platform.h
+++ b/dom/plugins/test/testplugin/nptest_platform.h
@@ -140,16 +140,9 @@ bool pluginCrashInNestedLoop(InstanceDat
  * function will be called when the test plugin is loaded in-process,
  * and bad things will happen if it is called.
  *
  * This call leaves the plugin subprocess in an undefined state.  It
  * must not be used after this call or weird things will happen.
  */
 bool pluginDestroySharedGfxStuff(InstanceData* instanceData);
 
-/**
- * Checks to see if the native widget is marked as visible. Works
- * in e10s and non-e10s. Useful in testing e10s related compositor
- * plugin window functionality. Supported on Windows.
- */
-bool pluginNativeWidgetIsVisible(InstanceData* instanceData);
-
 #endif // nptest_platform_h_
--- a/dom/plugins/test/testplugin/nptest_windows.cpp
+++ b/dom/plugins/test/testplugin/nptest_windows.cpp
@@ -586,20 +586,8 @@ void pluginDoInternalConsistencyCheck(In
     HWND hWnd = (HWND)instanceData->window.window;
     ::GetWindowRect(hWnd, &ourRect);
     checkEquals(childRect.left, ourRect.left, "Child widget left", error);
     checkEquals(childRect.top, ourRect.top, "Child widget top", error);
     checkEquals(childRect.right, childRect.left + CHILD_WIDGET_SIZE, "Child widget width", error);
     checkEquals(childRect.bottom, childRect.top + CHILD_WIDGET_SIZE, "Child widget height", error);
   }
 }
-
-bool pluginNativeWidgetIsVisible(InstanceData* instanceData)
-{
-  HWND hWnd = (HWND)instanceData->window.window;
-  wchar_t className[60];
-  if (::GetClassNameW(::GetParent(hWnd), className, sizeof(className) / sizeof(char16_t)) &&
-      !wcsicmp(className, L"MozillaWindowClass")) {
-    return ::IsWindowVisible(hWnd);
-  }
-  // something isn't right, fail the check
-  return false;
-}