| <script src="../video-test.js"></script> |
| <script src="../media-file.js"></script> |
| window.addEventListener('load', async event => { |
| run('internals.settings.setAllowsPictureInPictureMediaPlayback(true)'); |
| run('internals.setPictureInPictureAPITestEnabled(video, true)'); |
| run('video.src = findMediaFile("video", "../content/test")'); |
| await waitFor(video, 'canplaythrough'); |
| runWithKeyDown(function() { |
| video.requestPictureInPicture() |
| window.pipWindow = pipWindow; |
| testExpected('pipWindow.width', 0, '>'); |
| testExpected('pipWindow.height', 0, '>'); |
| document.exitPictureInPicture().then(endTest).catch(() => { |
| failTest('Failed to exit the Picture-in-Picture mode.'); |
| failTest("Failed to enter the Picture-in-Picture mode."); |
| <div>This tests that a pip window is returned correctly when a video element enters the Picture-in-Picture mode.</div> |