Bug 939643 - Avoid test orange by rejigging how we wait for blocklist window. r=mixedpuppy
authorMark Hammond <mhammond@skippinet.com.au>
Tue, 26 Nov 2013 12:45:34 +1100
changeset 173998 8737eca5b787d64671d46189b22651b4c5ec498d
parent 173997 eb8d750eabb381ba972977bd73c6306891aeeade
child 173999 29dd3fb48a443a43d2da5757319e691c38beac86
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmixedpuppy
bugs939643
milestone28.0a1
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
Bug 939643 - Avoid test orange by rejigging how we wait for blocklist window. r=mixedpuppy
browser/base/content/test/social/browser_blocklist.js
--- a/browser/base/content/test/social/browser_blocklist.js
+++ b/browser/base/content/test/social/browser_blocklist.js
@@ -129,27 +129,29 @@ var tests = {
     let listener = {
       _window: null,
       onOpenWindow: function(aXULWindow) {
         Services.wm.removeListener(this);
         this._window = aXULWindow;
         let domwindow = aXULWindow.QueryInterface(Ci.nsIInterfaceRequestor)
                                   .getInterface(Ci.nsIDOMWindow);
 
-        domwindow.addEventListener("unload", function _unload() {
-          domwindow.removeEventListener("unload", _unload, false);
-          windowWasClosed = true;
+        domwindow.addEventListener("load", function _load() {
+          domwindow.removeEventListener("load", _load, false);
+
+          domwindow.addEventListener("unload", function _unload() {
+            domwindow.removeEventListener("unload", _unload, false);
+            info("blocklist window was closed");
+            windowWasClosed = true;
+          }, false);
+
+          is(domwindow.document.location.href, URI_EXTENSION_BLOCKLIST_DIALOG, "dialog opened and focused");
+          domwindow.close();
+
         }, false);
-        info("dialog opened, waiting for focus");
-        waitForFocus(function() {
-          is(domwindow.document.location.href, URI_EXTENSION_BLOCKLIST_DIALOG, "dialog opened and focused");
-          executeSoon(function() {
-            domwindow.close();
-          });
-        }, domwindow);
       },
       onCloseWindow: function(aXULWindow) { },
       onWindowTitleChange: function(aXULWindow, aNewTitle) { }
     };
 
     Services.wm.addListener(listener);
 
     setManifestPref("social.manifest.blocked", manifest_bad);