35 lines
1.0 KiB
HTML
35 lines
1.0 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<script src=media-file.js></script>
|
|
<script src=video-test.js></script>
|
|
<script>
|
|
function runTest() {
|
|
findMediaElement();
|
|
run('video.src = findMediaFile("audio", "content/silence")');
|
|
|
|
waitForEvent("loadstart");
|
|
waitForEvent("ratechange");
|
|
waitForEvent("waiting");
|
|
waitForEvent("ratechange");
|
|
waitForEvent("durationchange");
|
|
waitForEvent("loadedmetadata");
|
|
waitForEvent("loadeddata");
|
|
waitForEvent("canplay");
|
|
waitForEvent("canplaythrough");
|
|
waitForEvent("play");
|
|
waitForEvent("timeupdate");
|
|
waitForEvent('pause', function () { testExpected("video.paused", true); endTest(); } );
|
|
|
|
run("handlePromise(video.play())");
|
|
run("video.pause()");
|
|
}
|
|
</script>
|
|
</head>
|
|
|
|
<body onload="runTest()">
|
|
<p>Test that calling play() and pause() on a video element with audio source triggers play and pause events.</p>
|
|
<video controls></video>
|
|
</body>
|
|
</html>
|