| <!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); |
| // Disable the Fullscreen API (element fullscreen) support |
| internals.settings.setFullScreenEnabled(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"); |
| waitForEvent('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 <video> when fullscreen is required.</p> |
| </body> |
| </html> |