mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
xhr: update test-suite to reflect use of XMLHttpRequestBodyInit
This commit is contained in:
parent
dc690653da
commit
a97d2e3b9b
4 changed files with 3 additions and 83 deletions
|
@ -527006,7 +527006,7 @@
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
"send-data-es-object.any.js": [
|
"send-data-es-object.any.js": [
|
||||||
"c6fe5de260c212013052f66636b92fb07aa82373",
|
"92286bca6dd00b82b78de39fcf7988ba1c424d07",
|
||||||
[
|
[
|
||||||
"xhr/send-data-es-object.any.html",
|
"xhr/send-data-es-object.any.html",
|
||||||
{
|
{
|
||||||
|
@ -527055,42 +527055,6 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
"send-data-readablestream.any.js": [
|
|
||||||
"c53b1071828f95669d41a967c51bd352b389bebb",
|
|
||||||
[
|
|
||||||
"xhr/send-data-readablestream.any.html",
|
|
||||||
{
|
|
||||||
"script_metadata": [
|
|
||||||
[
|
|
||||||
"global",
|
|
||||||
"window,dedicatedworker,sharedworker"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"xhr/send-data-readablestream.any.sharedworker.html",
|
|
||||||
{
|
|
||||||
"script_metadata": [
|
|
||||||
[
|
|
||||||
"global",
|
|
||||||
"window,dedicatedworker,sharedworker"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"xhr/send-data-readablestream.any.worker.html",
|
|
||||||
{
|
|
||||||
"script_metadata": [
|
|
||||||
[
|
|
||||||
"global",
|
|
||||||
"window,dedicatedworker,sharedworker"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"send-data-sharedarraybuffer.any.js": [
|
"send-data-sharedarraybuffer.any.js": [
|
||||||
"912f622697d538edbbc038f7ec76c2e63ee6ffa0",
|
"912f622697d538edbbc038f7ec76c2e63ee6ffa0",
|
||||||
[
|
[
|
||||||
|
@ -527442,7 +527406,7 @@
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
"setrequestheader-content-type.htm": [
|
"setrequestheader-content-type.htm": [
|
||||||
"8608c5967d6b29ba4f9d09ae7bf395a6b26876c2",
|
"07238391eb5cc8639edbe996208a18b6d9d26b04",
|
||||||
[
|
[
|
||||||
null,
|
null,
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,6 +27,7 @@ function do_test(obj, expected, name) {
|
||||||
do_test({}, '[object Object]', 'sending a plain empty object')
|
do_test({}, '[object Object]', 'sending a plain empty object')
|
||||||
do_test(Math, '[object Math]', 'sending the ES Math object')
|
do_test(Math, '[object Math]', 'sending the ES Math object')
|
||||||
do_test(new XMLHttpRequest, '[object XMLHttpRequest]', 'sending a new XHR instance')
|
do_test(new XMLHttpRequest, '[object XMLHttpRequest]', 'sending a new XHR instance')
|
||||||
|
do_test(new ReadableStream, '[object ReadableStream]', 'sending a new ReadableStream instance')
|
||||||
do_test({toString:function(){}}, 'undefined', 'sending object that stringifies to undefined')
|
do_test({toString:function(){}}, 'undefined', 'sending object that stringifies to undefined')
|
||||||
do_test({toString:function(){return null}}, 'null', 'sending object that stringifies to null')
|
do_test({toString:function(){return null}}, 'null', 'sending object that stringifies to null')
|
||||||
var ancestor = {toString: function(){
|
var ancestor = {toString: function(){
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
// META: global=window,dedicatedworker,sharedworker
|
|
||||||
|
|
||||||
function assert_xhr(stream) {
|
|
||||||
const client = new XMLHttpRequest();
|
|
||||||
client.open("POST", "...");
|
|
||||||
assert_throws_js(TypeError, () => client.send(stream));
|
|
||||||
}
|
|
||||||
|
|
||||||
test(() => {
|
|
||||||
const stream = new ReadableStream();
|
|
||||||
stream.getReader();
|
|
||||||
assert_xhr(stream);
|
|
||||||
}, "XMLHttpRequest: send() with a stream on which getReader() is called");
|
|
||||||
|
|
||||||
test(() => {
|
|
||||||
const stream = new ReadableStream();
|
|
||||||
stream.getReader().read();
|
|
||||||
assert_xhr(stream);
|
|
||||||
}, "XMLHttpRequest: send() with a stream on which read() is called");
|
|
||||||
|
|
||||||
promise_test(async () => {
|
|
||||||
const stream = new ReadableStream({ pull: c => c.enqueue(new Uint8Array()) }),
|
|
||||||
reader = stream.getReader();
|
|
||||||
await reader.read();
|
|
||||||
reader.releaseLock();
|
|
||||||
assert_xhr(stream);
|
|
||||||
}, "XMLHttpRequest: send() with a stream on which read() and releaseLock() are called");
|
|
|
@ -215,24 +215,6 @@
|
||||||
// https://fetch.spec.whatwg.org/#bodyinit, so the user's must be changed to match it
|
// https://fetch.spec.whatwg.org/#bodyinit, so the user's must be changed to match it
|
||||||
// as per https://xhr.spec.whatwg.org/#the-send%28%29-method step 4.
|
// as per https://xhr.spec.whatwg.org/#the-send%28%29-method step 4.
|
||||||
)
|
)
|
||||||
request(
|
|
||||||
function _ReadableStream() { return new ReadableStream() },
|
|
||||||
{"Content-Type": ""},
|
|
||||||
"",
|
|
||||||
'ReadableStream request respects setRequestHeader("")'
|
|
||||||
)
|
|
||||||
request(
|
|
||||||
function _ReadableStream() { return new ReadableStream() },
|
|
||||||
{},
|
|
||||||
undefined,
|
|
||||||
"ReadableStream request with under type sends no Content-Type without setRequestHeader() call"
|
|
||||||
)
|
|
||||||
request(
|
|
||||||
function _ReadableStream() { return new ReadableStream() },
|
|
||||||
{"Content-Type": "application/xml;charset=ASCII"},
|
|
||||||
"application/xml;charset=ASCII",
|
|
||||||
"ReadableStream request keeps setRequestHeader() Content-Type and charset"
|
|
||||||
)
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue