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 prepopulated_cache_test(simple_entries, function(cache, entries) { | 7 prepopulated_cache_test(simple_entries, function(cache, entries) { |
8 return cache.matchAll('not-present-in-the-cache') | 8 return cache.matchAll('not-present-in-the-cache') |
9 .then(function(result) { | 9 .then(function(result) { |
10 assert_response_array_equivalent( | 10 assert_response_array_equivalent( |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 prepopulated_cache_test(simple_entries, function(cache, entries) { | 87 prepopulated_cache_test(simple_entries, function(cache, entries) { |
88 return cache.matchAll('http') | 88 return cache.matchAll('http') |
89 .then(function(result) { | 89 .then(function(result) { |
90 assert_response_array_equivalent( | 90 assert_response_array_equivalent( |
91 result, [], | 91 result, [], |
92 'Cache.matchAll should treat query as a URL and not ' + | 92 'Cache.matchAll should treat query as a URL and not ' + |
93 'just a string fragment.'); | 93 'just a string fragment.'); |
94 }); | 94 }); |
95 }, 'Cache.matchAll with string fragment "http" as query'); | 95 }, 'Cache.matchAll with string fragment "http" as query'); |
96 | 96 |
| 97 prepopulated_cache_test(simple_entries, function(cache, entries) { |
| 98 return cache.matchAll() |
| 99 .then(function(result) { |
| 100 assert_response_array_equivalent( |
| 101 result, |
| 102 [ |
| 103 entries.a.response, |
| 104 entries.b.response, |
| 105 entries.a_with_query.response, |
| 106 entries.A.response, |
| 107 entries.a_https.response, |
| 108 entries.a_org.response, |
| 109 entries.cat.response, |
| 110 entries.catmandu.response, |
| 111 entries.cat_num_lives.response, |
| 112 entries.cat_in_the_hat.response, |
| 113 entries.non_2xx_response.response, |
| 114 entries.error_response.response |
| 115 ], |
| 116 'Cache.matchAll without parameters should match all entries.'); |
| 117 }); |
| 118 }, 'Cache.matchAll without parameters'); |
| 119 |
97 prepopulated_cache_test(vary_entries, function(cache, entries) { | 120 prepopulated_cache_test(vary_entries, function(cache, entries) { |
98 return cache.matchAll('http://example.com/c') | 121 return cache.matchAll('http://example.com/c') |
99 .then(function(result) { | 122 .then(function(result) { |
100 assert_response_array_equivalent( | 123 assert_response_array_equivalent( |
101 result, | 124 result, |
102 [ | 125 [ |
103 entries.vary_cookie_absent.response | 126 entries.vary_cookie_absent.response |
104 ], | 127 ], |
105 'Cache.matchAll should exclude matches if a vary header is ' + | 128 'Cache.matchAll should exclude matches if a vary header is ' + |
106 'missing in the query request, but is present in the cached ' + | 129 'missing in the query request, but is present in the cached ' + |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 [ | 168 [ |
146 entries.vary_cookie_is_cookie.response, | 169 entries.vary_cookie_is_cookie.response, |
147 entries.vary_cookie_is_good.response, | 170 entries.vary_cookie_is_good.response, |
148 entries.vary_cookie_absent.response | 171 entries.vary_cookie_absent.response |
149 ], | 172 ], |
150 'Cache.matchAll should honor "ignoreVary" parameter.'); | 173 'Cache.matchAll should honor "ignoreVary" parameter.'); |
151 }); | 174 }); |
152 }, 'Cache.matchAll with "ignoreVary" parameter'); | 175 }, 'Cache.matchAll with "ignoreVary" parameter'); |
153 | 176 |
154 done(); | 177 done(); |
OLD | NEW |