From a373a5c5a0617d50c5d8309d8bfa0575c2e41865 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Mon, 5 Jun 2023 18:52:02 -0400 Subject: [PATCH] test: update encoding web-platform tests PR-URL: https://github.com/nodejs/node/pull/48320 Reviewed-By: Antoine du Hamel Reviewed-By: Filip Skokan Reviewed-By: Luigi Pinca --- test/fixtures/wpt/README.md | 2 +- .../streams/stringification-crash.html | 20 +++++++++++++++++++ .../wpt/encoding/unsupported-labels.window.js | 10 ++++++---- test/fixtures/wpt/versions.json | 2 +- 4 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 test/fixtures/wpt/encoding/streams/stringification-crash.html diff --git a/test/fixtures/wpt/README.md b/test/fixtures/wpt/README.md index a9a60875ee7dd2..cd19ae81887d0e 100644 --- a/test/fixtures/wpt/README.md +++ b/test/fixtures/wpt/README.md @@ -14,7 +14,7 @@ Last update: - console: https://github.com/web-platform-tests/wpt/tree/767ae35464/console - dom/abort: https://github.com/web-platform-tests/wpt/tree/d1f1ecbd52/dom/abort - dom/events: https://github.com/web-platform-tests/wpt/tree/ab8999891c/dom/events -- encoding: https://github.com/web-platform-tests/wpt/tree/0c1b9d1622/encoding +- encoding: https://github.com/web-platform-tests/wpt/tree/a58bbf6d8c/encoding - fetch/data-urls/resources: https://github.com/web-platform-tests/wpt/tree/7c79d998ff/fetch/data-urls/resources - FileAPI: https://github.com/web-platform-tests/wpt/tree/e36dbb6f00/FileAPI - hr-time: https://github.com/web-platform-tests/wpt/tree/34cafd797e/hr-time diff --git a/test/fixtures/wpt/encoding/streams/stringification-crash.html b/test/fixtures/wpt/encoding/streams/stringification-crash.html new file mode 100644 index 00000000000000..bbcbe300966169 --- /dev/null +++ b/test/fixtures/wpt/encoding/streams/stringification-crash.html @@ -0,0 +1,20 @@ + + + + diff --git a/test/fixtures/wpt/encoding/unsupported-labels.window.js b/test/fixtures/wpt/encoding/unsupported-labels.window.js index 1668a36f234094..0262bbbc61fd3f 100644 --- a/test/fixtures/wpt/encoding/unsupported-labels.window.js +++ b/test/fixtures/wpt/encoding/unsupported-labels.window.js @@ -167,11 +167,13 @@ t.add_cleanup(() => { frame.remove(); }); - frame.src = "resources/text-plain-charset.py?label=" + label; + // Intentionally use as Content-Type results in browser differences + // See /html/syntax/charset/inheritance-bogus-meta.html + frame.src = "resources/text-html-meta-charset.py?label=" + label; frame.onload = t.step_func_done(() => { - // If we ever change this default this needs adjusting accordingly. - assert_equals(frame.contentDocument.characterSet, "windows-1252"); - assert_equals(frame.contentDocument.inputEncoding, "windows-1252"); + // UTF-8 as it inherits from the parent document when unrecognized + assert_equals(frame.contentDocument.characterSet, "UTF-8"); + assert_equals(frame.contentDocument.inputEncoding, "UTF-8"); }); document.body.append(frame); }, `${label} is not supported by the Encoding Standard`); diff --git a/test/fixtures/wpt/versions.json b/test/fixtures/wpt/versions.json index 0fa4067b7d56a5..dd2df13185d654 100644 --- a/test/fixtures/wpt/versions.json +++ b/test/fixtures/wpt/versions.json @@ -16,7 +16,7 @@ "path": "dom/events" }, "encoding": { - "commit": "0c1b9d1622ae0f27f82d7f7d7a1e9e69d410a3ca", + "commit": "a58bbf6d8c0db1f1fd5352e846acb0754ee55567", "path": "encoding" }, "fetch/data-urls/resources": {