beforeunload-is-disabled.https.html (831B)
1 <!DOCTYPE html> 2 <title>Test that onbeforeunload is disabled for document picture in picture</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-vendor.js"></script> 7 8 <body> 9 <script> 10 promise_test(async (t) => { 11 await test_driver.bless('request PiP window from top window'); 12 const pipWindow = await documentPictureInPicture.requestWindow(); 13 var onbeforeunloadDisabled = true; 14 pipWindow.onbeforeunload = () => { 15 onbeforeunloadDisabled = false; 16 return "This is a test"; 17 } 18 pipWindow.close(); 19 assert_true(onbeforeunloadDisabled, 'onbeforeunload should be disabled for document picture in picture'); 20 }); 21 </script> 22 </body>