1
0
Fork 0
firefox/testing/web-platform/tests/websockets/basic-auth.any.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

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();