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 167933 62074ff7e99354d0bfafc493956eb1e3f17be9a8
parent 167930 00b274fbebf360b89239cb303f4077f18997c4c7
child 167934 8e90d365bd124de423b00baf77321ab56b190064
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, test-only
bugs960309, 625269
milestone27.0
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();
+    }
+  })();
 }