blob: 85932856b9a9d165513e80442d0bc4f671f9fe16 [file] [log] [blame]
<!DOCTYPE html>
<title>Test behavior when seeking to the duration and the playback rate equals 0.</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 video = document.querySelector("video");
video.src = findMediaFile("video", "content/test");
video.load();
video.onseeking = t.step_func(function() {});
video.onloadedmetadata = t.step_func(function() {
video.onloadedmetadata = null;
video.currentTime = video.duration;
video.playbackRate = 0;
video.onended = t.step_func(function() {
assert_equals(video.currentTime, video.duration);
// Seeking to the middle of the video.
video.currentTime = video.duration / 2;
video.onseeked = t.step_func(function() {
// Setting loop to true and seeking to duration.
video.loop = true;
video.currentTime = video.duration;
video.onseeked = t.step_func(function() {
// Seek to duration completed. Waiting for a seek to the beginning.
video.onseeked = t.step_func_done(function() {
assert_equals(video.currentTime, 0);
});
});
});
});
});
});
</script>