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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 assert_equals(text, 'hello'); | 629 assert_equals(text, 'hello'); |
630 var req2 = new Request(req); | 630 var req2 = new Request(req); |
631 assert_true(req.bodyUsed); | 631 assert_true(req.bodyUsed); |
632 assert_false(req2.bodyUsed); | 632 assert_false(req2.bodyUsed); |
633 return req2.text(); | 633 return req2.text(); |
634 }).then(function(text) { | 634 }).then(function(text) { |
635 assert_equals(text, ''); | 635 assert_equals(text, ''); |
636 }); | 636 }); |
637 }, 'Consume and pass'); | 637 }, 'Consume and pass'); |
638 | 638 |
639 // Tests for requests context. | |
640 test(function() { | |
641 var request = new Request('http://localhost/', {method: 'POST', body: ''}); | |
642 assert_equals(request.context, '', | |
643 'Request.context should be empty string ' + | |
644 'for synthetic Request object'); | |
645 }, 'RequestContext of a synthetic Request object'); | |
646 | |
647 done(); | 639 done(); |
OLD | NEW |