| 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 test(function() { | 7 test(function() { |
| 8 var headers = new Headers; | 8 var headers = new Headers; |
| 9 headers.set('User-Agent', 'Mozilla/5.0'); | 9 headers.set('User-Agent', 'Mozilla/5.0'); |
| 10 headers.set('Accept', 'text/html'); | 10 headers.set('Accept', 'text/html'); |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 {method: 'POST', | 741 {method: 'POST', |
| 742 body: new Blob([''], {type: 'Text/Plain'}), | 742 body: new Blob([''], {type: 'Text/Plain'}), |
| 743 headers: [['Content-Type', 'Text/Html']]}); | 743 headers: [['Content-Type', 'Text/Html']]}); |
| 744 return req.blob() | 744 return req.blob() |
| 745 .then(function(blob) { | 745 .then(function(blob) { |
| 746 assert_equals(blob.type, 'text/html'); | 746 assert_equals(blob.type, 'text/html'); |
| 747 assert_equals(req.headers.get('Content-Type'), 'Text/Html'); | 747 assert_equals(req.headers.get('Content-Type'), 'Text/Html'); |
| 748 }); | 748 }); |
| 749 }, 'Extract a MIME type (1)'); | 749 }, 'Extract a MIME type (1)'); |
| 750 | 750 |
| 751 promise_test(function(t) { |
| 752 var req = new Request('http://localhost/', |
| 753 {method: 'POST', |
| 754 credentials: 'include', |
| 755 body: 'this is a body'}); |
| 756 |
| 757 return req.text() |
| 758 .then(t => { |
| 759 assert_equals(t, 'this is a body'); |
| 760 }); |
| 761 }, 'Credentials and body can both be set.'); |
| 762 |
| 751 done(); | 763 done(); |
| OLD | NEW |