tizen beta release
[profile/ivi/webkit-efl.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 if (window.layoutTestController)
13     layoutTestController.overridePreference("WebKitHixie76WebSocketProtocolEnabled", 0);
14
15 var ws = new WebSocket("ws://localhost:8880/websocket/tests/hybi/simple");
16 shouldBeEqualToString("ws.binaryType", "blob");
17
18 ws.binaryType = "arraybuffer";
19 shouldBeEqualToString("ws.binaryType", "arraybuffer");
20
21 ws.binaryType = "blob";
22 shouldBeEqualToString("ws.binaryType", "blob");
23
24 shouldThrow("ws.binaryType = 'Blob'", "'Error: SYNTAX_ERR: DOM Exception 12'");
25 shouldThrow("ws.binaryType = 'ArrayBuffer'", "'Error: SYNTAX_ERR: DOM Exception 12'");
26 shouldThrow("ws.binaryType = ''", "'Error: SYNTAX_ERR: DOM Exception 12'");
27
28 </script>
29 <script src="../../../../js-test-resources/js-test-post.js"></script>
30 </body>
31 </html>