| <!DOCTYPE html> |
| <script src="../../resources/testharness.js"></script> |
| <script src="../../resources/testharnessreport.js"></script> |
| <body></body> |
| <script> |
| 'use strict'; |
| // From UseCounter.h |
| var AnimationSetPlaybackRateCompensatorySeek = 2162; |
| var MS_PER_SEC = 1000; |
| function createDiv() { |
| var element = document.createElement('div'); |
| document.body.appendChild(element); |
| return element; |
| } |
| |
| var div = createDiv(); |
| var animation = div.animate(null, 100 * MS_PER_SEC); |
| var startTimeBefore = animation.startTime; |
| animation.currentTime = 7 * MS_PER_SEC; // ms |
| |
| async_test(t => { |
| return animation.ready.then(t.step_func_done(() => { |
| animation.finish(); |
| assert_equals(animation.playState, "finished"); |
| |
| assert_not_equals(animation.startTime, null) |
| animation.playbackRate = 0.5; |
| |
| assert_false(internals.isUseCounted(document, AnimationSetPlaybackRateCompensatorySeek)); |
| })) |
| }, 'Check to ensure that we UseCount when you cause a compensatory seek by setting playbackRate when finished'); |
| </script> |