From 26eca268415f905455ddd890446cf97d110fc866 Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Sat, 18 Nov 2023 12:55:58 +0100 Subject: [PATCH 1/2] test: enable idlharness tests for encoding TextDecoderStream and TextEncoderStream are now exposed as globals, so we can run the entire Encoding idlharness test suite. --- test/common/wpt.js | 2 +- test/wpt/status/encoding.json | 2 +- test/wpt/test-encoding.js | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/common/wpt.js b/test/common/wpt.js index a65a0740d155d8..7917e17729c7ee 100644 --- a/test/common/wpt.js +++ b/test/common/wpt.js @@ -617,7 +617,7 @@ class WPTRunner { 'ReadableStreamBYOBReader', 'ReadableStreamBYOBRequest', 'ReadableByteStreamController', 'ReadableStreamDefaultController', 'ByteLengthQueuingStrategy', 'CountQueuingStrategy', - 'TextEncoderStream', 'TextDecoderStream', + 'TextEncoder', 'TextDecoder', 'TextEncoderStream', 'TextDecoderStream', 'CompressionStream', 'DecompressionStream', ]; if (Boolean(process.versions.openssl) && !process.env.NODE_SKIP_CRYPTO) { diff --git a/test/wpt/status/encoding.json b/test/wpt/status/encoding.json index 09f8c2b545b247..db481cca6a09df 100644 --- a/test/wpt/status/encoding.json +++ b/test/wpt/status/encoding.json @@ -37,7 +37,7 @@ "skip": "The iso-8859-16 encoding is not supported" }, "idlharness.any.js": { - "skip": "No implementation of TextDecoderStream and TextEncoderStream" + "requires": ["small-icu"] }, "idlharness-shadowrealm.window.js": { "skip": "ShadowRealm support is not enabled" diff --git a/test/wpt/test-encoding.js b/test/wpt/test-encoding.js index af20760bd533d3..9b135972f348b7 100644 --- a/test/wpt/test-encoding.js +++ b/test/wpt/test-encoding.js @@ -3,4 +3,7 @@ const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('encoding'); +// Set a script that will be executed in the worker before running the tests. +runner.pretendGlobalThisAs('Window'); + runner.runJsTests(); From 258d7ff2ee93eb0a645cfbbda5601afa8865a01c Mon Sep 17 00:00:00 2001 From: Mattias Buelens <649348+MattiasBuelens@users.noreply.github.com> Date: Sat, 18 Nov 2023 13:18:32 +0100 Subject: [PATCH 2/2] fixup Co-authored-by: Filip Skokan --- test/wpt/test-encoding.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/wpt/test-encoding.js b/test/wpt/test-encoding.js index 9b135972f348b7..eb54c70867cb43 100644 --- a/test/wpt/test-encoding.js +++ b/test/wpt/test-encoding.js @@ -3,7 +3,6 @@ const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('encoding'); -// Set a script that will be executed in the worker before running the tests. runner.pretendGlobalThisAs('Window'); runner.runJsTests();