blob: b5517788fc4f5d4cc1e80642c0a5a8c3b105c5c1 [file] [log] [blame]
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
promise_test(test => {
const request = new Request("", {body: "value", method: "POST"});
request.body;
return fetch(request);
}, "Creating a request body stream should not prevent a request from being fetched");
promise_test(test => {
const request = new Request("", {body: "value", method: "POST"});
request.body.getReader();
return promise_rejects_js(test, TypeError, fetch(request));
}, "Locking a request body stream should prevent a request from being fetched");
promise_test(test => {
var stream = new ReadableStream({start: controller => {
controller.enqueue(new ArrayBuffer(10));
controller.close();
}});
var request = new Request("", {body: stream, mode:"cors", method: "POST"});
return promise_rejects_dom(test, "NotSupportedError", fetch(request));
}, "Uploading a readable stream body request is not supported");
</script>
</body>
</html>