diff options
author | WPT Sync Bot <josh+wptsync@joshmatthews.net> | 2023-03-11 01:43:56 +0000 |
---|---|---|
committer | WPT Sync Bot <josh+wptsync@joshmatthews.net> | 2023-03-11 01:46:58 +0000 |
commit | 2ebdfcea9d202ab6bf5350803697645ca5fe7301 (patch) | |
tree | d5dcc2624831ccf86846396299dfae68245e22bd /tests/wpt/web-platform-tests/fetch/local-network-access/websocket.https.window.js | |
parent | 111363d338fe8655047db9484e58209958e86dc1 (diff) | |
download | servo-2ebdfcea9d202ab6bf5350803697645ca5fe7301.tar.gz servo-2ebdfcea9d202ab6bf5350803697645ca5fe7301.zip |
Update web-platform-tests to revision b'3ee7ccc2abbbc8d8f6efbb45f80bffdb3c0c76ba'
Diffstat (limited to 'tests/wpt/web-platform-tests/fetch/local-network-access/websocket.https.window.js')
-rw-r--r-- | tests/wpt/web-platform-tests/fetch/local-network-access/websocket.https.window.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/wpt/web-platform-tests/fetch/local-network-access/websocket.https.window.js b/tests/wpt/web-platform-tests/fetch/local-network-access/websocket.https.window.js new file mode 100644 index 00000000000..0731896098b --- /dev/null +++ b/tests/wpt/web-platform-tests/fetch/local-network-access/websocket.https.window.js @@ -0,0 +1,40 @@ +// META: script=resources/support.sub.js +// +// Spec: https://wicg.github.io/private-network-access/#integration-fetch +// +// These tests verify that websocket connections behave similarly to fetches. +// +// This file covers only those tests that must execute in a secure context. +// Other tests are defined in: websocket.https.window.js + +setup(() => { + // Making sure we are in a secure context, as expected. + assert_true(window.isSecureContext); +}); + +promise_test(t => websocketTest(t, { + source: { server: Server.HTTPS_LOCAL }, + target: { server: Server.WSS_LOCAL }, + expected: WebsocketTestResult.SUCCESS, +}), "local to local: websocket success."); + +promise_test(t => websocketTest(t, { + source: { server: Server.HTTPS_PRIVATE }, + target: { server: Server.WSS_LOCAL }, + expected: WebsocketTestResult.SUCCESS, +}), "private to local: websocket success."); + +promise_test(t => websocketTest(t, { + source: { server: Server.HTTPS_PUBLIC }, + target: { server: Server.WSS_LOCAL }, + expected: WebsocketTestResult.SUCCESS, +}), "public to local: websocket success."); + +promise_test(t => websocketTest(t, { + source: { + server: Server.HTTPS_LOCAL, + treatAsPublic: true, + }, + target: { server: Server.WSS_LOCAL }, + expected: WebsocketTestResult.SUCCESS, +}), "treat-as-public to local: websocket success."); |