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

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

Issue 1049983003: [Fetch] Body consume function should not set bodyUsed flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@stream-clone
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 unified diff | Download patch
OLDNEW
1 if (self.importScripts) { 1 if (self.importScripts) {
2 importScripts('../resources/fetch-test-helpers.js'); 2 importScripts('../resources/fetch-test-helpers.js');
3 } 3 }
4 4
5 function size(headers) { 5 function size(headers) {
6 var count = 0; 6 var count = 0;
7 for (var header of headers) { 7 for (var header of headers) {
8 ++count; 8 ++count;
9 } 9 }
10 return count; 10 return count;
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 {headers: [['Content-Type', 'Text/Html']]}); 486 {headers: [['Content-Type', 'Text/Html']]});
487 res.body.cancel(); 487 res.body.cancel();
488 res = res.clone(); 488 res = res.clone();
489 return res.blob() 489 return res.blob()
490 .then(function(blob) { 490 .then(function(blob) {
491 assert_equals(blob.type, 'text/html'); 491 assert_equals(blob.type, 'text/html');
492 assert_equals(res.headers.get('Content-Type'), 'Text/Html'); 492 assert_equals(res.headers.get('Content-Type'), 'Text/Html');
493 }); 493 });
494 }, 'Extract a MIME type (3)'); 494 }, 'Extract a MIME type (3)');
495 495
496 promise_test(function(t) {
497 var res = new Response('hello');
498 return res.text().then(function(text) {
499 assert_equals(text, 'hello');
500 return Promise.all([res.text(), res.text()]);
501 }).then(function(texts) {
502 assert_equals(texts[0], '');
503 assert_equals(texts[1], '');
504 return res.body.getReader().read();
505 }).then(function(r) {
506 assert_true(r.done);
507 assert_equals(r.value, undefined);
508 });
509 }, 'Read after text()');
510
496 done(); 511 done();
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/fetch/script-tests/request.js ('k') | LayoutTests/http/tests/fetch/script-tests/response-content.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698