document-picture-in-picture-denied.https.html (1025B)
1 <!DOCTYPE html> 2 <title>Test that fencedframes cannot open a DocumentPictureInPicture window.</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script src="/resources/testdriver.js"></script> 6 <script src="/resources/testdriver-actions.js"></script> 7 <script src="/resources/testdriver-vendor.js"></script> 8 <script src="/common/utils.js"></script> 9 <script src="/common/dispatcher/dispatcher.js"></script> 10 <script src="resources/utils.js"></script> 11 12 <body> 13 </body> 14 <script> 15 promise_test(async () => { 16 const frame = attachFencedFrameContext(); 17 await multiClick(10, 10, frame.element); 18 const result = await frame.execute(async () => { 19 try { 20 await documentPictureInPicture.requestWindow(); 21 return null; 22 } catch(e) { 23 return e.name; 24 } 25 }); 26 assert_equals(result, 'NotAllowedError', 'requestWindow() from a fencedframe should trigger a NotAllowedError'); 27 }, 'fencedframes cannot open a DocumentPictureInPicture window.'); 28 </script>