Bug 1386130 - Actually wait for up to 30 frames to test scroll. r?dholbert
The frame count test was inverted (should be '>' not '<'), causing
the test to never actually wait up to 30 frames to test the scroll
position. The test will also now explicitly fail if the frame count
is reached to make finding this issue easier in the future.
--- a/layout/base/tests/test_scroll_snapping_scrollbars.html
+++ b/layout/base/tests/test_scroll_snapping_scrollbars.html
@@ -258,19 +258,23 @@ function doTest() {
stopFrameCount = 0;
waitForScrollStart();
}
function waitForScrollStart() {
// Wait for up to 30 frames for scrolling to start
var testCase = testCases[step];
- if (testCase.startScroll.y != sc.scrollTop
- || testCase.startScroll.x != sc.scrollLeft
- || ++stopFrameCount < 30) {
+ if (++stopFrameCount > 30) {
+ ok(false,
+ "Step " + step + ": Frame count limit reached without scrolling." +
+ "(" + testCase.description + ")");
+ window.requestAnimationFrame(doMouseUp);
+ } else if (testCase.startScroll.y != sc.scrollTop
+ || testCase.startScroll.x != sc.scrollLeft) {
window.requestAnimationFrame(doMouseUp);
} else {
window.requestAnimationFrame(waitForScrollStart);
}
}
function doMouseUp() {
var testCase = testCases[step];