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

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: 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
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..1b44e23b8a03300cce30fba4ccda91ba2a7ca012 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 succeed or failureTime is reached.
skobes 2015/11/06 22:30:23 "succeeds"
ymalik 2015/11/07 04:22:27 Done.
// 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);
+ window.requestAnimationFrame(function() {
skobes 2015/11/06 22:30:23 "window." is not needed
ymalik 2015/11/07 04:22:27 Done.
+ _waitForCondition(condition, failureTime, completionHandler, failureHandler);
+ });
}
}

Powered by Google App Engine
This is Rietveld 408576698