removed-from-document.html (888B)
1 <!DOCTYPE html> 2 <title>Test Picture-in-Picture when removed from document</title> 3 <script src="/common/media.js"></script> 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 <script src="resources/picture-in-picture-helpers.js"></script> 9 <body></body> 10 <script> 11 promise_test(async t => { 12 const video = await loadVideo(); 13 document.body.appendChild(video); 14 video.muted = true; 15 await video.play(); 16 await requestPictureInPictureWithTrustedClick(video); 17 18 assert_false(video.paused); 19 document.body.offsetLeft; 20 document.body.removeChild(video); 21 await new Promise(resolve => step_timeout(resolve, 1000)); 22 assert_false(video.paused); 23 }, 'Picture-in-Picture video does not pause when removed from document'); 24 </script>