OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_DISK_CACHE_DISK_CACHE_TEST_BASE_H_ | 5 #ifndef NET_DISK_CACHE_DISK_CACHE_TEST_BASE_H_ |
6 #define NET_DISK_CACHE_DISK_CACHE_TEST_BASE_H_ | 6 #define NET_DISK_CACHE_DISK_CACHE_TEST_BASE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 // Makes sure that some time passes before continuing the test. Time::Now() | 140 // Makes sure that some time passes before continuing the test. Time::Now() |
141 // before and after this method will not be the same. | 141 // before and after this method will not be the same. |
142 void AddDelay(); | 142 void AddDelay(); |
143 | 143 |
144 // DiskCacheTest: | 144 // DiskCacheTest: |
145 virtual void TearDown() OVERRIDE; | 145 virtual void TearDown() OVERRIDE; |
146 | 146 |
147 // cache_ will always have a valid object, regardless of how the cache was | 147 // cache_ will always have a valid object, regardless of how the cache was |
148 // initialized. The implementation pointers can be NULL. | 148 // initialized. The implementation pointers can be NULL. |
149 disk_cache::Backend* cache_; | 149 scoped_ptr<disk_cache::Backend> cache_; |
150 disk_cache::BackendImpl* cache_impl_; | 150 disk_cache::BackendImpl* cache_impl_; |
151 disk_cache::SimpleBackendImpl* simple_cache_impl_; | 151 disk_cache::SimpleBackendImpl* simple_cache_impl_; |
152 disk_cache::MemBackendImpl* mem_cache_; | 152 disk_cache::MemBackendImpl* mem_cache_; |
153 | 153 |
154 uint32 mask_; | 154 uint32 mask_; |
155 int size_; | 155 int size_; |
156 net::CacheType type_; | 156 net::CacheType type_; |
157 bool memory_only_; | 157 bool memory_only_; |
158 bool simple_cache_mode_; | 158 bool simple_cache_mode_; |
159 bool simple_cache_wait_for_index_; | 159 bool simple_cache_wait_for_index_; |
160 bool force_creation_; | 160 bool force_creation_; |
161 bool new_eviction_; | 161 bool new_eviction_; |
162 bool first_cleanup_; | 162 bool first_cleanup_; |
163 bool integrity_; | 163 bool integrity_; |
164 bool use_current_thread_; | 164 bool use_current_thread_; |
165 // This is intentionally left uninitialized, to be used by any test. | 165 // This is intentionally left uninitialized, to be used by any test. |
166 bool success_; | 166 bool success_; |
167 | 167 |
168 private: | 168 private: |
169 void InitMemoryCache(); | 169 void InitMemoryCache(); |
170 void InitDiskCache(); | 170 void InitDiskCache(); |
171 | 171 |
172 base::Thread cache_thread_; | 172 base::Thread cache_thread_; |
173 DISALLOW_COPY_AND_ASSIGN(DiskCacheTestWithCache); | 173 DISALLOW_COPY_AND_ASSIGN(DiskCacheTestWithCache); |
174 }; | 174 }; |
175 | 175 |
176 #endif // NET_DISK_CACHE_DISK_CACHE_TEST_BASE_H_ | 176 #endif // NET_DISK_CACHE_DISK_CACHE_TEST_BASE_H_ |
OLD | NEW |