blob: 282530cf00ede54169d438d0aebde27e3a64b4c7 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../video-test.js"></script>
<script src="../media-file.js"></script>
<script type="text/javascript">
var session;
function runTest()
{
session = new MediaSession("content");
findMediaElement();
waitForEvent('canplaythrough', beginPlaying);
video.src = findMediaFile("video", "../content/counting");
video.session = session;
waitForEvent('playing', beganPlaying, false, true, video);
}
function beginPlaying(event)
{
testExpected('video.paused', true);
consoleWrite("Begin playing media.");
video.play();
}
function beganPlaying(event)
{
consoleWrite("Media began playing.");
testExpected('video.paused', false);
if (window.internals)
testExpected('internals.mediaSessionCurrentState(session)', "active");
run('session.deactivate()');
testExpected('video.paused', true);
if (window.internals)
testExpected('internals.mediaSessionCurrentState(session)', "idle");
endTest();
}
</script>
</head>
<body onload="runTest()">
<p>Sessions that are explicitly released should have their media elements indefinitely paused and go into an Idle state.</p>
<video id="video" />
</body>
</html>