Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Unified Diff: LayoutTests/fast/scroll-behavior/resources/scroll-behavior-test.js

Issue 872433002: Fix flake in threaded CSSOM smooth scroll layout tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/scroll-behavior/resources/scroll-interruption-test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6506ff9619e1ed741640ee4e64bc5f0eaf468735..cc4df808390bf0e4a9670eadc3ec5054666bf5f7 100644
--- a/LayoutTests/fast/scroll-behavior/resources/scroll-behavior-test.js
+++ b/LayoutTests/fast/scroll-behavior/resources/scroll-behavior-test.js
@@ -27,15 +27,17 @@ function ScrollBehaviorTest(scrollElement,
}
ScrollBehaviorTest.prototype.scrollListener = function(testCase) {
- if (testCase.waitForEnd) {
- if (this.scrollElement.scrollLeft == testCase.endX && this.scrollElement.scrollTop == testCase.endY)
- this.testCaseComplete();
+ var endReached = (this.scrollElement.scrollLeft == testCase.endX && this.scrollElement.scrollTop == testCase.endY);
+ if (endReached) {
+ this.testCaseComplete();
return;
}
- // 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)) {
+ if (testCase.waitForEnd)
+ return;
+
+ // Wait for the animation to start, then instant-scroll to the end state.
+ if (this.scrollElement.scrollLeft != testCase.startX || this.scrollElement.scrollTop != testCase.startY) {
// 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
« no previous file with comments | « no previous file | LayoutTests/fast/scroll-behavior/resources/scroll-interruption-test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698