Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/web-animations-api/time-consistent-across-frames.html |
| diff --git a/third_party/WebKit/LayoutTests/web-animations-api/time-consistent-across-frames.html b/third_party/WebKit/LayoutTests/web-animations-api/time-consistent-across-frames.html |
| index f72f665680b54548a42dd5bfb15b8129a6e84445..faedd37bc7621d710df8a49dd8dcbd62e1bd8d11 100644 |
| --- a/third_party/WebKit/LayoutTests/web-animations-api/time-consistent-across-frames.html |
| +++ b/third_party/WebKit/LayoutTests/web-animations-api/time-consistent-across-frames.html |
| @@ -1,23 +1,29 @@ |
| <!DOCTYPE html> |
| +<meta charset=utf-8> |
| +<title>Model liveness: currentTime will not change in a task (frames)</title |
| +<link rel="help" href="https://w3c.github.io/web-animations/#model-liveness"> |
| <script src="../resources/testharness.js"></script> |
| <script src="../resources/testharnessreport.js"></script> |
| <iframe id=frame></iframe> |
| <script> |
| -var handle = async_test('Animation time should tick consistently across frames'); |
| +var handle = async_test('Document timeline should tick consistently across frames'); |
| var baseTime = document.timeline.currentTime; |
| var frameBaseTime = frame.contentDocument.timeline.currentTime; |
| -setTimeout(function() { |
| +setTimeout(() => { |
| + // Ensure that time in this task has advanced sufficiently for implementations |
| + // that might bind the currentTime lazily. |
| var start = performance.now(); |
| while (performance.now() - start < 30); |
| var delta = document.timeline.currentTime - baseTime; |
| + // Advance time further before querying the frame's time. |
| var start = performance.now(); |
| while (performance.now() - start < 30); |
|
alancutter (OOO until 2018)
2016/07/12 04:23:27
Can we use requestAnimationFrame instead of setTim
|
| var frameDelta = frame.contentDocument.timeline.currentTime - frameBaseTime; |
| - handle.step(() => assert_equals(Math.round(delta), Math.round(frameDelta))); |
| + 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
|
| handle.done(); |
| }); |
| </script> |