blob: 51b7d78f18365fceecb7d22cc3b39e9674604588 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../video-test.js"></script>
<script src="../media-file.js"></script>
<script>
window.addEventListener('load', async event => {
if (!window.internals) {
failTest('This test requires window.internals.');
return;
}
findMediaElement();
run('internals.settings.setAllowsPictureInPictureMediaPlayback(true)');
run('internals.setMockVideoPresentationModeEnabled(true)');
run('video.src = findMediaFile("video", "../content/test")');
await waitFor(video, 'canplaythrough');
runWithKeyDown(() => {
video.webkitSetPresentationMode('picture-in-picture');
});
waitForEventOnce('enterpictureinpicture', event => {
window.pipWindow = event.pictureInPictureWindow;
testExpected('pipWindow.width', 0, '>');
testExpected('pipWindow.height', 0, '>');
video.webkitSetPresentationMode('inline');
waitForEventAndEnd('leavepictureinpicture');
});
});
</script>
</head>
<body>
<div>This tests that events are fired correctly when we use the webkit prefixed API to enters and exits the Picture-in-Picture mode.</div>
<video controls></video>
</body>
</html>