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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-delete.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 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 ad0d97ce193cb3e07d1e7950bc851cd523e69980..0f847c3645a013eabdfa5660cf200b7bf51507cf 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
@@ -56,6 +56,26 @@ cache_test(function(cache) {
}, 'Cache.delete called with a Request object');
cache_test(function(cache) {
+ var request = new Request(test_url);
+ var response = new_test_response();
+ return cache.put(request, response)
+ .then(function() {
+ return cache.delete(new Request(test_url, {method: 'HEAD'}));
+ })
+ .then(function(result) {
+ assert_false(result,
+ '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.');
+ });
+ }, 'Cache.delete called with a HEAD request');
+
+
+cache_test(function(cache) {
return cache.delete(test_url)
.then(function(result) {
assert_false(result,

Powered by Google App Engine
This is Rietveld 408576698