blob: aac65308c14b92cadbeb0337989b28eb5c984d69 [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('video.src = findMediaFile("video", "content/test")');
await waitFor(video, 'canplaythrough');
run('video.play()');
await waitFor(video, 'playing');
runWithKeyDown(function(){ video.webkitSetPresentationMode('picture-in-picture'); });
await waitFor(video, 'webkitpresentationmodechanged');
run('internals.beginMediaSessionInterruption("enteringbackground")');
testExpected('internals.mediaSessionState(video)', 'Playing');
run('internals.endMediaSessionInterruption("enteringbackground")');
testExpected('internals.mediaSessionState(video)', 'Playing');
endTest();
});
</script>
</head>
<body>
<div>This tests that video is in the correct media session state after ending a background interruption while pipped.</div>
<video controls></video>
</body>
</html>