clears-session-on-close.https.html (1006B)
1 <!DOCTYPE html> 2 <title>Test that documentPictureInPicture.window 3 is cleared when the PiP window in closed.</title> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <script src="/resources/testdriver.js"></script> 7 <script src="/resources/testdriver-vendor.js"></script> 8 <body> 9 <script> 10 async_test((t) => { 11 test_driver.bless('request PiP window').then(t.step_func(_ => { 12 documentPictureInPicture.requestWindow().then( () => { 13 const pipWindow = documentPictureInPicture.window; 14 assert_true(!!pipWindow, "pipWindow should exist with PiP is opened"); 15 pipWindow.addEventListener('unload', () => { 16 // `window` is still set until event processing is complete. 17 scheduler.postTask(t.step_func_done( () => { 18 assert_true(!documentPictureInPicture.window, 19 "window should be cleared when PiP is closed"); 20 })) 21 }); 22 pipWindow.close(); 23 }); 24 })); 25 }); 26 </script> 27 </body>