blob: 8e586461e146f290fbd7f76f88b156948efda3d8 [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>
<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 = "content/test.ogv";
video.play();
video.pause();
});
</script>