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

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

Issue 2116783002: [CacheStorage] Don't call GetUsageAndQuota from a scheduled operation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 6 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.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_cache_unittest.cc
diff --git a/content/browser/cache_storage/cache_storage_cache_unittest.cc b/content/browser/cache_storage/cache_storage_cache_unittest.cc
index a8200769fb23392ff360f9fcb26134097dda936d..7c07da028c89c36bd337468c83dd9a48f2c9b14c 100644
--- a/content/browser/cache_storage/cache_storage_cache_unittest.cc
+++ b/content/browser/cache_storage/cache_storage_cache_unittest.cc
@@ -1128,7 +1128,7 @@ TEST_P(CacheStorageCacheTestP, QuotaManagerModified) {
TEST_P(CacheStorageCacheTestP, PutObeysQuotaLimits) {
mock_quota_manager_->SetQuota(GURL(kOrigin), storage::kStorageTypeTemporary,
0);
- EXPECT_FALSE(Put(no_body_request_, no_body_response_));
+ EXPECT_FALSE(Put(body_request_, body_response_));
EXPECT_EQ(CACHE_STORAGE_ERROR_QUOTA_EXCEEDED, callback_error_);
}
@@ -1148,41 +1148,6 @@ TEST_P(CacheStorageCacheTestP, Size) {
EXPECT_EQ(0, Size());
}
-TEST_P(CacheStorageCacheTestP, SizeOperationsArePrioritized) {
- // Test that pending size operations (those waiting for initialization) run
- // before other scheduler operations.
- cache_->set_delay_backend_creation(true); // Delay cache initialization
-
- CacheStorageBatchOperation operation;
- operation.operation_type = CACHE_STORAGE_CACHE_OPERATION_TYPE_PUT;
- operation.request = body_request_;
- operation.response = body_response_;
-
- callback_error_ = CACHE_STORAGE_ERROR_NOT_FOUND;
- base::RunLoop run_loop;
- // Start a put operation that blocks on initialization.
- cache_->BatchOperation(std::vector<CacheStorageBatchOperation>(1, operation),
- base::Bind(&CacheStorageCacheTest::ErrorTypeCallback,
- base::Unretained(this), &run_loop));
-
- // Next start a size operation that also blocks on initialization.
- bool size_callback_called = false;
- cache_->Size(base::Bind(&CacheStorageCacheTest::SizeCallback,
- base::Unretained(this), nullptr,
- &size_callback_called));
-
- base::RunLoop().RunUntilIdle();
- EXPECT_FALSE(size_callback_called);
- EXPECT_EQ(CACHE_STORAGE_ERROR_NOT_FOUND, callback_error_);
-
- // Finish initialization. The Size operation should complete before Put gets
- // to run as Size has priority. See crbug.com/605663.
- cache_->ContinueCreateBackend();
- run_loop.Run();
- EXPECT_TRUE(size_callback_called);
- EXPECT_EQ(CACHE_STORAGE_OK, callback_error_);
-}
-
TEST_P(CacheStorageCacheTestP, GetSizeThenClose) {
EXPECT_TRUE(Put(body_request_, body_response_));
int64_t cache_size = Size();
« no previous file with comments | « content/browser/cache_storage/cache_storage_cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698