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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 }, 'Cache.put with a used response body'); | 295 }, 'Cache.put with a used response body'); |
296 | 296 |
297 cache_test(function(cache) { | 297 cache_test(function(cache) { |
298 var response = new Response(test_body); | 298 var response = new Response(test_body); |
299 return cache.put(new Request(test_url), response) | 299 return cache.put(new Request(test_url), response) |
300 .then(function() { | 300 .then(function() { |
301 assert_throws(new TypeError(), () => response.body.getReader()); | 301 assert_throws(new TypeError(), () => response.body.getReader()); |
302 }); | 302 }); |
303 }, 'getReader() after Cache.put'); | 303 }, 'getReader() after Cache.put'); |
304 | 304 |
| 305 cache_test(function(cache) { |
| 306 return assert_promise_rejects( |
| 307 cache.put(new Request(test_url), |
| 308 new Response(test_body, { headers: { VARY: '*' }})), |
| 309 new TypeError(), |
| 310 'Cache.put should reject VARY:* Responses with a TypeError.'); |
| 311 }, 'Cache.put with a VARY:* Response'); |
| 312 |
| 313 cache_test(function(cache) { |
| 314 return assert_promise_rejects( |
| 315 cache.put(new Request(test_url), |
| 316 new Response(test_body, |
| 317 { headers: { VARY: 'Accept-Language,*' }})), |
| 318 new TypeError(), |
| 319 'Cache.put should reject Responses with an embedded VARY:* with a ' + |
| 320 'TypeError.'); |
| 321 }, 'Cache.put with an embedded VARY:* Response'); |
| 322 |
305 done(); | 323 done(); |
OLD | NEW |