blob: 030633f3f88d20aa8cf130c6d3a799ddaf641fb5 [file] [log] [blame]
<!DOCTYPE HTML>
<html>
<head>
<script src="/js-test-resources/js-test.js"></script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<script>
description("Test whether WebSocket handshake fails if the server sends Sec-WebSocket-Extensions header.");
window.jsTestIsAsync = true;
var url = "ws://localhost:8880/handshake-fail-by-extensions-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();
};
ws.onerror = function(errorEvent)
{
testPassed("onerror() was called");
};
</script>
</body>
</html>