| 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 var URL = 'https://www.example.com/test.html'; | 5 var URL = 'https://www.example.com/test.html'; |
| 6 | 6 |
| 7 function size(headers) { | 7 function size(headers) { |
| 8 var count = 0; | 8 var count = 0; |
| 9 for (var header of headers) { | 9 for (var header of headers) { |
| 10 ++count; | 10 ++count; |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 | 475 |
| 476 return req.text().then(function(text) { | 476 return req.text().then(function(text) { |
| 477 assert_equals(text, 'Test Blob', 'Body of request should match.'); | 477 assert_equals(text, 'Test Blob', 'Body of request should match.'); |
| 478 return req2.text(); | 478 return req2.text(); |
| 479 }).then(function(text) { | 479 }).then(function(text) { |
| 480 assert_equals(text, 'Test Blob', 'Cloned request body should match.'); | 480 assert_equals(text, 'Test Blob', 'Cloned request body should match.'); |
| 481 return Promise.all([req.text(), req2.text()]); | 481 return Promise.all([req.text(), req2.text()]); |
| 482 }).then(function(texts) { | 482 }).then(function(texts) { |
| 483 assert_equals(texts[0], '', 'The body is consumed.'); | 483 assert_equals(texts[0], '', 'The body is consumed.'); |
| 484 assert_equals(texts[1], '', 'The body is consumed.'); | 484 assert_equals(texts[1], '', 'The body is consumed.'); |
| 485 return req.clone().text(); |
| 486 }).then(function(text) { |
| 487 assert_equals(text, '', 'The body was consumed before cloned.'); |
| 485 }); | 488 }); |
| 486 }, 'Test clone behavior with loading content from Request.'); | 489 }, 'Test clone behavior with loading content from Request.'); |
| 487 | 490 |
| 488 async_test(function(t) { | 491 async_test(function(t) { |
| 489 var request = | 492 var request = |
| 490 new Request(URL, | 493 new Request(URL, |
| 491 { | 494 { |
| 492 method: 'POST', | 495 method: 'POST', |
| 493 body: new Blob(['Test Blob'], {type: 'test/type'}) | 496 body: new Blob(['Test Blob'], {type: 'test/type'}) |
| 494 }); | 497 }); |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 body: new Blob([''], {type: 'Text/Plain'}), | 702 body: new Blob([''], {type: 'Text/Plain'}), |
| 700 headers: [['Content-Type', 'Text/Html']]}); | 703 headers: [['Content-Type', 'Text/Html']]}); |
| 701 return req.blob() | 704 return req.blob() |
| 702 .then(function(blob) { | 705 .then(function(blob) { |
| 703 assert_equals(blob.type, 'text/html'); | 706 assert_equals(blob.type, 'text/html'); |
| 704 assert_equals(req.headers.get('Content-Type'), 'Text/Html'); | 707 assert_equals(req.headers.get('Content-Type'), 'Text/Html'); |
| 705 }); | 708 }); |
| 706 }, 'Extract a MIME type (1)'); | 709 }, 'Extract a MIME type (1)'); |
| 707 | 710 |
| 708 done(); | 711 done(); |
| OLD | NEW |