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

Unified Diff: components/browsing_data/content/storage_partition_http_cache_data_remover.cc

Issue 2768883002: Change MockBrowsingDataRemover to MockBrowsingDataRemoverDelegate (Closed)
Patch Set: MockDelegate Created 3 years, 9 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 | « chrome/browser/chrome_content_browser_client_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/browsing_data/content/storage_partition_http_cache_data_remover.cc
diff --git a/components/browsing_data/content/storage_partition_http_cache_data_remover.cc b/components/browsing_data/content/storage_partition_http_cache_data_remover.cc
index 5eeff79f1ecb2ceb9dbaae2872f6d8fde8efa9e9..85194862f72d771c3b90a5f75b68ad09744e93c4 100644
--- a/components/browsing_data/content/storage_partition_http_cache_data_remover.cc
+++ b/components/browsing_data/content/storage_partition_http_cache_data_remover.cc
@@ -83,8 +83,6 @@ void StoragePartitionHttpCacheDataRemover::ClearHttpCacheOnIOThread() {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
next_cache_state_ = CacheState::NONE;
DCHECK_EQ(CacheState::NONE, next_cache_state_);
- DCHECK(main_context_getter_.get());
- DCHECK(media_context_getter_.get());
next_cache_state_ = CacheState::CREATE_MAIN;
DoClearCache(net::OK);
@@ -111,6 +109,15 @@ void StoragePartitionHttpCacheDataRemover::DoClearCache(int rv) {
(next_cache_state_ == CacheState::CREATE_MAIN)
? main_context_getter_.get()
: media_context_getter_.get();
+
+ // Caches might not exist in tests.
+ if (!getter) {
+ next_cache_state_ = (next_cache_state_ == CacheState::CREATE_MAIN)
+ ? CacheState::CREATE_MEDIA
+ : CacheState::DONE;
+ break;
+ }
+
net::HttpCache* http_cache = getter->GetURLRequestContext()
->http_transaction_factory()
->GetCache();
« no previous file with comments | « chrome/browser/chrome_content_browser_client_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698