blob: ca82c4c96e2ee7363b579755b26ca6b8172e8637 [file] [log] [blame]
<!DOCTYPE html>
<title>Test that pausing the media element has an immediate effect on the clock.</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 timeAfterPause;
var video = document.querySelector("video");
video.src = findMediaFile("video", "content/test");
video.oncanplay = t.step_func(function() {
video.play();
});
video.onplaying = t.step_func(function() {
video.ontimeupdate = t.step_func(function() {
assert_greater_than(video.currentTime, 0);
video.ontimeupdate = null;
video.pause();
timeAfterPause = video.currentTime;
});
});
video.onpause = t.step_func_done(function() {
assert_equals(video.currentTime, timeAfterPause);
assert_equals(video.played.end(0), timeAfterPause);
});
});
</script>