diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-17 00:50:04 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-17 00:50:04 +0000 |
commit | 220d7100e2095b875c401e32c3aab2830d4405e0 (patch) | |
tree | aaebd1ff70fb44f4d4a835411b49f9ae2b17694e /net/disk_cache/disk_cache_test_base.h | |
parent | 4eaa87f37d0fd5af2487f60aee9323882c39f2e9 (diff) | |
download | chromium_src-220d7100e2095b875c401e32c3aab2830d4405e0.zip chromium_src-220d7100e2095b875c401e32c3aab2830d4405e0.tar.gz chromium_src-220d7100e2095b875c401e32c3aab2830d4405e0.tar.bz2 |
Disk cache: Modify the unit tests so that they test both
eviction algorithms without having to recompile the code.
Review URL: http://codereview.chromium.org/79031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13909 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 | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/net/disk_cache/disk_cache_test_base.h b/net/disk_cache/disk_cache_test_base.h index 3c38921..317e056 100644 --- a/net/disk_cache/disk_cache_test_base.h +++ b/net/disk_cache/disk_cache_test_base.h @@ -31,7 +31,7 @@ class DiskCacheTestWithCache : public DiskCacheTest { DiskCacheTestWithCache() : cache_(NULL), cache_impl_(NULL), mem_cache_(NULL), mask_(0), size_(0), memory_only_(false), implementation_(false), force_creation_(false), - first_cleanup_(true) {} + new_eviction_(false), first_cleanup_(true), integrity_(true) {} void InitCache(); virtual void TearDown(); @@ -58,10 +58,18 @@ class DiskCacheTestWithCache : public DiskCacheTest { force_creation_ = true; } + void SetNewEviction() { + new_eviction_ = true; + } + void DisableFirstCleanup() { first_cleanup_ = false; } + void DisableIntegrityCheck() { + integrity_ = 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_; @@ -73,11 +81,16 @@ class DiskCacheTestWithCache : public DiskCacheTest { bool memory_only_; bool implementation_; bool force_creation_; + bool new_eviction_; bool first_cleanup_; + bool integrity_; + // This is intentionally left uninitialized, to be used by any test. + bool success_; private: void InitMemoryCache(); void InitDiskCache(); + void InitDiskCacheImpl(const std::wstring path); }; #endif // NET_DISK_CACHE_DISK_CACHE_TEST_BASE_H_ |