| <!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 rejects control frames longer than 125 bytes."); |
| |
| window.jsTestIsAsync = true; |
| |
| var url = "ws://localhost:8880/long-control-frame"; |
| var ws = new WebSocket(url); |
| var closeEvent; |
| var message; |
| |
| ws.onopen = function() |
| { |
| debug("onopen() was called."); |
| }; |
| |
| ws.onclose = function(event) |
| { |
| closeEvent = event; |
| shouldBeFalse("closeEvent.wasClean"); |
| finishJSTest(); |
| }; |
| |
| ws.onerror = function(errorEvent) |
| { |
| testPassed("onerror() was called"); |
| }; |
| |
| </script> |
| </body> |
| </html> |