summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/document-picture-in-picture/iframe-document-pip.https.html
blob: b978a2d4e6ca2b28db67b9c3f0bed7e9cf4492b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!DOCTYPE html>
<title>Test that document pip is not allowed in iframes.</title>
<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>
<body>
  <iframe></iframe>
</body>
<script>
promise_test(t => {
  const frame = document.querySelector('iframe');
  const frameDOMException = frame.contentWindow.DOMException;
  return test_driver.bless('request PiP window from iframe', frame.contentWindow).then(t.step_func(_ => {
    return promise_rejects_dom(t, 'NotAllowedError', frameDOMException,
      frame.contentWindow.documentPictureInPicture.requestWindow());
  }));
});
</script>