| 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 13 matching lines...) Expand all Loading... |
| 24 }, 100); | 24 }, 100); |
| 25 })(); | 25 })(); |
| 26 | 26 |
| 27 (function() { | 27 (function() { |
| 28 var rafTest = async_test('document.timeline.currentTime time should be the sam
e for all RAF callbacks in a frame'); | 28 var rafTest = async_test('document.timeline.currentTime time should be the sam
e for all RAF callbacks in a frame'); |
| 29 var startTime = document.timeline.currentTime; | 29 var startTime = document.timeline.currentTime; |
| 30 var firstRafTime; | 30 var firstRafTime; |
| 31 | 31 |
| 32 requestAnimationFrame(function() { | 32 requestAnimationFrame(function() { |
| 33 rafTest.step(function() { | 33 rafTest.step(function() { |
| 34 assert_greater_than(document.timeline.currentTime, startTime); | 34 assert_greater_than_equal(document.timeline.currentTime, startTime); |
| 35 firstRafTime = document.timeline.currentTime; | 35 firstRafTime = document.timeline.currentTime; |
| 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 rafTest = async_test('document.timeline.currentTime time should be consist
ent with the time value passed to RAF callbacks'); | |
| 49 var firstRafTime; | |
| 50 var firstRafDelta; | |
| 51 | |
| 52 requestAnimationFrame(function(t) { | |
| 53 rafTest.step(function() { | |
| 54 firstRafTime = document.timeline.currentTime; | |
| 55 firstRafDelta = document.timeline.currentTime - t; | |
| 56 }); | |
| 57 | |
| 58 requestAnimationFrame(function(t) { | |
| 59 rafTest.step(function() { | |
| 60 assert_greater_than(document.timeline.currentTime, firstRafTime); | |
| 61 assert_equals(document.timeline.currentTime - t, firstRafDelta); | |
| 62 }); | |
| 63 rafTest.done(); | |
| 64 }); | |
| 65 }); | |
| 66 })(); | |
| 67 </script> | 46 </script> |
| OLD | NEW |