blob: 2c0e2c1bb4fc57f7bcfe4d7b66db6579b4931e37 [file] [log] [blame]
let frame;
window.unloadChild = function() {
document.body.removeChild(frame);
};
promise_test(async t => {
frame = document.createElement('iframe');
frame.srcdoc = `<script>
navigator.hid.getDevices();
window.parent.unloadChild();
</script>`;
document.body.appendChild(frame);
}, 'Unload child iframe with pending getDevices promise');
promise_test(async t => {
frame = document.createElement('iframe');
frame.srcdoc = `<script>
navigator.hid.requestDevice({filters: []});
window.parent.unloadChild();
</script>`;
document.body.appendChild(frame);
}, 'Unload child iframe with pending requestDevice promise');