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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 Distributed under both the W3C Test Suite License [1] and the W3C 2 Distributed under both the W3C Test Suite License [1] and the W3C
3 3-clause BSD License [2]. To contribute to a W3C Test Suite, see the 3 3-clause BSD License [2]. To contribute to a W3C Test Suite, see the
4 policies and contribution forms [3]. 4 policies and contribution forms [3].
5 5
6 [1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license 6 [1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license
7 [2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license 7 [2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license
8 [3] http://www.w3.org/2004/10/27-testcases 8 [3] http://www.w3.org/2004/10/27-testcases
9 */ 9 */
10 10
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 function handleFrame() { 151 function handleFrame() {
152 if (--frameCount <= 0) { 152 if (--frameCount <= 0) {
153 resolve(); 153 resolve();
154 } else { 154 } else {
155 window.requestAnimationFrame(handleFrame); // wait another frame 155 window.requestAnimationFrame(handleFrame); // wait another frame
156 } 156 }
157 } 157 }
158 window.requestAnimationFrame(handleFrame); 158 window.requestAnimationFrame(handleFrame);
159 }); 159 });
160 } 160 }
161
162 // Continually calls requestAnimationFrame until |minDelay| has elapsed
163 // as recorded using document.timeline.currentTime (i.e. frame time not
164 // wall-clock time).
165 function waitForAnimationFramesWithDelay(minDelay) {
166 var startTime = document.timeline.currentTime;
167 return new Promise(function(resolve) {
168 (function handleFrame() {
169 if (document.timeline.currentTime - startTime >= minDelay) {
170 resolve();
171 } else {
172 window.requestAnimationFrame(handleFrame);
173 }
174 }());
175 });
176 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698