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

Unified Diff: net/http/mock_http_cache.h

Issue 22926031: Sparse IO: Allow failover to network in debug builds (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trying another upload, hopefully it will override the previous "old chunk mismatch" Created 7 years, 4 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 | « net/http/http_cache_unittest.cc ('k') | net/http/mock_http_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/mock_http_cache.h
diff --git a/net/http/mock_http_cache.h b/net/http/mock_http_cache.h
index 6cb0e50f56287db00afc8a118f937810e1af684a..90399ec4ff006f29c7d324c6ba91c63a11c06a91 100644
--- a/net/http/mock_http_cache.h
+++ b/net/http/mock_http_cache.h
@@ -21,7 +21,6 @@
class MockDiskEntry : public disk_cache::Entry,
public base::RefCounted<MockDiskEntry> {
public:
- MockDiskEntry();
explicit MockDiskEntry(const std::string& key);
bool is_doomed() const { return doomed_; }
@@ -53,6 +52,8 @@ class MockDiskEntry : public disk_cache::Entry,
// Fail most subsequent requests.
void set_fail_requests() { fail_requests_ = true; }
+ void set_fail_sparse_requests() { fail_sparse_requests_ = true; }
+
// If |value| is true, don't deliver any completion callbacks until called
// again with |value| set to false. Caution: remember to enable callbacks
// again or all subsequent tests will fail.
@@ -85,6 +86,7 @@ class MockDiskEntry : public disk_cache::Entry,
bool doomed_;
bool sparse_;
bool fail_requests_;
+ bool fail_sparse_requests_;
bool busy_;
bool delayed_;
static bool cancel_;
@@ -134,6 +136,9 @@ class MockDiskCache : public disk_cache::Backend {
// Makes sure that CreateEntry is not called twice for a given key.
void set_double_create_check(bool value) { double_create_check_ = value; }
+ // Makes all requests for data ranges to fail as not implemented.
+ void set_fail_sparse_requests() { fail_sparse_requests_ = true; }
+
void ReleaseAll();
private:
@@ -147,6 +152,7 @@ class MockDiskCache : public disk_cache::Backend {
bool fail_requests_;
bool soft_failures_;
bool double_create_check_;
+ bool fail_sparse_requests_;
};
class MockBackendFactory : public net::HttpCache::BackendFactory {
« no previous file with comments | « net/http/http_cache_unittest.cc ('k') | net/http/mock_http_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698