send-data-arraybufferview.any.js (494B)
1 // META: title=XMLHttpRequest.send(arraybufferview) 2 3 var test = async_test(); 4 test.step(function() 5 { 6 var str = "Hello"; 7 var bytes = str.split("").map(function(ch) { return ch.charCodeAt(0); }); 8 var xhr = new XMLHttpRequest(); 9 var arr = new Uint8Array(bytes); 10 11 xhr.onload = test.step_func_done(function() { 12 assert_equals(xhr.status, 200); 13 assert_equals(xhr.response, str); 14 }); 15 16 xhr.open("POST", "./resources/content.py", true); 17 xhr.send(arr); 18 });