Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /xhr/send-data-sharedarraybuffer.any.html - WPT Dashboard Interop Dashboard
- /xhr/send-data-sharedarraybuffer.any.worker.html - WPT Dashboard Interop Dashboard
// META: title=XMLHttpRequest.send(sharedarraybuffer)
test(() => {
const xhr = new XMLHttpRequest();
const buf = new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer;
xhr.open("POST", "./resources/content.py", true);
assert_throws_js(TypeError, function() {
xhr.send(buf)
});
}, "sending a SharedArrayBuffer");
["Int8Array", "Uint8Array", "Uint8ClampedArray", "Int16Array", "Uint16Array",
"Int32Array", "Uint32Array", "BigInt64Array", "BigUint64Array",
"Float16Array", "Float32Array", "Float64Array", "DataView"].forEach((type) => {
test(() => {
const xhr = new XMLHttpRequest();
const arr = new self[type](new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer);
xhr.open("POST", "./resources/content.py", true);
assert_throws_js(TypeError, function() {
xhr.send(arr)
});
}, `sending a ${type} backed by a SharedArrayBuffer`);
});