unload-iframe.https.window.js (651B)
1 let frame; 2 window.unloadChild = function() { 3 document.body.removeChild(frame); 4 }; 5 6 promise_test(async t => { 7 frame = document.createElement('iframe'); 8 frame.srcdoc = `<script> 9 navigator.hid.getDevices(); 10 window.parent.unloadChild(); 11 </script>`; 12 document.body.appendChild(frame); 13 }, 'Unload child iframe with pending getDevices promise'); 14 15 promise_test(async t => { 16 frame = document.createElement('iframe'); 17 frame.srcdoc = `<script> 18 navigator.hid.requestDevice({filters: []}); 19 window.parent.unloadChild(); 20 </script>`; 21 document.body.appendChild(frame); 22 }, 'Unload child iframe with pending requestDevice promise');