OLD | NEW |
1 importScripts('worker-test-harness.js'); | 1 importScripts('worker-testharness.js'); |
| 2 importScripts('../../resources/testharness-helpers.js'); |
2 | 3 |
3 promise_test(function() { | 4 promise_test(function() { |
4 var response = new Response('test string'); | 5 var response = new Response('test string'); |
5 assert_equals( | 6 assert_equals( |
6 response.headers.get('Content-Type'), | 7 response.headers.get('Content-Type'), |
7 'text/plain;charset=UTF-8', | 8 'text/plain;charset=UTF-8', |
8 'A Response constructed with a string should have a Content-Type.'); | 9 'A Response constructed with a string should have a Content-Type.'); |
9 return response.text() | 10 return response.text() |
10 .then(function(text) { | 11 .then(function(text) { |
11 assert_equals(text, 'test string', | 12 assert_equals(text, 'test string', |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 response3 = response.clone(); | 92 response3 = response.clone(); |
92 assert_true(response3.bodyUsed, | 93 assert_true(response3.bodyUsed, |
93 "bodyUsed should be true in clone of consumed response."); | 94 "bodyUsed should be true in clone of consumed response."); |
94 return response2.text(); | 95 return response2.text(); |
95 }) | 96 }) |
96 .then(function(text) { | 97 .then(function(text) { |
97 assert_equals(text, 'test string', | 98 assert_equals(text, 'test string', |
98 'Response clone response body text should match.'); | 99 'Response clone response body text should match.'); |
99 }); | 100 }); |
100 }, 'Behavior of bodyUsed in Response and clone behavior.'); | 101 }, 'Behavior of bodyUsed in Response and clone behavior.'); |
OLD | NEW |