| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <meta charset=utf-8> | 2 <meta charset=utf-8> |
| 3 <title>Model liveness: currentTime will not change in a task (frames)</title> | 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"> | 4 <link rel="help" href="https://w3c.github.io/web-animations/#model-liveness"> |
| 5 <script src="../resources/testharness.js"></script> | 5 <script src="../resources/testharness.js"></script> |
| 6 <script src="../resources/testharnessreport.js"></script> | 6 <script src="../resources/testharnessreport.js"></script> |
| 7 <script src="../imported/wpt/web-animations/testcommon.js"></script> | 7 <script src="../external/wpt/web-animations/testcommon.js"></script> |
| 8 | 8 |
| 9 <iframe id=frame></iframe> | 9 <iframe id=frame></iframe> |
| 10 | 10 |
| 11 <script> | 11 <script> |
| 12 var handle = async_test('Document timeline should tick consistently across frame
s'); | 12 var handle = async_test('Document timeline should tick consistently across frame
s'); |
| 13 var baseTime = document.timeline.currentTime; | 13 var baseTime = document.timeline.currentTime; |
| 14 var frameBaseTime = frame.contentDocument.timeline.currentTime; | 14 var frameBaseTime = frame.contentDocument.timeline.currentTime; |
| 15 setTimeout(() => { | 15 setTimeout(() => { |
| 16 // Ensure that time in this task has advanced sufficiently for implementations | 16 // Ensure that time in this task has advanced sufficiently for implementations |
| 17 // that might bind the currentTime lazily. | 17 // that might bind the currentTime lazily. |
| 18 var start = performance.now(); | 18 var start = performance.now(); |
| 19 while (performance.now() - start < 30); | 19 while (performance.now() - start < 30); |
| 20 var delta = document.timeline.currentTime - baseTime; | 20 var delta = document.timeline.currentTime - baseTime; |
| 21 | 21 |
| 22 // Advance time further before querying the frame's time. | 22 // Advance time further before querying the frame's time. |
| 23 var start = performance.now(); | 23 var start = performance.now(); |
| 24 while (performance.now() - start < 30); | 24 while (performance.now() - start < 30); |
| 25 var frameDelta = frame.contentDocument.timeline.currentTime - frameBaseTime; | 25 var frameDelta = frame.contentDocument.timeline.currentTime - frameBaseTime; |
| 26 | 26 |
| 27 handle.step(() => assert_times_equal(delta, frameDelta)); | 27 handle.step(() => assert_times_equal(delta, frameDelta)); |
| 28 handle.done(); | 28 handle.done(); |
| 29 }); | 29 }); |
| 30 </script> | 30 </script> |
| OLD | NEW |