Bug 1102018 - Fix and enable browser_bug481560.js for e10s. r=gijs
authorDão Gottwald <dao@mozilla.com>
Thu, 20 Nov 2014 14:36:04 +0100
changeset 216596 04fdc77c9d7c59e7dd3de88b30784d6bddc8cb54
parent 216595 2df1080da3690643786d8392333fbea190ef08e8
child 216597 20d336286e3512f102201c2ce127b3ea01d168c2
push id10058
push userdgottwald@mozilla.com
push dateThu, 20 Nov 2014 13:36:25 +0000
treeherderfx-team@04fdc77c9d7c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgijs
bugs1102018, 481560
milestone36.0a1
Bug 1102018 - Fix and enable browser_bug481560.js for e10s. r=gijs
browser/base/content/test/general/browser.ini
browser/base/content/test/general/browser_bug481560.js
--- a/browser/base/content/test/general/browser.ini
+++ b/browser/base/content/test/general/browser.ini
@@ -174,17 +174,16 @@ skip-if = e10s # Bug 866413 - PageInfo d
 skip-if = toolkit == "cocoa" || e10s # Bug 1102017 - middle-button mousedown on selected tab2 does not activate tab - Didn't expect [object XULElement], but got it
 [browser_bug462673.js]
 skip-if = e10s # Bug 1093404 - test expects sync window opening from content and is disappointed in that expectation
 [browser_bug477014.js]
 skip-if = e10s # Bug 1093206 - need to re-enable tests relying on swapFrameLoaders et al for e10s
 [browser_bug479408.js]
 skip-if = buildapp == 'mulet'
 [browser_bug481560.js]
-skip-if = e10s # Bug 1102018 - This bug attaches an event listener directly to the content, which then never gets called.
 [browser_bug484315.js]
 skip-if = e10s
 [browser_bug491431.js]
 skip-if = buildapp == 'mulet'
 [browser_bug495058.js]
 skip-if = e10s # Bug 1093206 - need to re-enable tests relying on swapFrameLoaders et al (and thus replaceTabWithWindow) for e10s
 [browser_bug517902.js]
 skip-if = e10s # Bug 866413 - PageInfo doesn't work in e10s
--- a/browser/base/content/test/general/browser_bug481560.js
+++ b/browser/base/content/test/general/browser_bug481560.js
@@ -1,27 +1,21 @@
 function test() {
   waitForExplicitFinish();
 
-  var win = openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no");
-
-  win.addEventListener("load", function () {
-    win.removeEventListener("load", arguments.callee, false);
-
-    win.content.addEventListener("focus", function () {
-      win.content.removeEventListener("focus", arguments.callee, false);
-
+  whenNewWindowLoaded(null, function (win) {
+    waitForFocus(function () {
       function onTabClose() {
         ok(false, "shouldn't have gotten the TabClose event for the last tab");
       }
       var tab = win.gBrowser.selectedTab;
       tab.addEventListener("TabClose", onTabClose, false);
 
       EventUtils.synthesizeKey("w", { accelKey: true }, win);
 
       ok(win.closed, "accel+w closed the window immediately");
 
       tab.removeEventListener("TabClose", onTabClose, false);
 
       finish();
-    }, false);
-  }, false);
+    }, win);
+  });
 }