Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / websocket / invalid-encode-length.html
blobb346f97638e9230d7dd0d61d924fa14ae96010b6
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <script src="/js-test-resources/js-test.js"></script>
5 </head>
6 <body>
7 <div id="description"></div>
8 <div id="console"></div>
9 <script>
10 description("Test whether WebSocket aborts the connection when it receives an unexpected encoding length frame.");
12 window.jsTestIsAsync = true;
14 var closeEvent;
15 var payload_extended = ["126_125", "126_0", "127_65535", "127_0"];
16 var totalTestSize = 4;
18 function doTest(curTest)
20 var url = "ws://127.0.0.1:8880/invalid-encode-length?case=" + payload_extended[curTest];
21 var ws = new WebSocket(url);
23 debug("Case " + payload_extended[curTest] + ": Test started.");
25 ws.onopen = function()
27 debug("onopen() was called.");
30 ws.onmessage = function(event)
32 var message = event.data;
33 testFailed("onmessage() was called. (message = \"" + message + "\")");
36 ws.onclose = function(event)
38 debug("onclose() was called.");
39 closeEvent = event;
40 shouldBeFalse("closeEvent.wasClean");
41 if (curTest == totalTestSize - 1)
42 finishJSTest();
43 else
44 doTest(curTest + 1);
47 ws.onerror = function(errorEvent)
49 testPassed("onerror() was called");
53 doTest(0);
55 </script>
56 </body>
57 </html>