diff --git a/browser/components/tabview/test/browser_tabview_bug625269.js b/browser/components/tabview/test/browser_tabview_bug625269.js index 08a0636bbd8a..47cc3c016df0 100644 --- a/browser/components/tabview/test/browser_tabview_bug625269.js +++ b/browser/components/tabview/test/browser_tabview_bug625269.js @@ -66,11 +66,16 @@ function resizeWindow(win, diffX, diffY, callback) { (function tryResize() { let {outerWidth: width, outerHeight: height} = win; - if (width != targetWidth || height != targetHeight) { - win.resizeTo(targetWidth, targetHeight); - executeSoon(tryResize); - } else { - callback(); + if (width == targetWidth && height == targetHeight) { + executeSoon(callback); + return; } + + win.addEventListener("resize", function onResize() { + win.removeEventListener("resize", onResize); + executeSoon(tryResize); + }); + + win.resizeTo(targetWidth, targetHeight); })(); }