OLD | NEW |
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 Loading... |
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(); |
OLD | NEW |