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

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

Issue 2232223003: [CacheStorage] Check doomed caches first when dropping cache handles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Rebase 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-storage.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-storage.js b/third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-storage.js
index f8db82d1f6cab061b1fcc83183678aa71e523880..673cf50f01ca85146983862c9de6bb81967c6002 100644
--- a/third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-storage.js
+++ b/third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-storage.js
@@ -16,6 +16,40 @@ promise_test(function(t) {
}, 'CacheStorage.open');
promise_test(function(t) {
+ var cache_name = 'cache-storage/bar';
+ var first_cache = null;
+ var second_cache = null;
+ return self.caches.open(cache_name)
+ .then(function(cache) {
+ first_cache = cache;
+ return self.caches.delete(cache_name);
+ })
+ .then(function() {
+ return first_cache.add('../resources/simple.txt');
+ })
+ .then(function() {
+ return self.caches.keys();
+ })
+ .then(function(cache_names) {
+ assert_equals(cache_names.indexOf(cache_name), -1);
+ return self.caches.open(cache_name);
+ })
+ .then(function(cache) {
+ second_cache = cache;
+ return second_cache.keys();
+ })
+ .then(function(keys) {
+ assert_equals(keys.length, 0);
+ return first_cache.keys();
+ })
+ .then(function(keys) {
+ assert_equals(keys.length, 1);
+ // Clean up
+ return self.caches.delete(cache_name);
+ })
+ }, 'CacheStorage.delete dooms');
+
+promise_test(function(t) {
// Note that this test may collide with other tests running in the same
// origin that also uses an empty cache name.
var cache_name = '';

Powered by Google App Engine
This is Rietveld 408576698