Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Unified Diff: LayoutTests/http/tests/fetch/script-tests/response.js

Issue 1109423005: Revive a fetch() test accidentally removed (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e073efa7de9457cdf90f88702b57a1ac35ad9897..3bb470065df4ccc0ea9bffad9e0eace2fb07798d 100644
--- a/LayoutTests/http/tests/fetch/script-tests/response.js
+++ b/LayoutTests/http/tests/fetch/script-tests/response.js
@@ -346,10 +346,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');
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698