Bug 1653487 [wpt PR 24644] - [fetch] Expose Request.body property., a=testonly

Automatic update from web-platform-tests
[fetch] Expose Request.body property.

This CL implements https://fetch.spec.whatwg.org/#body-mixin:
"""
Request includes Body;

The body attribute’s getter must return null if body is null and body’s stream otherwise.
"""
Since this feature is required for fetch upload streaming, this CL makes
it under the flag FetchUploadStreaming.

Fixed: 1105704
Change-Id: I334d9e1a3494ff4ba31efc9dc8b319294d2e19d4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2297035
Reviewed-by: Adam Rice <ricea@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#789852}

--

wpt-commits: 91723858b23e75cb18ddd58758b5c9cb54dd6db5
wpt-pr: 24644
This commit is contained in:
Yoichi Osato 2020-07-22 20:01:47 +00:00 коммит произвёл moz-wptsync-bot
Родитель 4529176383
Коммит 237200d2d5
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -2,6 +2,12 @@
"use strict";
test(() => {
const stream = new ReadableStream();
const request = new Request("...", { method:"POST", body: stream });
assert_equals(request.body, stream);
}, "Constructing a Request with a stream holds the original object.");
async function assert_request(test, input, init) {
assert_throws_js(TypeError, () => new Request(input, init), "new Request()");
await promise_rejects_js(test, TypeError, fetch(input, init), "fetch()");