Remove LayoutTestController and WebKitTestRunner support for Hixie76 WebSockets
[WebKit-https.git] / LayoutTests / http / tests / websocket / tests / hybi / binary-type.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>
10 description("Test WebSocket.binaryType attribute.");
11
12 var ws = new WebSocket("ws://localhost:8880/websocket/tests/hybi/simple");
13 shouldBeEqualToString("ws.binaryType", "blob");
14
15 ws.binaryType = "arraybuffer";
16 shouldBeEqualToString("ws.binaryType", "arraybuffer");
17
18 ws.binaryType = "blob";
19 shouldBeEqualToString("ws.binaryType", "blob");
20
21 shouldThrow("ws.binaryType = 'Blob'", "'Error: SYNTAX_ERR: DOM Exception 12'");
22 shouldThrow("ws.binaryType = 'ArrayBuffer'", "'Error: SYNTAX_ERR: DOM Exception 12'");
23 shouldThrow("ws.binaryType = ''", "'Error: SYNTAX_ERR: DOM Exception 12'");
24
25 </script>
26 <script src="../../../../js-test-resources/js-test-post.js"></script>
27 </body>
28 </html>