Files
sousa-gecko/testing/web-platform/tests/websockets/mixed-content.https.any.js
T
Anne van Kesteren 5256fc1c19 Bug 2034624 [wpt PR 59408] - WebSockets: correct Mixed Content test, a=testonly
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
2026-04-28 18:15:05 +00:00

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