blob: c3aca3a046c4ebbc357c9bf588f47f7fed4b6d71 [file] [log] [blame]
<!DOCTYPE html><!-- webkit-test-runner [ enableModernMediaControls=false ] -->
<html>
<head>
<script src=media-file.js></script>
<script src=video-test.js></script>
<script src=media-controls.js></script>
<script>
function start()
{
if (!window.internals) {
failTest('This test requires window.internals.');
return;
}
video = document.getElementsByTagName('video')[0];
waitForEventOnce("canplaythrough", canplaythrough);
video.src = findMediaFile("video", "content/test");
video.loop = true;
internals.settings.setAllowsInlineMediaPlayback(false);
internals.setMockVideoPresentationModeEnabled(true);
consoleWrite("");
}
function canplaythrough()
{
testExpected("video.webkitSupportsFullscreen", true);
testExpected("video.webkitDisplayingFullscreen", false);
try {
waitForEventOnce('playing', playing);
runWithKeyDown("video.play()");
} catch (exception) {
failTest(exception.description);
return;
}
}
async function playing()
{
await testExpectedEventually("video.webkitDisplayingFullscreen", true);
consoleWrite("<br>** Entered fullscreen");
waitForEventOnce('webkitpresentationmodechanged', endfullscreen);
run("video.webkitExitFullScreen()");
}
async function endfullscreen()
{
await testExpectedEventually("video.webkitDisplayingFullscreen", false);
consoleWrite("<br>** Exited fullscreen");
endTest();
}
</script>
</head>
<body onload="start()">
<video controls></video>
<p>Test the play() function of &lt;video&gt; when fullscreen is required.</p>
</body>
</html>