Files
Kmake/test/fixtures/wpt/streams/transform-streams/invalid-realm.tentative.window.js
2026-05-26 23:36:42 -07:00

18 lines
609 B
JavaScript

// TransformStream should still work even if the realm is detached.
// Adds an iframe to the document and returns it.
function addIframe() {
const iframe = document.createElement('iframe');
document.body.appendChild(iframe);
return iframe;
}
promise_test(async t => {
const iframe = addIframe();
const stream = new iframe.contentWindow.TransformStream();
const readPromise = stream.readable.getReader().read();
const writer = stream.writable.getWriter();
iframe.remove();
return Promise.all([writer.write('A'), readPromise]);
}, 'TransformStream: write in detached realm should succeed');