From ddd1f5cad31e3de7684b6b7e767301563b28a8a1 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Tue, 4 Dec 2018 18:35:12 +0800 Subject: [PATCH] test: use WPT runner to run encoding tests PR-URL: https://github.com/nodejs/node/pull/25321 Reviewed-By: Rich Trott Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater --- test/wpt/status/encoding.json | 52 ++++++++++++++++++++++++++++++++++- test/wpt/test-encoding.js | 12 ++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 test/wpt/test-encoding.js diff --git a/test/wpt/status/encoding.json b/test/wpt/status/encoding.json index 0967ef424bce67..5cf387e554844e 100644 --- a/test/wpt/status/encoding.json +++ b/test/wpt/status/encoding.json @@ -1 +1,51 @@ -{} +{ + "api-basics.any.js": { + "requires": ["small-icu"] + }, + "textdecoder-fatal-streaming.any.js": { + "requires": ["small-icu"] + }, + "textdecoder-fatal.any.js": { + "requires": ["small-icu"] + }, + "textdecoder-ignorebom.any.js": { + "requires": ["small-icu"] + }, + "textdecoder-streaming.any.js": { + "requires": ["small-icu"] + }, + "textdecoder-utf16-surrogates.any.js": { + "requires": ["small-icu"] + }, + "iso-2022-jp-decoder.any.js": { + "requires": ["full-icu"], + "fail": "iso-2022-jp decoder state handling bug: https://encoding.spec.whatwg.org/#iso-2022-jp-decoder" + }, + "textdecoder-byte-order-marks.any.js": { + "fail": "Mismatching BOM should not be ignored" + }, + "textdecoder-copy.any.js": { + "fail": "Should not have output BOM: https://encoding.spec.whatwg.org/#concept-td-serialize" + }, + "textdecoder-fatal-single-byte.any.js": { + "requires": ["full-icu"], + "fail": "The iso-8859-16 encoding is not supported" + }, + "textdecoder-labels.any.js": { + "requires": ["full-icu"], + "fail": "The iso-8859-16 encoding is not supported" + }, + "textencoder-constructor-non-utf.any.js": { + "requires": ["full-icu"], + "fail": "The iso-8859-16 encoding is not supported" + }, + "idlharness.any.js": { + "fail": "No implementation of TextDecoderStream and TextEncoderStream" + }, + "replacement-encodings.any.js": { + "skip": "decoding-helpers.js needs XMLHttpRequest" + }, + "unsupported-encodings.any.js": { + "skip": "decoding-helpers.js needs XMLHttpRequest" + } +} diff --git a/test/wpt/test-encoding.js b/test/wpt/test-encoding.js new file mode 100644 index 00000000000000..f868a7bac39987 --- /dev/null +++ b/test/wpt/test-encoding.js @@ -0,0 +1,12 @@ +'use strict'; + +// Flags: --expose-internals + +require('../common'); +const { WPTRunner } = require('../common/wpt'); +const runner = new WPTRunner('encoding'); + +// Copy global descriptors from the global object +runner.copyGlobalsFromObject(global, ['TextDecoder', 'TextEncoder']); + +runner.runJsTests();