blob: 2ded83335c79a1d738c45c4634ebb0fa016ee2e2 [file] [log] [blame]
<!DOCTYPE HTML>
<html>
<head>
<script src="../../../../js-test-resources/js-test-pre.js"></script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<script>
description("Test whether WebSocket handshake fails if the server does not send Sec-WebSocket-Accept header.");
window.jsTestIsAsync = true;
var url = "ws://localhost:8880/websocket/tests/hybi/handshake-fail-by-no-accept-header";
var ws = new WebSocket(url);
var closeEvent;
ws.onopen = function()
{
testFailed("Connection established.");
ws.close();
};
ws.onclose = function(event)
{
closeEvent = event;
shouldBeFalse("closeEvent.wasClean");
finishJSTest();
};
</script>
<script src="../../../../js-test-resources/js-test-post.js"></script>
</body>
</html>