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

Unified Diff: net/http/mock_http_cache.h

Issue 1230113012: [net] Better StopCaching() handling for HttpCache::Transaction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing MockTransaction initializers Created 5 years, 3 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: net/http/mock_http_cache.h
diff --git a/net/http/mock_http_cache.h b/net/http/mock_http_cache.h
index 632bb3e63c16996290e5ed945c6d7f7909eea5c0..7d53cd828b5bd29893c414df4a351fc4262e2006 100644
--- a/net/http/mock_http_cache.h
+++ b/net/http/mock_http_cache.h
@@ -137,6 +137,10 @@ class MockDiskCache : public disk_cache::Backend {
// Returns number of times a cache entry was successfully created.
int create_count() const { return create_count_; }
+ // Resets open_count() and create_count(). Calling this is recommended to
+ // reset the counts after test setup.
+ void ResetCounts();
+
// Fail any subsequent CreateEntry and OpenEntry.
void set_fail_requests() { fail_requests_ = true; }
@@ -195,6 +199,9 @@ class MockHttpCache {
// Wrapper to fail request conditionalization for new transactions.
void FailConditionalizations();
+ // Reset the transaction and operation counts.
+ void ResetCounts();
+
// Helper function for reading response info from the disk cache.
static bool ReadResponseInfo(disk_cache::Entry* disk_entry,
HttpResponseInfo* response_info,

Powered by Google App Engine
This is Rietveld 408576698