| <!DOCTYPE html> |
| <html lang="en"> |
| <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 sends status line with invalid http version."); |
| |
| window.jsTestIsAsync = true; |
| |
| var url = "ws://localhost:8880/websocket/tests/hybi/handshake-fail-by-invalid-http-version"; |
| 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> |