1
0
Fork 0
firefox/testing/web-platform/tests/streams/transform-streams/invalid-realm.tentative.window.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

17 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');