OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../resources/testharness.js"></script> | 2 <script src="../resources/testharness.js"></script> |
3 <script src="../resources/testharnessreport.js"></script> | 3 <script src="../resources/testharnessreport.js"></script> |
4 | 4 |
5 <script> | 5 <script> |
6 test(function() { | 6 test(function() { |
7 var startTime = document.timeline.currentTime; | 7 var startTime = document.timeline.currentTime; |
8 assert_greater_than_equal(startTime, 0); | 8 assert_greater_than_equal(startTime, 0); |
9 var start = performance.now(); | 9 var start = performance.now(); |
10 while (performance.now() < start + 250) | 10 while (performance.now() < start + 250) |
(...skipping 25 matching lines...) Expand all Loading... |
36 }); | 36 }); |
37 }); | 37 }); |
38 | 38 |
39 requestAnimationFrame(function() { | 39 requestAnimationFrame(function() { |
40 rafTest.step(function() { | 40 rafTest.step(function() { |
41 assert_equals(document.timeline.currentTime, firstRafTime); | 41 assert_equals(document.timeline.currentTime, firstRafTime); |
42 }); | 42 }); |
43 rafTest.done(); | 43 rafTest.done(); |
44 }); | 44 }); |
45 })(); | 45 })(); |
| 46 |
| 47 (function() { |
| 48 var timeoutTest = async_test('document.timeline.currentTime time should use th
e same reference as performance.now()'); |
| 49 |
| 50 setTimeout(function() { |
| 51 timeoutTest.step(function() { |
| 52 assert_less_than(Math.abs(document.timeline.currentTime - performance.now(
)), 1000); |
| 53 }); |
| 54 timeoutTest.done(); |
| 55 }, 0); |
| 56 })(); |
46 </script> | 57 </script> |
OLD | NEW |