| 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 1cb0439ccff6d6bc63ea8beb5fd271a20f5a3b52..abb071486c7116ece2993a05eca0d279d9e11e11 100644
|
| --- a/content/browser/cache_storage/cache_storage_manager_unittest.cc
|
| +++ b/content/browser/cache_storage/cache_storage_manager_unittest.cc
|
| @@ -555,7 +555,6 @@ TEST_P(CacheStorageManagerTestP, DropRefAfterNewCacheWithSameNameCreated) {
|
| // 1. Create cache A and hang onto the handle
|
| const GURL kTestURL = GURL("http://example.com/foo");
|
| EXPECT_TRUE(Open(origin1_, "foo"));
|
| - EXPECT_FALSE(CacheMatch(callback_cache_handle_->value(), kTestURL));
|
| std::unique_ptr<CacheStorageCacheHandle> cache_handle =
|
| std::move(callback_cache_handle_);
|
|
|
| @@ -564,7 +563,6 @@ TEST_P(CacheStorageManagerTestP, DropRefAfterNewCacheWithSameNameCreated) {
|
|
|
| // 3. Create cache B (with the same name)
|
| EXPECT_TRUE(Open(origin1_, "foo"));
|
| - EXPECT_FALSE(CacheMatch(callback_cache_handle_->value(), kTestURL));
|
|
|
| // 4. Drop handle to A
|
| cache_handle.reset();
|
| @@ -573,6 +571,32 @@ TEST_P(CacheStorageManagerTestP, DropRefAfterNewCacheWithSameNameCreated) {
|
| EXPECT_FALSE(CacheMatch(callback_cache_handle_->value(), kTestURL));
|
| }
|
|
|
| +TEST_P(CacheStorageManagerTestP, DeleteCorrectDirectory) {
|
| + // This test reproduces crbug.com/630036.
|
| + // 1. Cache A with name "foo" is created
|
| + const GURL kTestURL = GURL("http://example.com/foo");
|
| + EXPECT_TRUE(Open(origin1_, "foo"));
|
| + std::unique_ptr<CacheStorageCacheHandle> cache_handle =
|
| + std::move(callback_cache_handle_);
|
| +
|
| + // 2. Cache A is doomed, but js hangs onto the handle.
|
| + EXPECT_TRUE(Delete(origin1_, "foo"));
|
| +
|
| + // 3. Cache B with name "foo" is created
|
| + EXPECT_TRUE(Open(origin1_, "foo"));
|
| +
|
| + // 4. Cache B is doomed, and both handles are reset.
|
| + EXPECT_TRUE(Delete(origin1_, "foo"));
|
| + cache_handle.reset();
|
| + callback_cache_handle_.reset();
|
| +
|
| + // Do some busy work on a different cache to move the cache pool threads
|
| + // along and trigger the bug.
|
| + EXPECT_TRUE(Open(origin1_, "bar"));
|
| + EXPECT_TRUE(CachePut(callback_cache_handle_->value(), kTestURL));
|
| + EXPECT_TRUE(CacheMatch(callback_cache_handle_->value(), kTestURL));
|
| +}
|
| +
|
| TEST_P(CacheStorageManagerTestP, StorageMatchAllEntryExistsTwice) {
|
| EXPECT_TRUE(Open(origin1_, "foo"));
|
| EXPECT_TRUE(CachePutWithStatusCode(callback_cache_handle_->value(),
|
|
|