blob: f1bb07b75e81f7fe0aca686f90d6f422cab7b478 [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 => {
findMediaElement();
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()
.then(() => {
document.exitPictureInPicture().then(endTest).catch(() => {
failTest('Failed to exit the Picture-in-Picture mode.');
});
})
.catch(() => {
failTest('request Picture-in-Picture does not resolve on user click.');
});
});
});
</script>
</head>
<body>
<div>This tests that request Picture-in-Picture resolves on user click.</div>
<video controls></video>
</body>
</html>