aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wpt/web-platform-tests/xhr/send-data-sharedarraybuffer.any.js
diff options
context:
space:
mode:
authorWPT Sync Bot <josh+wptsync@joshmatthews.net>2020-02-20 08:20:07 +0000
committerWPT Sync Bot <josh+wptsync@joshmatthews.net>2020-02-20 13:37:42 +0000
commitaf74a5d2cfb3b4fc77527d9927e5307babfdada1 (patch)
tree765347defa4e7d47e91ef86059f3359511ce4557 /tests/wpt/web-platform-tests/xhr/send-data-sharedarraybuffer.any.js
parentf5ff38b87559cd25db44fa7bc6f2a9c4cb2264e0 (diff)
downloadservo-af74a5d2cfb3b4fc77527d9927e5307babfdada1.tar.gz
servo-af74a5d2cfb3b4fc77527d9927e5307babfdada1.zip
Update web-platform-tests to revision 993a932dca2b378a44dc55f4ee80812f65d8fb4e
Diffstat (limited to 'tests/wpt/web-platform-tests/xhr/send-data-sharedarraybuffer.any.js')
-rw-r--r--tests/wpt/web-platform-tests/xhr/send-data-sharedarraybuffer.any.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/wpt/web-platform-tests/xhr/send-data-sharedarraybuffer.any.js b/tests/wpt/web-platform-tests/xhr/send-data-sharedarraybuffer.any.js
new file mode 100644
index 00000000000..b902888f560
--- /dev/null
+++ b/tests/wpt/web-platform-tests/xhr/send-data-sharedarraybuffer.any.js
@@ -0,0 +1,24 @@
+// META: title=XMLHttpRequest.send(sharedarraybuffer)
+
+test(() => {
+ var xhr = new XMLHttpRequest();
+ var buf = new SharedArrayBuffer();
+
+ 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", "Float32Array", "Float64Array", "DataView"].forEach((type) => {
+ test(() => {
+ var xhr = new XMLHttpRequest();
+ var arr = new self[type](new SharedArrayBuffer());
+
+ xhr.open("POST", "./resources/content.py", true);
+ assert_throws_js(TypeError, function() {
+ xhr.send(arr)
+ });
+ }, `sending a ${type} backed by a SharedArrayBuffer`);
+});