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

Side by Side Diff: third_party/WebKit/LayoutTests/web-animations-api/time-consistent-across-frames.html

Issue 2138153003: Prepare time-consistent-across-frames for upstreaming (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <meta charset=utf-8>
3 <title>Model liveness: currentTime will not change in a task (frames)</title
4 <link rel="help" href="https://w3c.github.io/web-animations/#model-liveness">
2 <script src="../resources/testharness.js"></script> 5 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 6 <script src="../resources/testharnessreport.js"></script>
4 7
5 <iframe id=frame></iframe> 8 <iframe id=frame></iframe>
6 9
7 <script> 10 <script>
8 var handle = async_test('Animation time should tick consistently across frames') ; 11 var handle = async_test('Document timeline should tick consistently across frame s');
9 var baseTime = document.timeline.currentTime; 12 var baseTime = document.timeline.currentTime;
10 var frameBaseTime = frame.contentDocument.timeline.currentTime; 13 var frameBaseTime = frame.contentDocument.timeline.currentTime;
11 setTimeout(function() { 14 setTimeout(() => {
15 // Ensure that time in this task has advanced sufficiently for implementations
16 // that might bind the currentTime lazily.
12 var start = performance.now(); 17 var start = performance.now();
13 while (performance.now() - start < 30); 18 while (performance.now() - start < 30);
14 var delta = document.timeline.currentTime - baseTime; 19 var delta = document.timeline.currentTime - baseTime;
15 20
21 // Advance time further before querying the frame's time.
16 var start = performance.now(); 22 var start = performance.now();
17 while (performance.now() - start < 30); 23 while (performance.now() - start < 30);
alancutter (OOO until 2018) 2016/07/12 04:23:27 Can we use requestAnimationFrame instead of setTim
18 var frameDelta = frame.contentDocument.timeline.currentTime - frameBaseTime; 24 var frameDelta = frame.contentDocument.timeline.currentTime - frameBaseTime;
19 25
20 handle.step(() => assert_equals(Math.round(delta), Math.round(frameDelta))); 26 handle.step(() => assert_times_equals(delta, frameDelta);
suzyh_UTC10 (ex-contributor) 2016/07/13 22:45:25 Missed this the first time around. The function is
21 handle.done(); 27 handle.done();
22 }); 28 });
23 </script> 29 </script>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698