f50b6bab712beffd97e62c9d936994c0b40129e0
[WebKit-https.git] / LayoutTests / http / tests / websocket / tests / hixie76 / bad-sub-protocol-control-chars.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
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("Test WebSocket bad sub-protocol names by control characters.");
11
12 if (window.layoutTestController)
13     layoutTestController.overridePreference("WebKitHixie76WebSocketProtocolEnabled", 1);
14
15 // Fails if protocol contains an character less than U+0020.
16 shouldThrow('new WebSocket("ws://127.0.0.1:8880/simple", "\u0000")');
17 shouldThrow('new WebSocket("ws://127.0.0.1:8880/simple", "\u0009")');
18 shouldThrow('new WebSocket("ws://127.0.0.1:8880/simple", "\u000A")');
19 shouldThrow('new WebSocket("ws://127.0.0.1:8880/simple", "\u000D")');
20 shouldThrow('new WebSocket("ws://127.0.0.1:8880/simple", "\u001B")');
21
22 </script>
23 <script src="../../../../js-test-resources/js-test-post.js"></script>
24 </body>
25 </html>