From 43a97878ce14b72f0981164f87f2e35e14151312 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:22:09 +0200 Subject: Adding upstream version 110.0.1. Signed-off-by: Daniel Baumann --- .../tests/websockets/Create-extensions-empty.any.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 testing/web-platform/tests/websockets/Create-extensions-empty.any.js (limited to 'testing/web-platform/tests/websockets/Create-extensions-empty.any.js') diff --git a/testing/web-platform/tests/websockets/Create-extensions-empty.any.js b/testing/web-platform/tests/websockets/Create-extensions-empty.any.js new file mode 100644 index 0000000000..1fba4bd2cc --- /dev/null +++ b/testing/web-platform/tests/websockets/Create-extensions-empty.any.js @@ -0,0 +1,20 @@ +// META: timeout=long +// META: script=constants.sub.js +// META: variant= +// META: variant=?wpt_flags=h2 +// META: variant=?wss + +var test = async_test("Create WebSocket - wsocket.extensions should be set to '' after connection is established - Connection should be closed"); + +var wsocket = new WebSocket(SCHEME_DOMAIN_PORT + "/handshake_no_extensions"); +var isOpenCalled = false; + +wsocket.addEventListener('open', test.step_func_done(function(evt) { + wsocket.close(); + isOpenCalled = true; + assert_equals(wsocket.extensions, "", "extensions should be empty"); +}), true); + +wsocket.addEventListener('close', test.step_func_done(function(evt) { + assert_true(isOpenCalled, "WebSocket connection should be closed"); +}), true); -- cgit v1.2.3