Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / websocket / close-reason-too-long.html
blob9525747183fbead002b50b67002ed6dc1bb49dc9
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
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 type="text/javascript">
10 description("Checks whether SyntaxError is thrown when attempting to send too long reason.");
12 window.jsTestIsAsync = true;
14 var ws = new WebSocket("ws://localhost:8880/echo");
15 var message;
16 var longReason = '';
17 for (var i = 0; i < 124; ++i)
18 longReason += 'a';
20 ws.onopen = function()
22 debug("Connected.");
23 try {
24 ws.close(1000, longReason);
25 testFailed('SyntaxError should be thrown.');
26 } catch (e) {
27 if (e.name == 'SyntaxError')
28 testPassed('SyntaxError was thrown: ' + e);
29 else
30 testFailed('Unexpected exception: ' + e);
32 ws.close();
35 ws.onmessage = function (event)
37 message = event.data;
38 testFailed("onmessage() was called. (message = \"" + message + "\")");
41 ws.onclose = function()
43 finishJSTest();
46 </script>
47 </body>
48 </html>