blob: 626437ca8a0b895fd8fc6874f7e5ab873069ecd2 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../video-test.js"></script>
<script src="../media-file.js"></script>
<script type="text/javascript">
function runTest()
{
findMediaElement();
waitForEvent('canplaythrough', beginPlaying);
video.src = findMediaFile("video", "../content/counting");
waitForEvent('playing', beganPlaying, false, true, video);
}
function beginPlaying(event)
{
testExpected('video.paused', true);
if (window.internals) {
consoleWrite("Sending Play/Pause media event.");
run('internals.sendMediaControlEvent("play-pause")');
testExpected('video.paused', true);
}
consoleWrite("");
consoleWrite("Playing media.");
video.play();
}
function beganPlaying(event)
{
consoleWrite("Media began playing.");
testExpected('video.paused', false);
if (window.internals) {
consoleWrite("Sending Play/Pause media event.");
run('internals.sendMediaControlEvent("play-pause")');
testExpected('video.paused', true);
}
endTest();
}
</script>
</head>
<body onload="runTest()">
<p>'Default' media sessions should respond to play/pause media events.</p>
<video id="video" />
</body>
</html>