Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-matchAll.js

Issue 1832863002: [CacheStorage] Make CacheStorage::MatchAllCaches return in order (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add layout test Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 13 matching lines...) Expand all
24 prepopulated_cache_test(simple_entries, function(cache, entries) { 24 prepopulated_cache_test(simple_entries, function(cache, entries) {
25 return cache.matchAll(entries.a.request) 25 return cache.matchAll(entries.a.request)
26 .then(function(result) { 26 .then(function(result) {
27 assert_response_array_equals( 27 assert_response_array_equals(
28 result, [entries.a.response], 28 result, [entries.a.response],
29 'Cache.matchAll should match by Request.'); 29 'Cache.matchAll should match by Request.');
30 }); 30 });
31 }, 'Cache.matchAll with Request'); 31 }, 'Cache.matchAll with Request');
32 32
33 prepopulated_cache_test(simple_entries, function(cache, entries) { 33 prepopulated_cache_test(simple_entries, function(cache, entries) {
34 var alt_response = new Response('', {status: 201});
35
36 return self.caches.open('second_matching_cache')
37 .then(function(cache) {
38 return cache.put(entries.a.request, alt_response.clone());
39 })
40 .then(function() {
41 return cache.matchAll(entries.a.request)
nhiroki 2016/03/25 14:48:35 I think you need to call |self.caches.match|. Can
jkarlin 2016/03/25 15:35:10 Thank you!! The name CacheStorage::MatchAllCache g
42 })
43 .then(function(result) {
44 assert_response_array_equals(
45 result, [entries.a.response],
46 'Cache.matchAll should match the first cache.');
47 });
48 }, 'Cache.matchAll with multiple cache hits');
49
50 prepopulated_cache_test(simple_entries, function(cache, entries) {
34 return cache.matchAll(new Request(entries.a.request.url)) 51 return cache.matchAll(new Request(entries.a.request.url))
35 .then(function(result) { 52 .then(function(result) {
36 assert_response_array_equals( 53 assert_response_array_equals(
37 result, [entries.a.response], 54 result, [entries.a.response],
38 'Cache.matchAll should match by Request.'); 55 'Cache.matchAll should match by Request.');
39 }); 56 });
40 }, 'Cache.matchAll with new Request'); 57 }, 'Cache.matchAll with new Request');
41 58
42 prepopulated_cache_test(simple_entries, function(cache, entries) { 59 prepopulated_cache_test(simple_entries, function(cache, entries) {
43 return cache.matchAll(entries.a.request, 60 return cache.matchAll(entries.a.request,
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 [ 185 [
169 entries.vary_cookie_is_cookie.response, 186 entries.vary_cookie_is_cookie.response,
170 entries.vary_cookie_is_good.response, 187 entries.vary_cookie_is_good.response,
171 entries.vary_cookie_absent.response 188 entries.vary_cookie_absent.response
172 ], 189 ],
173 'Cache.matchAll should honor "ignoreVary" parameter.'); 190 'Cache.matchAll should honor "ignoreVary" parameter.');
174 }); 191 });
175 }, 'Cache.matchAll with "ignoreVary" parameter'); 192 }, 'Cache.matchAll with "ignoreVary" parameter');
176 193
177 done(); 194 done();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698