diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-30 21:41:54 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-30 21:41:54 +0000 |
commit | a9da16d0e7aa10ad2f4ee3290edc361b862e6314 (patch) | |
tree | a5ecba94190bd01ae479f7274d450296ad241f11 /net/disk_cache/disk_cache_test_base.h | |
parent | 01e9c8a645db02edb5b0c8b33ff091f55b47dbd5 (diff) | |
download | chromium_src-a9da16d0e7aa10ad2f4ee3290edc361b862e6314.zip chromium_src-a9da16d0e7aa10ad2f4ee3290edc361b862e6314.tar.gz chromium_src-a9da16d0e7aa10ad2f4ee3290edc361b862e6314.tar.bz2 |
Add unit tests to the disk cache to verify that a failure during cache reinitialization is handled properly.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/disk_cache_test_base.h')
-rw-r--r-- | net/disk_cache/disk_cache_test_base.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/net/disk_cache/disk_cache_test_base.h b/net/disk_cache/disk_cache_test_base.h index feb22b2..1c18afe 100644 --- a/net/disk_cache/disk_cache_test_base.h +++ b/net/disk_cache/disk_cache_test_base.h @@ -46,11 +46,13 @@ class DiskCacheTestBase : public testing::Test { protected: DiskCacheTestBase() : cache_(NULL), cache_impl_(NULL), mem_cache_(NULL), mask_(0), size_(0), - memory_only_(false), implementation_(false), force_creation_(false) {} + memory_only_(false), implementation_(false), force_creation_(false), + first_cleanup_(true) {} void InitCache(); virtual void TearDown(); void SimulateCrash(); + void SetTestMode(); void SetMemoryOnlyMode() { memory_only_ = true; @@ -72,6 +74,10 @@ class DiskCacheTestBase : public testing::Test { force_creation_ = true; } + void DisableFirstCleanup() { + first_cleanup_ = false; + } + // cache_ will always have a valid object, regardless of how the cache was // initialized. The implementation pointers can be NULL. disk_cache::Backend* cache_; @@ -83,6 +89,7 @@ class DiskCacheTestBase : public testing::Test { bool memory_only_; bool implementation_; bool force_creation_; + bool first_cleanup_; private: void InitMemoryCache(); |