OLD | NEW |
1 if (self.importScripts) { | 1 if (self.importScripts) { |
2 importScripts('/resources/testharness.js'); | 2 importScripts('/resources/testharness.js'); |
3 importScripts('/resources/testharness-helpers.js'); | 3 importScripts('/resources/testharness-helpers.js'); |
4 importScripts('../resources/test-helpers.js'); | 4 importScripts('../resources/test-helpers.js'); |
5 } | 5 } |
6 | 6 |
7 var test_url = 'https://example.com/foo'; | 7 var test_url = 'https://example.com/foo'; |
8 var test_body = 'Hello world!'; | 8 var test_body = 'Hello world!'; |
9 | 9 |
10 cache_test(function(cache) { | 10 cache_test(function(cache) { |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 'Response.bodyUsed should be initially false.'); | 284 'Response.bodyUsed should be initially false.'); |
285 return response.text().then(function() { | 285 return response.text().then(function() { |
286 assert_false( | 286 assert_false( |
287 response.bodyUsed, | 287 response.bodyUsed, |
288 '[https://fetch.spec.whatwg.org/#concept-body-consume-body] ' + | 288 '[https://fetch.spec.whatwg.org/#concept-body-consume-body] ' + |
289 'The text() method should not set "body passed" flag.'); | 289 'The text() method should not set "body passed" flag.'); |
290 return cache.put(new Request(test_url), response); | 290 return cache.put(new Request(test_url), response); |
291 }); | 291 }); |
292 }, 'Cache.put with a used response body'); | 292 }, 'Cache.put with a used response body'); |
293 | 293 |
| 294 cache_test(function(cache) { |
| 295 var response = new Response(test_body); |
| 296 return cache.put(new Request(test_url), response) |
| 297 .then(function() { |
| 298 return response.body.getReader().closed; |
| 299 }); |
| 300 }, 'getReader() after Cache.put'); |
| 301 |
294 done(); | 302 done(); |
OLD | NEW |