summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/streams/transform-streams/invalid-realm.tentative.window.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/streams/transform-streams/invalid-realm.tentative.window.js')
-rw-r--r--testing/web-platform/tests/streams/transform-streams/invalid-realm.tentative.window.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/testing/web-platform/tests/streams/transform-streams/invalid-realm.tentative.window.js b/testing/web-platform/tests/streams/transform-streams/invalid-realm.tentative.window.js
new file mode 100644
index 0000000000..57cdfd9486
--- /dev/null
+++ b/testing/web-platform/tests/streams/transform-streams/invalid-realm.tentative.window.js
@@ -0,0 +1,17 @@
+// 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');