From e870941fa4d915d2981a121a052ae73278216887 Mon Sep 17 00:00:00 2001 From: Mattias Buelens <649348+MattiasBuelens@users.noreply.github.com> Date: Mon, 20 Nov 2023 13:07:55 +0100 Subject: [PATCH] test: enable idlharness tests for encoding TextDecoderStream and TextEncoderStream are now exposed as globals, so we can run the entire Encoding idlharness test suite. PR-URL: https://github.com/nodejs/node/pull/50778 Reviewed-By: Filip Skokan Reviewed-By: Yagiz Nizipli Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Benjamin Gruenbaum --- test/common/wpt.js | 2 +- test/wpt/status/encoding.json | 2 +- test/wpt/test-encoding.js | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/common/wpt.js b/test/common/wpt.js index a65a0740d15..7917e17729c 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 09f8c2b545b..db481cca6a0 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 af20760bd53..eb54c70867c 100644 --- a/test/wpt/test-encoding.js +++ b/test/wpt/test-encoding.js @@ -3,4 +3,6 @@ const { WPTRunner } = require('../common/wpt'); const runner = new WPTRunner('encoding'); +runner.pretendGlobalThisAs('Window'); + runner.runJsTests();