blob: 5481c2a45f506218cd385cccdeb1c53ead62021e [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)');
document.exitPictureInPicture()
.then(() => {
failTest('Exit Picture-in-Picture rejects when there is no Picture-in-Picture video.');
})
.catch(error => {
window.error = error;
testExpected('error.name', 'InvalidStateError');
endTest();
});
});
</script>
</head>
<body>
<div>This tests that exit Picture-in-Picture rejects when there is no Picture-in-Picture video.</div>
<video controls></video>
</body>
</html>