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

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

Issue 2204683002: Cache API should not match() HEAD requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: HEAD -> Head Created 4 years, 4 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/test-helpers.js'); 3 importScripts('../resources/test-helpers.js');
4 } 4 }
5 5
6 prepopulated_cache_test(simple_entries, function(cache, entries) { 6 prepopulated_cache_test(simple_entries, function(cache, entries) {
7 return cache.matchAll('not-present-in-the-cache') 7 return cache.matchAll('not-present-in-the-cache')
8 .then(function(result) { 8 .then(function(result) {
9 assert_response_array_equivalent( 9 assert_response_array_equivalent(
10 result, [], 10 result, [],
(...skipping 21 matching lines...) Expand all
32 prepopulated_cache_test(simple_entries, function(cache, entries) { 32 prepopulated_cache_test(simple_entries, function(cache, entries) {
33 return cache.matchAll(new Request(entries.a.request.url)) 33 return cache.matchAll(new Request(entries.a.request.url))
34 .then(function(result) { 34 .then(function(result) {
35 assert_response_array_equals( 35 assert_response_array_equals(
36 result, [entries.a.response], 36 result, [entries.a.response],
37 'Cache.matchAll should match by Request.'); 37 'Cache.matchAll should match by Request.');
38 }); 38 });
39 }, 'Cache.matchAll with new Request'); 39 }, 'Cache.matchAll with new Request');
40 40
41 prepopulated_cache_test(simple_entries, function(cache, entries) { 41 prepopulated_cache_test(simple_entries, function(cache, entries) {
42 return cache.matchAll(new Request(entries.a.request.url, {method: 'HEAD'}),
43 {ignoreSearch: true})
44 .then(function(result) {
45 assert_response_array_equals(
46 result, [],
47 'Cache.matchAll should not match HEAD Request.');
48 });
49 }, 'Cache.matchAll with HEAD');
50
51 prepopulated_cache_test(simple_entries, function(cache, entries) {
42 return cache.matchAll(entries.a.request, 52 return cache.matchAll(entries.a.request,
43 {ignoreSearch: true}) 53 {ignoreSearch: true})
44 .then(function(result) { 54 .then(function(result) {
45 assert_response_array_equivalent( 55 assert_response_array_equivalent(
46 result, 56 result,
47 [ 57 [
48 entries.a.response, 58 entries.a.response,
49 entries.a_with_query.response 59 entries.a_with_query.response
50 ], 60 ],
51 'Cache.matchAll with ignoreSearch should ignore the ' + 61 'Cache.matchAll with ignoreSearch should ignore the ' +
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 [ 177 [
168 entries.vary_cookie_is_cookie.response, 178 entries.vary_cookie_is_cookie.response,
169 entries.vary_cookie_is_good.response, 179 entries.vary_cookie_is_good.response,
170 entries.vary_cookie_absent.response 180 entries.vary_cookie_absent.response
171 ], 181 ],
172 'Cache.matchAll should honor "ignoreVary" parameter.'); 182 'Cache.matchAll should honor "ignoreVary" parameter.');
173 }); 183 });
174 }, 'Cache.matchAll with "ignoreVary" parameter'); 184 }, 'Cache.matchAll with "ignoreVary" parameter');
175 185
176 done(); 186 done();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698