Remove LayoutTestController and WebKitTestRunner support for Hixie76 WebSockets
[WebKit-https.git] / LayoutTests / http / tests / websocket / tests / hybi / too-long-payload.html
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <script src="../../../../js-test-resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <div id="description"></div>
8 <div id="console"></div>
9 <script type="text/javascript">
10 description("Tests whether WebSocket correctly aborts the connection when it receives a frame with too long payload.");
11
12 window.jsTestIsAsync = true;
13
14 var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hybi/too-long-payload");
15 var closeEvent;
16
17 ws.onopen = function()
18 {
19     debug("onopen() was called.");
20 };
21
22 ws.onmessage = function(event)
23 {
24     var message = event.data;
25     testFailed("onmessage() was called. (message = \"" + message + "\")");
26 };
27
28 ws.onclose = function(event)
29 {
30     debug("onclose() was called.");
31     closeEvent = event;
32     shouldBeFalse("closeEvent.wasClean");
33     finishJSTest();
34 };
35
36 </script>
37 <script src="../../../../js-test-resources/js-test-post.js"></script>
38 </body>
39 </html>