blob: 3ee80e0141ed6c019db103725b30481800b52b7b [file] [log] [blame]
<html>
<body>
<video src=content/test.mp4 controls></video>
<p>
Test 'timeupdate' events are posted while playing but not while paused.
</p
<script src=video-test.js></script>
<script>
var timeupdateEventCount = 0;
var countWhilePlaying = 0;
function someTimeLater()
{
if (countWhilePlaying != timeupdateEventCount)
failTest("'timeupdate' events posted after pausing");
endTest();
}
function pause()
{
countWhilePlaying = timeupdateEventCount;
setTimeout(someTimeLater, 400) ;
consoleWrite("");
}
function playing()
{
setTimeout(function () { run("video.pause()"); }, 500) ;
consoleWrite("");
}
media.addEventListener("timeupdate", function () { ++timeupdateEventCount; });
waitForEvent('error');
waitForEvent("loadstart");
waitForEvent("waiting");
waitForEvent("ratechange");
waitForEvent("durationchange");
waitForEvent("loadedmetadata");
waitForEvent("loadeddata");
waitForEvent("canplay");
waitForEvent("canplaythrough");
waitForEvent("pause", pause);
waitForEvent("play");
waitForEvent("playing", playing);
run("video.play()");
consoleWrite("");
</script>
</body>
</html>