Index: third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/body-mixin.js |
diff --git a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/body-mixin.js b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/body-mixin.js |
index 078afab5c8ad91752021a0c62b62a9a71192dfd3..852c726bc42c971777988138aa1358dbb1ac7161 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/body-mixin.js |
+++ b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/body-mixin.js |
@@ -103,6 +103,25 @@ promise_test(function(test) { |
.then(function(res) { |
response = res; |
assert_false(response.bodyUsed); |
+ var p = response.formData(); |
+ assert_true(response.bodyUsed); |
+ assert_true(isLocked(response.body)); |
+ return p; |
+ }) |
+ .then( |
+ unreached_fulfillment(test), |
+ function(e) { |
+ assert_true(isLocked(response.body)); |
+ assert_equals(e.name, 'TypeError', 'expected MIME type error'); |
+ }) |
+ }, 'FormDataFailedTest'); |
+ |
+promise_test(function(test) { |
+ var response; |
+ return fetch('/fetch/resources/doctype.html') |
+ .then(function(res) { |
+ response = res; |
+ assert_false(response.bodyUsed); |
var p = response.json(); |
assert_true(response.bodyUsed); |
assert_true(isLocked(response.body)); |
@@ -245,6 +264,14 @@ promise_test(t => { |
promise_test(t => { |
var res = new Response(''); |
res.body.cancel(); |
+ return res.formData().then(unreached_fulfillment(t), e => { |
+ assert_equals(e.name, 'TypeError'); |
+ }); |
+ }, 'Used => formData'); |
+ |
+promise_test(t => { |
+ var res = new Response(''); |
+ res.body.cancel(); |
return res.json().then(unreached_fulfillment(t), e => { |
assert_equals(e.name, 'TypeError'); |
}); |
@@ -280,6 +307,15 @@ promise_test(t => { |
promise_test(t => { |
var res = new Response(''); |
const reader = res.body.getReader(); |
+ return res.formData().then(unreached_fulfillment(t), e => { |
+ reader.releaseLock(); |
+ assert_equals(e.name, 'TypeError'); |
+ }); |
+ }, 'Locked => formData'); |
+ |
+promise_test(t => { |
+ var res = new Response(''); |
+ const reader = res.body.getReader(); |
return res.json().then(unreached_fulfillment(t), e => { |
reader.releaseLock(); |
assert_equals(e.name, 'TypeError'); |