Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /document-picture-in-picture/resize-requires-user-gesture.https.html - WPT Dashboard Interop Dashboard
<!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>