Bug 944125 - test_bug602962.xul is racy. r=ehsan, a=test-only
--- a/content/events/test/test_bug602962.xul
+++ b/content/events/test/test_bug602962.xul
@@ -68,16 +68,22 @@ function resize() {
finish();
}, 0);
}, true);
win.resizeTo(oldWidth, oldHeight);
}
function finish() {
+ if (win.outerWidth != oldWidth ||
+ win.outerHeight != oldHeight) {
+ // We should eventually get back to the original size.
+ setTimeout(finish, 0);
+ return;
+ }
is(mozBeforeResizeHasFired, true, "The MozBeforeResize event should already have fired");
sbo.scrollBy(scrollX, scrollY);
let x = {}, y = {};
sbo.getPosition(x, y);
is(x.value, 200, "Scroll X should have been restored to the value before the resize");
is(y.value, 0, "Scroll Y should have been restored to the value before the resize");