4 <script src=
"/js-test-resources/js-test.js"></script>
7 <div id=
"description"></div>
8 <div id=
"console"></div>
10 description("Test whether WebSocket handshake fails if the server does not send Sec-WebSocket-Accept header.");
12 window
.jsTestIsAsync
= true;
14 var url
= "ws://localhost:8880/handshake-fail-by-no-accept-header";
15 var ws
= new WebSocket(url
);
18 ws
.onopen = function()
20 testFailed("Connection established.");
24 ws
.onclose = function(event
)
27 shouldBeFalse("closeEvent.wasClean");
31 ws
.onerror = function(errorEvent
)
33 testPassed("onerror() was called");