Bug 1165046 fix e10s test browser_social_activation, r=felipe
authorShane Caraveo <scaraveo@mozilla.com>
Fri, 22 May 2015 18:29:03 -0700
changeset 245234 31c58b01300a
parent 245233 b2846368c764
child 245235 0d2eaa2b77ac
push id13132
push usermixedpuppy@gmail.com
push date2015-05-23 01:29 +0000
treeherderfx-team@31c58b01300a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe
bugs1165046
milestone41.0a1
Bug 1165046 fix e10s test browser_social_activation, r=felipe
browser/base/content/test/social/browser.ini
browser/base/content/test/social/browser_social_activation.js
--- a/browser/base/content/test/social/browser.ini
+++ b/browser/base/content/test/social/browser.ini
@@ -29,17 +29,17 @@ support-files =
 [browser_aboutHome_activation.js]
 [browser_addons.js]
 skip-if = e10s && debug # Leaking docshells (bug 1150147)
 [browser_blocklist.js]
 skip-if = e10s && debug # Leaking docshells (bug 1150147)
 [browser_share.js]
 skip-if = true # bug 1115131
 [browser_social_activation.js]
-skip-if = e10s # Bug 933103 synthesizeMouseAtCenter not e10s friendly
+skip-if = e10s && debug # e10s/Linux/Debug Leaking docshells (bug 1150147)
 [browser_social_chatwindow.js]
 [browser_social_chatwindow_resize.js]
 [browser_social_chatwindowfocus.js]
 skip-if = e10s # tab crash on data url used in this test
 [browser_social_contextmenu.js]
 skip-if = e10s # Bug 1072669 context menu relies on target element
 [browser_social_errorPage.js]
 [browser_social_flyout.js]
--- a/browser/base/content/test/social/browser_social_activation.js
+++ b/browser/base/content/test/social/browser_social_activation.js
@@ -57,22 +57,17 @@ function addTab(url, callback) {
     tabsToRemove.push(tab);
     executeSoon(function() {callback(tab)});
   }, true);
 }
 
 function sendActivationEvent(tab, callback, nullManifest) {
   // hack Social.lastEventReceived so we don't hit the "too many events" check.
   Social.lastEventReceived = 0;
-  let doc = tab.linkedBrowser.contentDocument;
-  // if our test has a frame, use it
-  if (doc.defaultView.frames[0])
-    doc = doc.defaultView.frames[0].document;
-  let button = doc.getElementById(nullManifest ? "activation-old" : "activation");
-  EventUtils.synthesizeMouseAtCenter(button, {}, doc.defaultView);
+  BrowserTestUtils.synthesizeMouseAtCenter("#activation", {}, tab.linkedBrowser);
   executeSoon(callback);
 }
 
 function activateProvider(domain, callback, nullManifest) {
   let activationURL = domain+"/browser/browser/base/content/test/social/social_activate.html"
   addTab(activationURL, function(tab) {
     sendActivationEvent(tab, callback, nullManifest);
   });
@@ -112,34 +107,32 @@ function getAddonItemInList(aId, aList) 
   }
   return null;
 }
 
 function clickAddonRemoveButton(tab, aCallback) {
   AddonManager.getAddonsByTypes(["service"], function(aAddons) {
     let addon = aAddons[0];
 
-    let doc = tab.linkedBrowser.contentDocument;
+    let doc = tab.linkedBrowser.contentDocument;;
     let list = doc.getElementById("addon-list");
 
     let item = getAddonItemInList(addon.id, list);
-    isnot(item, null, "Should have found the add-on in the list");
-
-    var button = doc.getAnonymousElementByAttribute(item, "anonid", "remove-btn");
+    let button = item._removeBtn;
     isnot(button, null, "Should have a remove button");
     ok(!button.disabled, "Button should not be disabled");
 
-    EventUtils.synthesizeMouseAtCenter(button, { }, doc.defaultView);
+    // uninstall happens after about:addons tab is closed, so we wait on
+    // disabled
+    promiseObserverNotified("social:provider-disabled").then(() => {
+      is(item.getAttribute("pending"), "uninstall", "Add-on should be uninstalling");
+      executeSoon(function() { aCallback(addon); });
+    });
 
-    // Force XBL to apply
-    item.clientTop;
-
-    is(item.getAttribute("pending"), "uninstall", "Add-on should be uninstalling");
-
-    executeSoon(function() { aCallback(addon); });
+    BrowserTestUtils.synthesizeMouseAtCenter(button, {}, tab.linkedBrowser);
   });
 }
 
 function activateOneProvider(manifest, finishActivation, aCallback) {
   let panel = document.getElementById("servicesInstall-notification");
   PopupNotifications.panel.addEventListener("popupshown", function onpopupshown() {
     PopupNotifications.panel.removeEventListener("popupshown", onpopupshown);
     ok(!panel.hidden, "servicesInstall-notification panel opened");