Automatic update from web-platform-tests WebSockets: correct Mixed Content test Fixes https://github.com/whatwg/websockets/issues/50. -- wpt-commits: 57937aa4833a864d594ac17a735df30e57888197 wpt-pr: 59408
14 lines
415 B
JavaScript
14 lines
415 B
JavaScript
// META: global=window,worker
|
|
// META: script=constants.sub.js
|
|
|
|
async_test(t => {
|
|
const ws = CreateInsecureWebSocket();
|
|
ws.onopen = t.unreached_func('open should not fire');
|
|
ws.onerror = t.step_func(() => {
|
|
assert_equals(ws.readyState, WebSocket.CLOSED);
|
|
});
|
|
ws.onclose = t.step_func_done(e => {
|
|
assert_false(e.wasClean);
|
|
});
|
|
}, 'opening an insecure WebSocket in a secure context should fail');
|