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

Unified Diff: content/browser/cache_storage/cache_storage_manager_unittest.cc

Issue 2112383002: [CacheStorage] Initialize the cache backend immediately upon opening (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 years, 5 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
« no previous file with comments | « content/browser/cache_storage/cache_storage_cache_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/cache_storage/cache_storage_manager_unittest.cc
diff --git a/content/browser/cache_storage/cache_storage_manager_unittest.cc b/content/browser/cache_storage/cache_storage_manager_unittest.cc
index f46d994e74163ee20d47c007191ed958d978cb80..3de06912099609fb830e84b088dc0efa540b38eb 100644
--- a/content/browser/cache_storage/cache_storage_manager_unittest.cc
+++ b/content/browser/cache_storage/cache_storage_manager_unittest.cc
@@ -650,6 +650,11 @@ TEST_F(CacheStorageManagerTest, DropReference) {
EXPECT_TRUE(Open(origin1_, "foo"));
base::WeakPtr<CacheStorageCache> cache =
callback_cache_handle_->value()->AsWeakPtr();
+ // Run a cache operation to ensure that the cache has finished initializing so
+ // that when the handle is dropped it can close immediately.
+ EXPECT_FALSE(CacheMatch(callback_cache_handle_->value(),
+ GURL("http://example.com/foo")));
+
callback_cache_handle_ = nullptr;
EXPECT_FALSE(cache);
}
@@ -894,6 +899,10 @@ class CacheStorageMigrationTest : public CacheStorageManagerTest {
ASSERT_TRUE(Open(origin1_, cache1_));
ASSERT_TRUE(Open(origin1_, cache2_));
callback_cache_handle_.reset();
+
+ // Let the caches shut down.
+ base::RunLoop().RunUntilIdle();
+
ASSERT_FALSE(base::DirectoryExists(legacy_path_));
ASSERT_TRUE(base::DirectoryExists(new_path_));
« no previous file with comments | « content/browser/cache_storage/cache_storage_cache_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698