diff --git a/dom/events/test/test_bug574663.html b/dom/events/test/test_bug574663.html index 64f0d6c69ed8..164fdcf41d73 100644 --- a/dom/events/test/test_bug574663.html +++ b/dom/events/test/test_bug574663.html @@ -48,8 +48,8 @@ function waitForPaint(win, utils, callback) { } // This is a magic number representing how many device pixels we are attempting to -// scroll or zoom. We use it for sending the wheel events, and for checking the -// outcome of the events that are expected to trigger scrolling. +// scroll or zoom. We use it for sending the wheel events, but we don't actually +// check that we have scrolled by that amount. var kDelta = 3; function sendTouchpadScrollMotion(scrollbox, direction, ctrl, momentum, callback) { @@ -68,14 +68,15 @@ function sendTouchpadScrollMotion(scrollbox, direction, ctrl, momentum, callback // --- Intermittent Warning --- // Two wheel events are sent, but our promise resolves when any change has been // made to scroll or zoom. That makes it possible that the effect of the second - // event may not yet be applied when the promise resolves, which will lead to a - // failure when checking the expected value for scrolling. This was done - // intentionally, because attempting to wait after both events yields problems - // when the second event has no effect, which does happen in testing. It's - // not clear why this is happening. Since the testing pattern is scroll (twice), - // then scroll back (twice), it's possible that the first scroll back event is - // sufficient to return the scrollbox to its minimal scrollTop position, and - // therefore the second event doesn't scroll any further. + // event may not yet be applied when the promise resolves. This shouldn't lead + // to any errors, since the two wheel events are moving in the same direction, + // and our later checks will only ensure that the value has changed from its + // initial value. This was done intentionally, because attempting to wait after + // both events yields problems when the second event has no effect, which does + // happen in testing. It's not clear why this is happening. Since the testing + // pattern is scroll (twice), then scroll back (twice), it's possible that the + // first scroll back event is sufficient to return the scrollbox to its minimal + // scrollTop position, and so the second event doesn't scroll any further. const initialZoom = winUtils.fullZoom; const initialScroll = scrollbox.scrollTop; @@ -143,7 +144,7 @@ function runTest() { let postfix = isMomentum ? ", even after releasing the touchpad" : ""; // Normal scroll: scroll is(winUtils.fullZoom, zoomFactorBefore, "Normal scrolling shouldn't change zoom" + postfix); - is(scrollbox.scrollTop, scrollTopBefore + kDelta * 2, + isnot(scrollbox.scrollTop, scrollTopBefore, "Normal scrolling should scroll" + postfix); } else { if (!isMomentum) { @@ -151,7 +152,7 @@ function runTest() { is(scrollbox.scrollTop, scrollTopBefore, "Ctrl-scrolling shouldn't scroll while the user is touching the touchpad"); } else { is(winUtils.fullZoom, zoomFactorBefore, "Momentum scrolling shouldn't zoom, even when pressing Ctrl"); - is(scrollbox.scrollTop, scrollTopBefore + kDelta * 2, + isnot(scrollbox.scrollTop, scrollTopBefore, "Momentum scrolling should scroll, even when pressing Ctrl"); } }