https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 7d92dbd58ac296da6fb2e24d9c9758775e873088 authored by Mike West on 06 December 2018, 10:19:53 UTC
Trusted Types: URLs should be USVString, not DOMString.
Tip revision: 7d92dbd
exit-picture-in-picture.html
<!DOCTYPE html>
<title>Test exit Picture-in-Picture</title>
<script src="/common/media.js"></script>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="resources/picture-in-picture-helpers.js"></script>
<body></body>
<script>
promise_test(async t => {
  const video = await loadVideo();
  return requestPictureInPictureWithTrustedClick(video)
  .then(() => document.exitPictureInPicture());
}, 'Exit Picture-in-Picture resolves when there is a Picture-in-Picture video');

promise_test(t => {
  return promise_rejects(t, 'InvalidStateError',
      document.exitPictureInPicture());
}, 'Exit Picture-in-Picture rejects when there is no Picture-in-Picture video');
</script>
back to top