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

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

Issue 2149053002: 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>
7 <script src="../imported/wpt/web-animations/testcommon.js"></script>
4 8
5 <iframe id=frame></iframe> 9 <iframe id=frame></iframe>
6 10
7 <script> 11 <script>
8 var handle = async_test('Animation time should tick consistently across frames') ; 12 var handle = async_test('Document timeline should tick consistently across frame s');
9 var baseTime = document.timeline.currentTime; 13 var baseTime = document.timeline.currentTime;
10 var frameBaseTime = frame.contentDocument.timeline.currentTime; 14 var frameBaseTime = frame.contentDocument.timeline.currentTime;
11 setTimeout(function() { 15 setTimeout(() => {
16 // Ensure that time in this task has advanced sufficiently for implementations
17 // that might bind the currentTime lazily.
12 var start = performance.now(); 18 var start = performance.now();
13 while (performance.now() - start < 30); 19 while (performance.now() - start < 30);
14 var delta = document.timeline.currentTime - baseTime; 20 var delta = document.timeline.currentTime - baseTime;
15 21
22 // Advance time further before querying the frame's time.
16 var start = performance.now(); 23 var start = performance.now();
17 while (performance.now() - start < 30); 24 while (performance.now() - start < 30);
18 var frameDelta = frame.contentDocument.timeline.currentTime - frameBaseTime; 25 var frameDelta = frame.contentDocument.timeline.currentTime - frameBaseTime;
19 26
20 handle.step(() => assert_equals(Math.round(delta), Math.round(frameDelta))); 27 handle.step(() => assert_times_equal(delta, frameDelta));
21 handle.done(); 28 handle.done();
22 }); 29 });
23 </script> 30 </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