fune/testing/web-platform/tests/websockets/referrer.any.js
Arno Renevier e71b95a9f1 Bug 1701340 [wpt PR 28265] - Merge constants.js and websocket.sub.js, a=testonly
Automatic update from web-platform-tests
Merge constants.js and websocket.sub.js

Right now, we have tests using constants.js and websocket.sub.js

Instead, we merge all the functionality into one unique file
constants.sub.js

The test don't have to specify if the Websocket whether secure anymore.
Instead, we run the 3 variants (unsecure, secure and http2) whenever
possible.

Since some tests were duplicated between a Secure and regular version,
we can now get rid of one those two versions.

We also remove Create-Secure-verify-url-set-non-default-port.any.js and
Create-verify-url-set-non-default-port.any.js which seems to have been
obsolete for some time.

Fixes #28264

--

wpt-commits: d4ca2a84a2b8caaaff3323bd80b0e45f29b4ad0b
wpt-pr: 28265
2021-04-08 10:47:43 +00:00

13 lines
396 B
JavaScript

// META: script=constants.sub.js
async_test(t => {
const ws = new WebSocket(SCHEME_DOMAIN_PORT + "/referrer");
ws.onmessage = t.step_func_done(e => {
assert_equals(e.data, "MISSING AS PER FETCH");
ws.close();
});
// Avoid timeouts in case of failure
ws.onclose = t.unreached_func("close");
ws.onerror = t.unreached_func("error");
}, "Ensure no Referer header is included");