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 // A set of Request/Response pairs to be used with prepopulated_cache_test(). | 7 // A set of Request/Response pairs to be used with prepopulated_cache_test(). |
8 var simple_entries = [ | 8 var simple_entries = [ |
9 { | 9 { |
10 name: 'a', | 10 name: 'a', |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
443 return result.text(); | 443 return result.text(); |
444 }) | 444 }) |
445 .then(function(body_text) { | 445 .then(function(body_text) { |
446 assert_equals(body_text, 'a simple text file\n', | 446 assert_equals(body_text, 'a simple text file\n', |
447 'Cache.match should return a Response object with a ' + | 447 'Cache.match should return a Response object with a ' + |
448 'valid body each time it is called.'); | 448 'valid body each time it is called.'); |
449 }); | 449 }); |
450 }, 'Cache.match invoked multiple times for the same Request/Response'); | 450 }, 'Cache.match invoked multiple times for the same Request/Response'); |
451 | 451 |
452 prepopulated_cache_test(simple_entries, function(cache, entries) { | 452 prepopulated_cache_test(simple_entries, function(cache, entries) { |
453 var request = new Request(entries.a.request, {method: 'POST'}); | 453 var request = new Request(entries.a.request.clone(), {method: 'POST'}); |
jsbell
2015/07/09 23:44:37
Rebase to eliminate this diff. :)
| |
454 return cache.match(request) | 454 return cache.match(request) |
455 .then(function(result) { | 455 .then(function(result) { |
456 assert_equals(result, undefined, | 456 assert_equals(result, undefined, |
457 'Cache.match should not find a match'); | 457 'Cache.match should not find a match'); |
458 }); | 458 }); |
459 }, 'Cache.match with POST Request'); | 459 }, 'Cache.match with POST Request'); |
460 | 460 |
461 prepopulated_cache_test(simple_entries, function(cache, entries) { | 461 prepopulated_cache_test(simple_entries, function(cache, entries) { |
462 var response = entries.non_2xx_response.response; | 462 var response = entries.non_2xx_response.response; |
463 return cache.match(entries.non_2xx_response.request.url) | 463 return cache.match(entries.non_2xx_response.request.url) |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
508 assert_equals(Object.keys(hash).length, entries.length); | 508 assert_equals(Object.keys(hash).length, entries.length); |
509 }); | 509 }); |
510 | 510 |
511 return p.then(function() { | 511 return p.then(function() { |
512 return test_function(cache, hash); | 512 return test_function(cache, hash); |
513 }); | 513 }); |
514 }, description); | 514 }, description); |
515 } | 515 } |
516 | 516 |
517 done(); | 517 done(); |
OLD | NEW |