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

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/web-animations/testcommon.js

Issue 2408493002: Import wpt@357b83b809e3cbc7a1805e7c3ca108a7980d782f (Closed)
Patch Set: Added one more win7-specific baseline Created 4 years, 2 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
Index: third_party/WebKit/LayoutTests/imported/wpt/web-animations/testcommon.js
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/web-animations/testcommon.js b/third_party/WebKit/LayoutTests/imported/wpt/web-animations/testcommon.js
index e375a0f8741788984f9c7be658a3b88c7396c0ff..31ebdfaf279deca00ef5384fd7d347e1cf00e8e1 100644
--- a/third_party/WebKit/LayoutTests/imported/wpt/web-animations/testcommon.js
+++ b/third_party/WebKit/LayoutTests/imported/wpt/web-animations/testcommon.js
@@ -158,3 +158,19 @@ function waitForAnimationFrames(frameCount) {
window.requestAnimationFrame(handleFrame);
});
}
+
+// Continually calls requestAnimationFrame until |minDelay| has elapsed
+// as recorded using document.timeline.currentTime (i.e. frame time not
+// wall-clock time).
+function waitForAnimationFramesWithDelay(minDelay) {
+ var startTime = document.timeline.currentTime;
+ return new Promise(function(resolve) {
+ (function handleFrame() {
+ if (document.timeline.currentTime - startTime >= minDelay) {
+ resolve();
+ } else {
+ window.requestAnimationFrame(handleFrame);
+ }
+ }());
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698