From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../tests/encoding/streams/realms.window.js | 304 +++++++++++++++++++++ 1 file changed, 304 insertions(+) create mode 100644 testing/web-platform/tests/encoding/streams/realms.window.js (limited to 'testing/web-platform/tests/encoding/streams/realms.window.js') diff --git a/testing/web-platform/tests/encoding/streams/realms.window.js b/testing/web-platform/tests/encoding/streams/realms.window.js new file mode 100644 index 0000000000..ca9ce21abc --- /dev/null +++ b/testing/web-platform/tests/encoding/streams/realms.window.js @@ -0,0 +1,304 @@ +'use strict'; + +// Test that objects created by the TextEncoderStream and TextDecoderStream APIs +// are created in the correct realm. The tests work by creating an iframe for +// each realm and then posting Javascript to them to be evaluated. Inputs and +// outputs are passed around via global variables in each realm's scope. + +// Async setup is required before creating any tests, so require done() to be +// called. +setup({explicit_done: true}); + +function createRealm() { + let iframe = document.createElement('iframe'); + const scriptEndTag = '<' + '/script>'; + iframe.srcdoc = ` +