Index: LayoutTests/fast/scroll-behavior/resources/scroll-behavior-test.js |
diff --git a/LayoutTests/fast/scroll-behavior/resources/scroll-behavior-test.js b/LayoutTests/fast/scroll-behavior/resources/scroll-behavior-test.js |
index 6ed5b3b7fc899698964eab9f7641049b8a608a91..6506ff9619e1ed741640ee4e64bc5f0eaf468735 100644 |
--- a/LayoutTests/fast/scroll-behavior/resources/scroll-behavior-test.js |
+++ b/LayoutTests/fast/scroll-behavior/resources/scroll-behavior-test.js |
@@ -36,8 +36,13 @@ ScrollBehaviorTest.prototype.scrollListener = function(testCase) { |
// Wait for an intermediate frame, then instant-scroll to the end state. |
if ((this.scrollElement.scrollLeft != testCase.startX || this.scrollElement.scrollTop != testCase.startY) && |
(this.scrollElement.scrollLeft != testCase.endX || this.scrollElement.scrollTop != testCase.endY)) { |
+ // Instant scroll, and then wait for the next scroll event. This allows |
+ // the instant scroll to propagate to the compositor (when using |
+ // composited scrolling) so that the next smooth scroll starts at this |
+ // position (the compositor always starts smooth scrolls at the current |
+ // scroll position on the compositor thread). |
this.scrollElement.scrollTo({left: testCase.endX, top: testCase.endY, behavior: "instant"}); |
- this.testCaseComplete(); |
+ testCase.waitForEnd = true; |
} |
}; |
@@ -95,7 +100,7 @@ ScrollBehaviorTest.prototype.testCaseComplete = function() { |
} |
ScrollBehaviorTest.prototype.run = function() { |
- setup({explicit_done: true}); |
+ setup({explicit_done: true, explicit_timeout: true}); |
this.startNextTestCase(); |
} |