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 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 assert_equals(text, 'hello'); | 563 assert_equals(text, 'hello'); |
564 var req2 = new Request(req); | 564 var req2 = new Request(req); |
565 assert_true(req.bodyUsed); | 565 assert_true(req.bodyUsed); |
566 assert_false(req2.bodyUsed); | 566 assert_false(req2.bodyUsed); |
567 return req2.text(); | 567 return req2.text(); |
568 }).then(function(text) { | 568 }).then(function(text) { |
569 assert_equals(text, ''); | 569 assert_equals(text, ''); |
570 }); | 570 }); |
571 }, 'Consume and pass'); | 571 }, 'Consume and pass'); |
572 | 572 |
| 573 // Tests for requests context. |
| 574 test(function() { |
| 575 var request = new Request('http://localhost/', {method: 'POST', body: ''}); |
| 576 assert_equals(request.context, '', |
| 577 'Request.context should be empty string ' + |
| 578 'for synthetic Request object'); |
| 579 }, 'RequestContext of a synthetic Request object'); |
| 580 |
573 done(); | 581 done(); |
OLD | NEW |