summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/document-picture-in-picture/resize-requires-user-gesture.https.html
blob: f6c4aa4989cd783da3fadf1b11d29ad065c24fbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<title>Test that calling resizeTo() or resizeBy() on a document
  picture-in-picture window requires user gesture</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>
<script>
promise_test(async (t) => {
  await test_driver.bless('request PiP window from top window');
  const pipWindow = await documentPictureInPicture.requestWindow();

  await assert_throws_dom('NotAllowedError', pipWindow.DOMException, () => {
    pipWindow.resizeBy(10, 10);
  }, 'resizeBy() requires a user gesture for document picture-in-picture');
  await assert_throws_dom('NotAllowedError', pipWindow.DOMException, () => {
    pipWindow.resizeTo(400, 400);
  }, 'resizeTo() requires a user gesture for document picture-in-picture');
});
</script>
</body>