blob: 1bc3c2e6e4e31acb281c0cc4eab3b1f29f0d8e3b [file] [log] [blame]
<!DOCTYPE html>
<title>Test that calling play() and pause() triggers async play, timeupdate and pause events.</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 eventCount = 0;
var video = document.querySelector("video");
video.onloadstart = t.step_func(function() {});
video.onratechange = t.step_func(function() {});
video.onwaiting = t.step_func(function() {});
video.ondurationchange = t.step_func(function() {});
video.onloadedmetadata = t.step_func(function() {});
video.onloadeddata = t.step_func(function() {});
video.oncanplay = t.step_func(function() {});
video.oncanplaythrough = t.step_func(function() {});
video.onplay = t.step_func(function() {
eventCount++;
});
video.ontimeupdate = t.step_func(function() {
eventCount++;
});
video.onpause = t.step_func_done(function () {
assert_equals(eventCount, 2);
assert_true(video.paused);
});
video.src = findMediaFile("video", "content/test");
video.play();
video.pause();
});
</script>