mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Update web-platform-tests to revision de3ae39cb59880a8245431e7f09817a2a4dad1a3
This commit is contained in:
parent
0c5b020163
commit
b322aa3943
131 changed files with 2717 additions and 600 deletions
18
tests/wpt/web-platform-tests/websockets/basic-auth.any.js
Normal file
18
tests/wpt/web-platform-tests/websockets/basic-auth.any.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
// META: script=websocket.sub.js
|
||||
// META: global=sharedworker,serviceworker
|
||||
|
||||
async_test(t => {
|
||||
const isSecure = new URL(location.href).scheme === 'https';
|
||||
const scheme = isSecure ? 'wss' : 'ws';
|
||||
const port = isSecure ? __SECURE__PORT : __PORT;
|
||||
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();
|
Loading…
Add table
Add a link
Reference in a new issue