From eb63cd24d23a38fb39bbe1b8a1bb8357eaf4be16 Mon Sep 17 00:00:00 2001 From: devstone <81923229+Nahee-Park@users.noreply.github.com> Date: Tue, 22 Oct 2024 15:47:26 +0900 Subject: [PATCH] test: update wpt test for webmessaging/broadcastchannel PR-URL: https://github.com/nodejs/node/pull/55205 Reviewed-By: Luigi Pinca --- test/fixtures/wpt/README.md | 2 +- test/fixtures/wpt/versions.json | 2 +- .../wpt/webmessaging/broadcastchannel/WEB_FEATURES.yml | 3 +++ .../wpt/webmessaging/broadcastchannel/basics.any.js | 8 ++++++++ .../wpt/webmessaging/broadcastchannel/workers.html | 2 +- 5 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 test/fixtures/wpt/webmessaging/broadcastchannel/WEB_FEATURES.yml diff --git a/test/fixtures/wpt/README.md b/test/fixtures/wpt/README.md index c08f47c4a51173..bf405ad2da4f57 100644 --- a/test/fixtures/wpt/README.md +++ b/test/fixtures/wpt/README.md @@ -34,7 +34,7 @@ Last update: - wasm/webapi: https://github.com/web-platform-tests/wpt/tree/fd1b23eeaa/wasm/webapi - WebCryptoAPI: https://github.com/web-platform-tests/wpt/tree/bef6fa3566/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/e97fac4791/webmessaging/broadcastchannel +- webmessaging/broadcastchannel: https://github.com/web-platform-tests/wpt/tree/6495c91853/webmessaging/broadcastchannel - webstorage: https://github.com/web-platform-tests/wpt/tree/9dafa89214/webstorage [Web Platform Tests]: https://github.com/web-platform-tests/wpt diff --git a/test/fixtures/wpt/versions.json b/test/fixtures/wpt/versions.json index 37b8e94caafeae..3a01055f5f3c04 100644 --- a/test/fixtures/wpt/versions.json +++ b/test/fixtures/wpt/versions.json @@ -96,7 +96,7 @@ "path": "webidl/ecmascript-binding/es-exceptions" }, "webmessaging/broadcastchannel": { - "commit": "e97fac4791931fb7455ba3fad759d362c7108b09", + "commit": "6495c91853a3cf028a401cf4d228fc0b6a5465e4", "path": "webmessaging/broadcastchannel" }, "webstorage": { diff --git a/test/fixtures/wpt/webmessaging/broadcastchannel/WEB_FEATURES.yml b/test/fixtures/wpt/webmessaging/broadcastchannel/WEB_FEATURES.yml new file mode 100644 index 00000000000000..378ed57dc52d07 --- /dev/null +++ b/test/fixtures/wpt/webmessaging/broadcastchannel/WEB_FEATURES.yml @@ -0,0 +1,3 @@ +features: +- name: broadcast-channel + files: "**" diff --git a/test/fixtures/wpt/webmessaging/broadcastchannel/basics.any.js b/test/fixtures/wpt/webmessaging/broadcastchannel/basics.any.js index 68b4706028f5aa..eec09d65a3aba2 100644 --- a/test/fixtures/wpt/webmessaging/broadcastchannel/basics.any.js +++ b/test/fixtures/wpt/webmessaging/broadcastchannel/basics.any.js @@ -1,3 +1,11 @@ +test(function() { + assert_throws_js( + TypeError, + () => BroadcastChannel(""), + "Calling BroadcastChannel constructor without 'new' must throw" + ); +}, "BroadcastChannel constructor called as normal function"); + async_test(t => { let c1 = new BroadcastChannel('eventType'); let c2 = new BroadcastChannel('eventType'); diff --git a/test/fixtures/wpt/webmessaging/broadcastchannel/workers.html b/test/fixtures/wpt/webmessaging/broadcastchannel/workers.html index 62fa31f623c4b8..8b55492f3cffb3 100644 --- a/test/fixtures/wpt/webmessaging/broadcastchannel/workers.html +++ b/test/fixtures/wpt/webmessaging/broadcastchannel/workers.html @@ -256,7 +256,7 @@ // Since the worker has closed, it's not expected that the // BroadcastChannel will receive messages (there's a separate test for // that), so just indicate directly that it's ready to test receiving - // a message from the parent despite the possibility of a race condition. + // a message from the parent dispite the possibility of a race condition. postMessage('ready'); } });