invalid-realm.tentative.window.js (609B)
1 // TransformStream should still work even if the realm is detached. 2 3 // Adds an iframe to the document and returns it. 4 function addIframe() { 5 const iframe = document.createElement('iframe'); 6 document.body.appendChild(iframe); 7 return iframe; 8 } 9 10 promise_test(async t => { 11 const iframe = addIframe(); 12 const stream = new iframe.contentWindow.TransformStream(); 13 const readPromise = stream.readable.getReader().read(); 14 const writer = stream.writable.getWriter(); 15 iframe.remove(); 16 return Promise.all([writer.write('A'), readPromise]); 17 }, 'TransformStream: write in detached realm should succeed');