OLD | NEW |
1 <html> | 1 <html> |
2 <body> | 2 <body> |
3 Tests sending an array buffer. | 3 Tests sending an array buffer. |
4 <script> | 4 <script> |
5 if (window.layoutTestController) | 5 if (window.layoutTestController) |
6 layoutTestController.dumpAsText(); | 6 layoutTestController.dumpAsText(); |
7 | 7 |
8 var console_messages = document.createElement("ul"); | 8 var console_messages = document.createElement("ul"); |
9 document.body.appendChild(console_messages); | 9 document.body.appendChild(console_messages); |
10 | 10 |
11 function log(message) | 11 function log(message) |
12 { | 12 { |
13 var item = document.createElement("li"); | 13 var item = document.createElement("li"); |
14 item.appendChild(document.createTextNode(message)); | 14 item.appendChild(document.createTextNode(message)); |
15 console_messages.appendChild(item); | 15 console_messages.appendChild(item); |
16 } | 16 } |
17 | 17 |
18 var array = new Uint8Array([0, 1, 2, 48, 49, 50, 128, 129, 130, 253, 254, 255]); | 18 var array = new Uint8Array([0, 1, 2, 48, 49, 50, 128, 129, 130, 253, 254, 255]); |
19 var xhr = new XMLHttpRequest; | 19 var xhr = new XMLHttpRequest; |
20 xhr.open("POST", "resources/post-echo-as-ascii.cgi", false); | 20 xhr.open("POST", "resources/post-echo-as-ascii.cgi", false); |
21 xhr.send(array.buffer); | 21 xhr.send(array.buffer); |
22 log(xhr.responseText); | 22 log(xhr.responseText); |
23 </script> | 23 </script> |
24 </body> | 24 </body> |
25 </html> | 25 </html> |
OLD | NEW |