blob: d19c904d39d86d561cb8beb68690e53f00e76a3c [file] [log] [blame]
<!DOCTYPE HTML>
<html>
<body>
<video id="testVideo" controls></video>
<div id="log"></div>
<p>Test that pausing the media element in "playing" event handler pauses the media element.</p>
<script src="./w3c-media-utils.js"></script>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script>
async_test(function(test)
{
var video = document.getElementById("testVideo");
video.src = getVideoURI("test");
waitForEventAndRunStep("timeupdate", video);
waitForEventAndRunStep("playing", video, function ()
{
video.pause();
});
// function to be run when "pause" fires.
var pauseCheck = function()
{
assert_true(video.paused, "Video is paused.");
test.done();
}
waitForEventAndRunStep("pause", video, pauseCheck, test);
video.play();
}, "Verifies pause actually pauses.");
</script>
</body>
</html>