forked from mirrors/gecko-dev
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
17 lines
493 B
JavaScript
17 lines
493 B
JavaScript
// META: global=window,worker
|
|
// META: script=constants.sub.js
|
|
// META: variant=?wss
|
|
// META: variant=?wpt_flags=h2
|
|
|
|
async_test(t => {
|
|
const url = __SCHEME + '://' + 'foo:bar@' + __SERVER__NAME + ':' + __PORT + '/basic_auth';
|
|
const ws = new WebSocket(url);
|
|
ws.onopen = () => {
|
|
ws.onclose = ws.onerror = null;
|
|
ws.close();
|
|
t.done();
|
|
};
|
|
ws.onerror = ws.onclose = t.unreached_func('open should succeed');
|
|
}, 'HTTP basic authentication should work with WebSockets');
|
|
|
|
done();
|