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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-delete.js

Issue 2242883002: [CacheStorage] Use QueryCache everywhere (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments from PS9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-delete.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-delete.js b/third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-delete.js
index 0f847c3645a013eabdfa5660cf200b7bf51507cf..bdbd43bd36ca39e9e87c863ad79c32a0c8416840 100644
--- a/third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-delete.js
+++ b/third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-delete.js
@@ -64,16 +64,45 @@ cache_test(function(cache) {
})
.then(function(result) {
assert_false(result,
- 'Cache.delete should not match a non-GET request ' +
- 'unless ignoreMethod option is set.');
+ 'Cache.delete should not match a non-GET request ' +
+ 'unless ignoreMethod option is set.');
return cache.match(test_url);
})
.then(function(result) {
assert_response_equals(result, response,
'Cache.delete should leave non-matching response in the cache.');
+ return cache.delete(new Request(test_url, {method: 'HEAD'}),
+ {ignoreMethod: true});
+ })
+ .then(function(result) {
+ assert_true(result,
+ 'Cache.delete should match a non-GET request ' +
+ ' if ignoreMethod is true.')
});
}, 'Cache.delete called with a HEAD request');
+cache_test(function(cache) {
+ var vary_request = new Request('http://example.com/c',
+ {headers: {'Cookies': 'is-for-cookie'}});
+ var vary_response = new Response('', {headers: {'Vary': 'Cookies'}});
+ var mismatched_vary_request = new Request('http://example.com/c');
+
+ return cache.put(vary_request.clone(), vary_response.clone())
+ .then(function() {
+ return cache.delete(mismatched_vary_request.clone());
+ })
+ .then(function(result) {
+ assert_false(result,
+ 'Cache.delete should not delete if vary does not ' +
+ 'match unless ignoreVary is true');
+ return cache.delete(mismatched_vary_request.clone(),
+ {ignoreVary: true});
+ })
+ .then(function(result) {
+ assert_true(result,
+ 'Cache.delete should ignore vary if ignoreVary is true');
+ });
+ }, 'Cache.delete supports ignoreVary');
cache_test(function(cache) {
return cache.delete(test_url)

Powered by Google App Engine
This is Rietveld 408576698