blob: ecd3e797a87d86c6330641285efecb7d968416d1 [file] [log] [blame]
<!DOCTYPE HTML>
<title>Test seeking by very small increments.</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="media-file.js"></script>
<video></video>
<script>
async_test(function(t) {
var seekedEventCount = 0;
var increment = 0;
var video = document.querySelector("video");
video.currentTime = seekIncrement();
video.onseeked = t.step_func(function() {
if (++seekedEventCount == 8) {
t.done();
return;
}
video.currentTime += seekIncrement();
});
function seekIncrement() {
// We want to verify that seeking by an increment smaller than the test movie's
// time scale(the smallest unit of time in that file) succeeds. test.mp4 has a time // scale of 2500, 0.0004 seconds, so start with that and decrease by half each time.
if (!increment)
increment = 0.0004;
else
increment /= 2;
return increment;
}
video.onseeking = t.step_func(function() {});
video.onplay = t.step_func(function() {});
video.onpause = t.step_func(function() {});
video.src = findMediaFile("video", "content/test");
});
</script>