From 89ac34439348edd77e7e845bf57a0a93de6b7633 Mon Sep 17 00:00:00 2001 From: "Node.js GitHub Bot" Date: Sun, 20 Jul 2025 00:23:09 +0000 Subject: [PATCH] test: update WPT for WebCryptoAPI to 19d82c57ab PR-URL: https://github.com/nodejs/node/pull/59129 Reviewed-By: Filip Skokan Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- test/fixtures/wpt/README.md | 2 +- .../import_export/okp_importKey_failures_fixtures.js | 12 ++++++------ test/fixtures/wpt/WebCryptoAPI/util/helpers.js | 5 +++++ test/fixtures/wpt/versions.json | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/test/fixtures/wpt/README.md b/test/fixtures/wpt/README.md index 629528d15a4..f0a8c112715 100644 --- a/test/fixtures/wpt/README.md +++ b/test/fixtures/wpt/README.md @@ -32,7 +32,7 @@ Last update: - user-timing: https://github.com/web-platform-tests/wpt/tree/5ae85bf826/user-timing - wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/cde25e7e3c/wasm/jsapi - wasm/webapi: https://github.com/web-platform-tests/wpt/tree/fd1b23eeaa/wasm/webapi -- WebCryptoAPI: https://github.com/web-platform-tests/wpt/tree/591c95ce61/WebCryptoAPI +- WebCryptoAPI: https://github.com/web-platform-tests/wpt/tree/19d82c57ab/WebCryptoAPI - webidl/ecmascript-binding/es-exceptions: https://github.com/web-platform-tests/wpt/tree/a370aad338/webidl/ecmascript-binding/es-exceptions - webmessaging/broadcastchannel: https://github.com/web-platform-tests/wpt/tree/6495c91853/webmessaging/broadcastchannel - webstorage: https://github.com/web-platform-tests/wpt/tree/1291340aaa/webstorage diff --git a/test/fixtures/wpt/WebCryptoAPI/import_export/okp_importKey_failures_fixtures.js b/test/fixtures/wpt/WebCryptoAPI/import_export/okp_importKey_failures_fixtures.js index 9bedddc5c59..cac6db1dcac 100644 --- a/test/fixtures/wpt/WebCryptoAPI/import_export/okp_importKey_failures_fixtures.js +++ b/test/fixtures/wpt/WebCryptoAPI/import_export/okp_importKey_failures_fixtures.js @@ -2,27 +2,27 @@ // helper functions that generate all possible test parameters for // different situations. function getValidKeyData(algorithm) { - return validKeyData[algorithm.name]; + return validKeyData[algorithm.name || algorithm]; } function getBadKeyLengthData(algorithm) { - return badKeyLengthData[algorithm.name]; + return badKeyLengthData[algorithm.name || algorithm]; } function getMissingJWKFieldKeyData(algorithm) { - return missingJWKFieldKeyData[algorithm.name]; + return missingJWKFieldKeyData[algorithm.name || algorithm]; } function getMismatchedJWKKeyData(algorithm) { - return mismatchedJWKKeyData[algorithm.name]; + return mismatchedJWKKeyData[algorithm.name || algorithm]; } function getMismatchedKtyField(algorithm) { - return mismatchedKtyField[algorithm.name]; + return mismatchedKtyField[algorithm.name || algorithm]; } function getMismatchedCrvField(algorithm) { - return mismatchedCrvField[algorithm.name]; + return mismatchedCrvField[algorithm.name || algorithm]; } var validKeyData = { diff --git a/test/fixtures/wpt/WebCryptoAPI/util/helpers.js b/test/fixtures/wpt/WebCryptoAPI/util/helpers.js index c60371dc6ad..488eadf29c0 100644 --- a/test/fixtures/wpt/WebCryptoAPI/util/helpers.js +++ b/test/fixtures/wpt/WebCryptoAPI/util/helpers.js @@ -93,6 +93,10 @@ function objectToString(obj) { // Is key a CryptoKey object with correct algorithm, extractable, and usages? // Is it a secret, private, or public kind of key? function assert_goodCryptoKey(key, algorithm, extractable, usages, kind) { + if (typeof algorithm === "string") { + algorithm = { name: algorithm }; + } + var correctUsages = []; var registeredAlgorithmName; @@ -203,6 +207,7 @@ function allAlgorithmSpecifiersFor(algorithmName) { results.push({name: algorithmName, namedCurve: curveName}); }); } else if (algorithmName.toUpperCase().substring(0, 1) === "X" || algorithmName.toUpperCase().substring(0, 2) === "ED") { + results.push(algorithmName); results.push({ name: algorithmName }); } diff --git a/test/fixtures/wpt/versions.json b/test/fixtures/wpt/versions.json index c52725e388d..dba0261ce3d 100644 --- a/test/fixtures/wpt/versions.json +++ b/test/fixtures/wpt/versions.json @@ -88,7 +88,7 @@ "path": "wasm/webapi" }, "WebCryptoAPI": { - "commit": "591c95ce6174690b92833cd92859ce2807714591", + "commit": "19d82c57abc7494bdc459a338c5dcfd79e818b4a", "path": "WebCryptoAPI" }, "webidl/ecmascript-binding/es-exceptions": {