From 7210b1aa4bafc7d54f0236e613ef962183206525 Mon Sep 17 00:00:00 2001 From: Shane Caraveo Date: Mon, 27 May 2013 12:20:01 -0700 Subject: [PATCH] bug 860421 fix intermittent chatwindow test failure, r=felipe --- .../content/test/social/browser_social_chatwindow.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/browser/base/content/test/social/browser_social_chatwindow.js b/browser/base/content/test/social/browser_social_chatwindow.js index a2340c9a6df1..3329f38ac302 100644 --- a/browser/base/content/test/social/browser_social_chatwindow.js +++ b/browser/base/content/test/social/browser_social_chatwindow.js @@ -663,15 +663,16 @@ function resizeWindowToChatAreaWidth(desired, cb) { } // Otherwise we request resize and expect a resize event window.addEventListener("resize", function resize_handler() { - window.removeEventListener("resize", resize_handler); // we did resize - but did we get far enough to be able to continue? let newSize = window.SocialChatBar.chatbar.getBoundingClientRect().width; let sizedOk = widthDeltaCloseEnough(newSize - desired); if (!sizedOk) { - // not an error... - info("skipping this as we can't resize chat area to " + desired + " - got " + newSize); + return; } - cb(sizedOk); + window.removeEventListener("resize", resize_handler); + executeSoon(function() { + cb(sizedOk); + }); }); window.resizeBy(delta, 0); }