<!DOCTYPE HTML>
<html>
<body>
<video id="testVideo"></video>
<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>