Bug 960309 - Make browser_tabview_bug625269.js more reliable. r=roc, a=test-only
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Thu, 16 Jan 2014 15:37:16 +0200
changeset 175814 cc07e69e7887852b5a066d1f2e747cd273da3a29
parent 175813 0ef32c69e80cdfe05b98223cb9f3ee683f5abbb6
child 175815 9c59eb7fb40c6ffc5feddc3e0b4eeaef6fe20f1b
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)
reviewersroc, test-only
bugs960309, 625269
milestone28.0a2
Bug 960309 - Make browser_tabview_bug625269.js more reliable. r=roc, a=test-only
browser/components/tabview/test/browser_tabview_bug625269.js
--- a/browser/components/tabview/test/browser_tabview_bug625269.js
+++ b/browser/components/tabview/test/browser_tabview_bug625269.js
@@ -59,19 +59,18 @@ function onTabViewShown(win) {
   next();
 }
 
 // ----------
 function resizeWindow(win, diffX, diffY, callback) {
   let targetWidth = win.outerWidth + diffX;
   let targetHeight = win.outerHeight + diffY;
 
-  win.addEventListener("resize", function onResize() {
+  (function tryResize() {
     let {outerWidth: width, outerHeight: height} = win;
-    if (width != targetWidth || height != targetHeight)
-      return;
-
-    win.removeEventListener("resize", onResize, false);
-    executeSoon(callback);
-  }, false);
-
-  win.resizeBy(diffX, diffY);
+    if (width != targetWidth || height != targetHeight) {
+      win.resizeTo(targetWidth, targetHeight);
+      executeSoon(tryResize);
+    } else {
+      callback();
+    }
+  })();
 }