1
0
Fork 0
firefox/testing/web-platform/tests/document-picture-in-picture/resize-requires-user-gesture.https.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

22 lines
921 B
HTML

<!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>