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

Unified Diff: third_party/WebKit/LayoutTests/resources/js-test.js

Issue 1413493005: Update layout tests to work when smooth scrolling is enabled by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: worked on nit Created 5 years, 1 month 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 | « third_party/WebKit/LayoutTests/platform/win/fast/events/platform-wheelevent-paging-y-in-scrolling-page-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/resources/js-test.js
diff --git a/third_party/WebKit/LayoutTests/resources/js-test.js b/third_party/WebKit/LayoutTests/resources/js-test.js
index ba1d8acddd5a9f64898389d1ea286d6425746baf..2811201b62f53e4e7dcf8ffed4900af8857a9cf8 100644
--- a/third_party/WebKit/LayoutTests/resources/js-test.js
+++ b/third_party/WebKit/LayoutTests/resources/js-test.js
@@ -269,7 +269,7 @@ function shouldBe(_a, _b, quiet, opt_tolerance)
testFailed(_a + " should be " + _bv + " (of type " + typeof _bv + "). Was " + _av + " (of type " + typeof _av + ").");
}
-// Execute condition every 5 milliseconds until it succeed or failureTime is reached.
+// Execute condition every animation frame until it succeeds or failureTime is reached.
// completionHandler is executed on success, failureHandler is executed on timeout.
function _waitForCondition(condition, failureTime, completionHandler, failureHandler)
{
@@ -278,7 +278,9 @@ function _waitForCondition(condition, failureTime, completionHandler, failureHan
} else if (Date.now() > failureTime) {
failureHandler();
} else {
- setTimeout(_waitForCondition, 5, condition, failureTime, completionHandler, failureHandler);
+ requestAnimationFrame(function() {
+ _waitForCondition(condition, failureTime, completionHandler, failureHandler);
+ });
}
}
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/win/fast/events/platform-wheelevent-paging-y-in-scrolling-page-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698