Index: LayoutTests/http/tests/fetch/script-tests/response.js |
diff --git a/LayoutTests/http/tests/fetch/script-tests/response.js b/LayoutTests/http/tests/fetch/script-tests/response.js |
index 46dde766908b3a85a8c2428812c88695792c76b0..65166e4e74032314559eee8c9a296d02bab2898e 100644 |
--- a/LayoutTests/http/tests/fetch/script-tests/response.js |
+++ b/LayoutTests/http/tests/fetch/script-tests/response.js |
@@ -308,10 +308,18 @@ promise_test(function(t) { |
}, 'MIME type for Blob'); |
promise_test(function(t) { |
- var res = new Response(new Blob([''], {type: 'Text/Plain'})); |
+ var res = new Response(new Blob(['hello'], {type: 'Text/Plain'})); |
return res.blob() |
.then(function(blob) { |
assert_equals(blob.type, 'text/plain'); |
+ assert_equals(blob.size, 5); |
+ assert_equals(res.headers.get('Content-Type'), 'text/plain'); |
+ return res.blob(); |
+ }).then(function(blob) { |
+ // When we read from a response twice, it returns an empty contents. |
+ // But the type should remain. |
+ assert_equals(blob.type, 'text/plain'); |
+ assert_equals(blob.size, 0); |
assert_equals(res.headers.get('Content-Type'), 'text/plain'); |
}); |
}, 'MIME type for Blob with non-empty type'); |