Skip to content
Permalink
Browse files

typed array support for XMLHttpRequest's send API

  • Loading branch information...
nupurbaghel committed Mar 24, 2018
1 parent a69ecee commit 2009c4e481f6d25bf266a62515f7a5b91b01895c
@@ -13,7 +13,7 @@
*/

// https://fetch.spec.whatwg.org/#bodyinit
typedef (Blob or /*BufferSource or */ FormData or DOMString or URLSearchParams) BodyInit;
typedef (Blob or BufferSource or FormData or DOMString or URLSearchParams) BodyInit;

enum XMLHttpRequestResponseType {
"",
@@ -520,6 +520,8 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
Some(DocumentOrBodyInit::FormData(ref formdata)) => Some(formdata.extract()),
Some(DocumentOrBodyInit::String(ref str)) => Some(str.extract()),
Some(DocumentOrBodyInit::URLSearchParams(ref urlsp)) => Some(urlsp.extract()),
Some(DocumentOrBodyInit::ArrayBuffer(ref typedarray)) => Some((typedarray.to_vec(), None)),
Some(DocumentOrBodyInit::ArrayBufferView(ref typedarray)) => Some((typedarray.to_vec(), None)),
None => None,
};

@@ -1441,6 +1443,8 @@ impl Extractable for BodyInit {
BodyInit::URLSearchParams(ref usp) => usp.extract(),
BodyInit::Blob(ref b) => b.extract(),
BodyInit::FormData(ref formdata) => formdata.extract(),
BodyInit::ArrayBuffer(ref typedarray) => ((typedarray.to_vec(), None)),
BodyInit::ArrayBufferView(ref typedarray) => ((typedarray.to_vec(), None)),
}
}
}
@@ -12,24 +12,6 @@
[Fetch with POST with URLSearchParams body]
expected: FAIL

[Fetch with POST with ArrayBuffer body]
expected: FAIL

[Fetch with POST with Uint8Array body]
expected: FAIL

[Fetch with POST with Int8Array body]
expected: FAIL

[Fetch with POST with Float32Array body]
expected: FAIL

[Fetch with POST with Float64Array body]
expected: FAIL

[Fetch with POST with DataView body]
expected: FAIL

[Fetch with POST with Blob body with mime type]
expected: FAIL

@@ -1,23 +1,5 @@
[request-upload.any.html]
type: testharness
[Fetch with POST with ArrayBuffer body]
expected: FAIL

[Fetch with POST with Uint8Array body]
expected: FAIL

[Fetch with POST with Int8Array body]
expected: FAIL

[Fetch with POST with Float32Array body]
expected: FAIL

[Fetch with POST with Float64Array body]
expected: FAIL

[Fetch with POST with DataView body]
expected: FAIL

[Fetch with POST with ReadableStream]
expected: FAIL

@@ -39,24 +21,6 @@

[request-upload.any.worker.html]
type: testharness
[Fetch with POST with ArrayBuffer body]
expected: FAIL

[Fetch with POST with Uint8Array body]
expected: FAIL

[Fetch with POST with Int8Array body]
expected: FAIL

[Fetch with POST with Float32Array body]
expected: FAIL

[Fetch with POST with Float64Array body]
expected: FAIL

[Fetch with POST with DataView body]
expected: FAIL

[Fetch with POST with ReadableStream]
expected: FAIL

@@ -12,27 +12,3 @@
[UTF-8 with BOM with fetched data (UTF-16 charset)]
expected: FAIL

[UTF-8 without BOM with Request.text()]
expected: FAIL

[UTF-8 without BOM with Response.text()]
expected: FAIL

[UTF-16BE with BOM decoded as UTF-8 with Request.text()]
expected: FAIL

[UTF-16BE with BOM decoded as UTF-8 with Response.text()]
expected: FAIL

[UTF-16LE with BOM decoded as UTF-8 with Request.text()]
expected: FAIL

[UTF-16LE with BOM decoded as UTF-8 with Response.text()]
expected: FAIL

[UTF-16 without BOM decoded as UTF-8 with Request.text()]
expected: FAIL

[UTF-16 without BOM decoded as UTF-8 with Response.text()]
expected: FAIL

@@ -18,9 +18,6 @@
[Consume empty FormData request body as text]
expected: FAIL
[Consume empty ArrayBuffer request body as text]
expected: FAIL
[Consume request's body as json (error case)]
expected: FAIL

@@ -6,37 +6,7 @@
[Consume String request's body as formData]
expected: FAIL

[Consume Int8Array request's body as text]
expected: FAIL
[Consume Int8Array request's body as blob]
expected: FAIL

[Consume Int8Array request's body as arrayBuffer]
expected: FAIL
[Consume ArrayBuffer request's body as text]
expected: FAIL

[Consume Float32Array request's body as blob]
expected: FAIL
[Consume Float32Array request's body as arrayBuffer]
expected: FAIL

[Consume Float32Array request's body as JSON]
expected: FAIL
[Consume DataView request's body as text]
expected: FAIL

[Consume DataView request's body as blob]
expected: FAIL
[Consume DataView request's body as arrayBuffer]
expected: FAIL

[Consume DataView request's body as JSON]
[Trying to consume bad JSON text as JSON: 'undefined']
expected: FAIL

[Consume FormData request's body as FormData]
@@ -68,4 +38,3 @@
[Consume Float32Array request's body as text]
expected: FAIL

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -1,14 +1,8 @@
[setrequestheader-content-type.htm]
type: testharness
[ArrayBuffer request sends no Content-Type without setRequestHeader() call]
expected: FAIL

[ArrayBuffer request keeps setRequestHeader() Content-Type and charset]
expected: FAIL

[ArrayBufferView request sends no Content-Type without setRequestHeader() call]
expected: FAIL

[ArrayBufferView request keeps setRequestHeader() Content-Type and charset]
expected: FAIL

@@ -11593,11 +11593,6 @@
{}
]
],
"mozilla/resources/content.py": [
[
{}
]
],
"mozilla/resources/external.js": [
[
{}
{}
]
],
"mozilla/send-arraybuffer.htm": [
[
"/_mozilla/mozilla/send-arraybuffer.htm",
{}
]
],
"mozilla/send-blob.htm": [
[
"/_mozilla/mozilla/send-blob.htm",
{}
]
],
"mozilla/sequence-hole.html": [
[
"/_mozilla/mozilla/sequence-hole.html",
"1a76b81400b1e150f008d11180adcdf786e77b67",
"support"
],
"mozilla/resources/content.py": [
"5cf25421cc9c0e0f88a159b363f99f37036d019f",
"support"
],
"mozilla/resources/external.js": [
"78686147f85e4146e7fc58c1f67a613f65b099a2",
"support"
"fc757effccd93c56ab79b0510a01ae815b7a8714",
"testharness"
],
"mozilla/send-arraybuffer.htm": [
"dc04c6f888458b28bd29a3a43f4dab7f12e72a33",
"testharness"
],
"mozilla/send-blob.htm": [
"5d8d62c0c2c27edbb875183a31a9005c950141cc",
"testharness"
],
"mozilla/sequence-hole.html": [
"db0cc2660c8d937ccf6e3334c92dc48208c69841",
"testharness"

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

0 comments on commit 2009c4e

Please sign in to comment.
You can’t perform that action at this time.