blob: 0eeb6336e4ed341233877f173ec7365ce8f430b2 [file] [log] [blame]
<!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
promise_test(async t => {
await animation.ready;
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>