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

Side by Side Diff: net/disk_cache/disk_cache_test_base.cc

Issue 15203004: Disk cache: Reference CL for the implementation of file format version 3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/disk_cache/disk_cache_test_base.h ('k') | net/disk_cache/disk_cache_test_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "net/disk_cache/disk_cache_test_base.h" 5 #include "net/disk_cache/disk_cache_test_base.h"
6 6
7 #include "base/command_line.h"
7 #include "base/file_util.h" 8 #include "base/file_util.h"
8 #include "base/path_service.h" 9 #include "base/path_service.h"
9 #include "base/run_loop.h" 10 #include "base/run_loop.h"
10 #include "net/base/io_buffer.h" 11 #include "net/base/io_buffer.h"
11 #include "net/base/net_errors.h" 12 #include "net/base/net_errors.h"
12 #include "net/base/test_completion_callback.h" 13 #include "net/base/test_completion_callback.h"
13 #include "net/disk_cache/backend_impl.h" 14 #include "net/disk_cache/backend_impl.h"
14 #include "net/disk_cache/cache_util.h" 15 #include "net/disk_cache/cache_util.h"
15 #include "net/disk_cache/disk_cache.h" 16 #include "net/disk_cache/disk_cache.h"
16 #include "net/disk_cache/disk_cache_test_util.h" 17 #include "net/disk_cache/disk_cache_test_util.h"
17 #include "net/disk_cache/mem_backend_impl.h" 18 #include "net/disk_cache/mem_backend_impl.h"
18 #include "net/disk_cache/simple/simple_backend_impl.h" 19 #include "net/disk_cache/simple/simple_backend_impl.h"
20 #include "net/disk_cache/v3/backend_impl_v3.h"
21
22 namespace {
23
24 base::FilePath GetCachePath() {
25 base::FilePath path;
26 PathService::Get(base::DIR_TEMP, &path); // Ignore return value;
27 path = path.AppendASCII("cache_test");
28 if (!file_util::PathExists(path))
29 file_util::CreateDirectory(path);
30
31 return path;
32 }
33
34 } // namespace
19 35
20 DiskCacheTest::DiskCacheTest() { 36 DiskCacheTest::DiskCacheTest() {
21 CHECK(temp_dir_.CreateUniqueTempDir()); 37 CommandLine* command_line = CommandLine::ForCurrentProcess();
22 cache_path_ = temp_dir_.path(); 38 //if (command_line->HasSwitch("fixed-cache-dir")) {
39 if (true) {
40 cache_path_ = GetCachePath();
41 } else {
42 CHECK(temp_dir_.CreateUniqueTempDir());
43 cache_path_ = temp_dir_.path();
44 }
45
23 if (!MessageLoop::current()) 46 if (!MessageLoop::current())
24 message_loop_.reset(new MessageLoopForIO()); 47 message_loop_.reset(new MessageLoopForIO());
25 } 48 }
26 49
27 DiskCacheTest::~DiskCacheTest() { 50 DiskCacheTest::~DiskCacheTest() {
28 } 51 }
29 52
30 bool DiskCacheTest::CopyTestCache(const std::string& name) { 53 bool DiskCacheTest::CopyTestCache(const std::string& name) {
31 base::FilePath path; 54 base::FilePath path;
32 PathService::Get(base::DIR_SOURCE_ROOT, &path); 55 PathService::Get(base::DIR_SOURCE_ROOT, &path);
33 path = path.AppendASCII("net"); 56 path = path.AppendASCII("net");
34 path = path.AppendASCII("data"); 57 path = path.AppendASCII("data");
35 path = path.AppendASCII("cache_tests"); 58 path = path.AppendASCII("cache_tests");
36 path = path.AppendASCII(name); 59 path = path.AppendASCII(name);
37 60
38 if (!CleanupCacheDir()) 61 if (!CleanupCacheDir())
39 return false; 62 return false;
40 return file_util::CopyDirectory(path, cache_path_, false); 63 return file_util::CopyDirectory(path, cache_path_, false);
41 } 64 }
42 65
43 bool DiskCacheTest::CleanupCacheDir() { 66 bool DiskCacheTest::CleanupCacheDir() {
44 return DeleteCache(cache_path_); 67 return DeleteCache(cache_path_);
45 } 68 }
46 69
70 bool DiskCacheTest::ForceRandomCacheDir() {
71 if (temp_dir_.path().empty()) {
72 if (!temp_dir_.CreateUniqueTempDir())
73 return false;
74 cache_path_ = temp_dir_.path();
75 }
76 return true;
77 }
78
47 void DiskCacheTest::TearDown() { 79 void DiskCacheTest::TearDown() {
48 base::RunLoop().RunUntilIdle(); 80 base::RunLoop().RunUntilIdle();
49 } 81 }
50 82
51 DiskCacheTestWithCache::DiskCacheTestWithCache() 83 DiskCacheTestWithCache::DiskCacheTestWithCache()
52 : cache_(NULL), 84 : cache_(NULL),
53 cache_impl_(NULL), 85 cache_impl_(NULL),
54 simple_cache_impl_(NULL), 86 simple_cache_impl_(NULL),
55 mem_cache_(NULL), 87 mem_cache_(NULL),
88 cache_impl_v3_(NULL),
56 mask_(0), 89 mask_(0),
57 size_(0), 90 size_(0),
58 type_(net::DISK_CACHE), 91 type_(net::DISK_CACHE),
59 memory_only_(false), 92 memory_only_(false),
60 simple_cache_mode_(false), 93 simple_cache_mode_(false),
61 force_creation_(false), 94 force_creation_(false),
62 new_eviction_(false), 95 new_eviction_(false),
96 v3_(false),
63 first_cleanup_(true), 97 first_cleanup_(true),
64 integrity_(true), 98 integrity_(true),
65 use_current_thread_(false), 99 use_current_thread_(false),
100 avoid_test_flag_(false),
101 unit_test_mode_(false),
66 cache_thread_("CacheThread") { 102 cache_thread_("CacheThread") {
67 } 103 }
68 104
69 DiskCacheTestWithCache::~DiskCacheTestWithCache() {} 105 DiskCacheTestWithCache::~DiskCacheTestWithCache() {}
70 106
71 void DiskCacheTestWithCache::InitCache() { 107 void DiskCacheTestWithCache::InitCache() {
72 if (memory_only_) 108 if (memory_only_)
73 InitMemoryCache(); 109 InitMemoryCache();
74 else 110 else
75 InitDiskCache(); 111 InitDiskCache();
76 112
77 ASSERT_TRUE(NULL != cache_); 113 ASSERT_TRUE(NULL != cache_);
78 if (first_cleanup_) 114 if (first_cleanup_)
79 ASSERT_EQ(0, cache_->GetEntryCount()); 115 ASSERT_EQ(0, cache_->GetEntryCount());
80 } 116 }
81 117
82 // We are expected to leak memory when simulating crashes. 118 // We are expected to leak memory when simulating crashes.
83 void DiskCacheTestWithCache::SimulateCrash() { 119 void DiskCacheTestWithCache::SimulateCrash() {
84 ASSERT_TRUE(!memory_only_); 120 ASSERT_TRUE(!memory_only_);
85 net::TestCompletionCallback cb; 121 net::TestCompletionCallback cb;
86 int rv = cache_impl_->FlushQueueForTest(cb.callback()); 122 int rv = cache_impl_->FlushQueueForTest(cb.callback());
87 ASSERT_EQ(net::OK, cb.GetResult(rv)); 123 ASSERT_EQ(net::OK, cb.GetResult(rv));
88 cache_impl_->ClearRefCountForTest(); 124 cache_impl_->ClearRefCountForTest();
89 125
90 delete cache_impl_; 126 delete cache_impl_;
91 EXPECT_TRUE(CheckCacheIntegrity(cache_path_, new_eviction_, mask_)); 127 EXPECT_TRUE(CheckCacheIntegrity(cache_path_, new_eviction_, mask_));
92 128
93 CreateBackend(disk_cache::kNoRandom, &cache_thread_); 129 CreateBackend(&cache_thread_);
94 } 130 }
95 131
96 void DiskCacheTestWithCache::SetTestMode() { 132 void DiskCacheTestWithCache::SetTestMode() {
97 ASSERT_TRUE(!memory_only_); 133 ASSERT_TRUE(!memory_only_);
98 cache_impl_->SetUnitTestMode(); 134 EXPECT_TRUE(cache_);
135 if (cache_impl_)
136 cache_impl_->SetUnitTestMode();
137 else if (cache_impl_v3_)
138 cache_impl_v3_->SetUnitTestMode();
99 } 139 }
100 140
101 void DiskCacheTestWithCache::SetMaxSize(int size) { 141 void DiskCacheTestWithCache::SetMaxSize(int size) {
102 size_ = size; 142 size_ = size;
103 if (simple_cache_impl_) 143 if (simple_cache_impl_)
104 EXPECT_TRUE(simple_cache_impl_->SetMaxSize(size)); 144 EXPECT_TRUE(simple_cache_impl_->SetMaxSize(size));
105 145
106 if (cache_impl_) 146 if (cache_impl_)
107 EXPECT_TRUE(cache_impl_->SetMaxSize(size)); 147 EXPECT_TRUE(cache_impl_->SetMaxSize(size));
108 148
109 if (mem_cache_) 149 if (mem_cache_)
110 EXPECT_TRUE(mem_cache_->SetMaxSize(size)); 150 EXPECT_TRUE(mem_cache_->SetMaxSize(size));
151
152 if (cache_impl_v3_)
153 EXPECT_TRUE(cache_impl_v3_->SetMaxSize(size));
111 } 154 }
112 155
113 int DiskCacheTestWithCache::OpenEntry(const std::string& key, 156 int DiskCacheTestWithCache::OpenEntry(const std::string& key,
114 disk_cache::Entry** entry) { 157 disk_cache::Entry** entry) {
115 net::TestCompletionCallback cb; 158 net::TestCompletionCallback cb;
116 int rv = cache_->OpenEntry(key, entry, cb.callback()); 159 int rv = cache_->OpenEntry(key, entry, cb.callback());
117 return cb.GetResult(rv); 160 return cb.GetResult(rv);
118 } 161 }
119 162
120 int DiskCacheTestWithCache::CreateEntry(const std::string& key, 163 int DiskCacheTestWithCache::CreateEntry(const std::string& key,
(...skipping 29 matching lines...) Expand all
150 } 193 }
151 194
152 int DiskCacheTestWithCache::OpenNextEntry(void** iter, 195 int DiskCacheTestWithCache::OpenNextEntry(void** iter,
153 disk_cache::Entry** next_entry) { 196 disk_cache::Entry** next_entry) {
154 net::TestCompletionCallback cb; 197 net::TestCompletionCallback cb;
155 int rv = cache_->OpenNextEntry(iter, next_entry, cb.callback()); 198 int rv = cache_->OpenNextEntry(iter, next_entry, cb.callback());
156 return cb.GetResult(rv); 199 return cb.GetResult(rv);
157 } 200 }
158 201
159 void DiskCacheTestWithCache::FlushQueueForTest() { 202 void DiskCacheTestWithCache::FlushQueueForTest() {
160 if (memory_only_ || !cache_impl_) 203 if (memory_only_ || !(cache_impl_ || cache_impl_v3_))
161 return; 204 return;
162 205
163 net::TestCompletionCallback cb; 206 net::TestCompletionCallback cb;
164 int rv = cache_impl_->FlushQueueForTest(cb.callback()); 207 int rv;
208 if (cache_impl_)
209 rv = cache_impl_->FlushQueueForTest(cb.callback());
210 else
211 rv = cache_impl_v3_->FlushQueueForTest(cb.callback());
212 EXPECT_EQ(net::OK, cb.GetResult(rv));
213 }
214
215 void DiskCacheTestWithCache::CleanupForTest() {
216 if (!cache_impl_v3_)
217 return base::RunLoop().RunUntilIdle();
218
219 net::TestCompletionCallback cb;
220 int rv = cache_impl_v3_->CleanupForTest(cb.callback());
165 EXPECT_EQ(net::OK, cb.GetResult(rv)); 221 EXPECT_EQ(net::OK, cb.GetResult(rv));
166 } 222 }
167 223
168 void DiskCacheTestWithCache::RunTaskForTest(const base::Closure& closure) { 224 void DiskCacheTestWithCache::RunTaskForTest(const base::Closure& closure) {
169 if (memory_only_ || !cache_impl_) { 225 if (memory_only_ || !cache_impl_) {
170 closure.Run(); 226 closure.Run();
171 return; 227 return;
172 } 228 }
173 229
174 net::TestCompletionCallback cb; 230 net::TestCompletionCallback cb;
(...skipping 25 matching lines...) Expand all
200 } 256 }
201 257
202 int DiskCacheTestWithCache::WriteSparseData(disk_cache::Entry* entry, 258 int DiskCacheTestWithCache::WriteSparseData(disk_cache::Entry* entry,
203 int64 offset, 259 int64 offset,
204 net::IOBuffer* buf, int len) { 260 net::IOBuffer* buf, int len) {
205 net::TestCompletionCallback cb; 261 net::TestCompletionCallback cb;
206 int rv = entry->WriteSparseData(offset, buf, len, cb.callback()); 262 int rv = entry->WriteSparseData(offset, buf, len, cb.callback());
207 return cb.GetResult(rv); 263 return cb.GetResult(rv);
208 } 264 }
209 265
266 int DiskCacheTestWithCache::GetAvailableRange(disk_cache::Entry* entry,
267 int64 offset, int len,
268 int64* start) {
269 net::TestCompletionCallback cb;
270 int rv = entry->GetAvailableRange(offset, len, start, cb.callback());
271 return cb.GetResult(rv);
272 }
273
274 bool DiskCacheTestWithCache::IsAllocAllowed(int current_size, int new_size) {
275 if (cache_impl_)
276 return cache_impl_->IsAllocAllowed(current_size, new_size);
277 if (cache_impl_v3_)
278 return cache_impl_v3_->IsAllocAllowed(current_size, new_size, false);
279 return false;
280 }
281
282 void DiskCacheTestWithCache::BufferDeleted(int size) {
283 if (cache_impl_)
284 cache_impl_->BufferDeleted(size);
285 else if (cache_impl_v3_)
286 cache_impl_v3_->BufferDeleted(size);
287 }
288
289 int DiskCacheTestWithCache::GetTotalBuffersSize() {
290 if (cache_impl_)
291 return cache_impl_->GetTotalBuffersSize();
292 if (cache_impl_v3_)
293 return cache_impl_v3_->GetTotalBuffersSize();
294 return 0;
295 }
296
297 void DiskCacheTestWithCache::SetNoBuffering() {
298 EXPECT_TRUE(cache_);
299 if (cache_impl_)
300 cache_impl_->SetFlags(disk_cache::kNoBuffering);
301 else if (cache_impl_v3_)
302 cache_impl_v3_->SetFlags(disk_cache::BackendImplV3::NO_BUFFERING);
303 }
304
305 void DiskCacheTestWithCache::WaitForEntryToClose(const std::string& key) {
306 if (!cache_impl_v3_)
307 return FlushQueueForTest();
308
309 net::TestCompletionCallback cb;
310 int rv = cache_impl_v3_->WaitForEntryToCloseForTest(key, cb.callback());
311 EXPECT_EQ(net::OK, cb.GetResult(rv));
312 }
313
210 void DiskCacheTestWithCache::TrimForTest(bool empty) { 314 void DiskCacheTestWithCache::TrimForTest(bool empty) {
211 RunTaskForTest(base::Bind(&disk_cache::BackendImpl::TrimForTest, 315 if (cache_impl_) {
212 base::Unretained(cache_impl_), 316 RunTaskForTest(base::Bind(&disk_cache::BackendImpl::TrimForTest,
213 empty)); 317 base::Unretained(cache_impl_), empty));
318 } else {
319 cache_impl_v3_->TrimForTest(empty);
320 }
214 } 321 }
215 322
216 void DiskCacheTestWithCache::TrimDeletedListForTest(bool empty) { 323 void DiskCacheTestWithCache::TrimDeletedListForTest(bool empty) {
217 RunTaskForTest(base::Bind(&disk_cache::BackendImpl::TrimDeletedListForTest, 324 if (cache_impl_) {
218 base::Unretained(cache_impl_), 325 RunTaskForTest(base::Bind(&disk_cache::BackendImpl::TrimDeletedListForTest,
219 empty)); 326 base::Unretained(cache_impl_), empty));
327 } else {
328 cache_impl_v3_->TrimDeletedListForTest(empty);
329 }
330 }
331
332 base::Time DiskCacheTestWithCache::GetCurrentTime() {
333 if (cache_impl_v3_) {
334 return cache_impl_v3_->GetCurrentTime();
335 } else {
336 return base::Time::Now();
337 }
338 }
339
340 void DiskCacheTestWithCache::AddDelayForTest(int seconds) {
341 if (cache_impl_v3_) {
342 cache_impl_v3_->AddDelayForTest(seconds);
343 } else {
344 AddDelay();
345 }
220 } 346 }
221 347
222 void DiskCacheTestWithCache::AddDelay() { 348 void DiskCacheTestWithCache::AddDelay() {
223 base::Time initial = base::Time::Now(); 349 base::Time initial = base::Time::Now();
224 while (base::Time::Now() <= initial) { 350 while (base::Time::Now() <= initial) {
225 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(1)); 351 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(1));
226 }; 352 };
227 } 353 }
228 354
229 void DiskCacheTestWithCache::TearDown() { 355 void DiskCacheTestWithCache::TearDown() {
230 base::RunLoop().RunUntilIdle(); 356 CleanupForTest();
231 delete cache_; 357 delete cache_;
232 if (cache_thread_.IsRunning()) 358 if (cache_thread_.IsRunning())
233 cache_thread_.Stop(); 359 cache_thread_.Stop();
234 360
361 base::RunLoop().RunUntilIdle();
362
235 if (!memory_only_ && !simple_cache_mode_ && integrity_) { 363 if (!memory_only_ && !simple_cache_mode_ && integrity_) {
236 EXPECT_TRUE(CheckCacheIntegrity(cache_path_, new_eviction_, mask_)); 364 if (!v3_)
365 EXPECT_TRUE(CheckCacheIntegrity(cache_path_, new_eviction_, mask_));
237 } 366 }
238 367
239 PlatformTest::TearDown(); 368 PlatformTest::TearDown();
240 } 369 }
241 370
242 void DiskCacheTestWithCache::InitMemoryCache() { 371 void DiskCacheTestWithCache::InitMemoryCache() {
243 mem_cache_ = new disk_cache::MemBackendImpl(NULL); 372 mem_cache_ = new disk_cache::MemBackendImpl(NULL);
244 cache_ = mem_cache_; 373 cache_ = mem_cache_;
245 ASSERT_TRUE(NULL != cache_); 374 ASSERT_TRUE(NULL != cache_);
246 375
247 if (size_) 376 if (size_)
248 EXPECT_TRUE(mem_cache_->SetMaxSize(size_)); 377 EXPECT_TRUE(mem_cache_->SetMaxSize(size_));
249 378
250 ASSERT_TRUE(mem_cache_->Init()); 379 ASSERT_TRUE(mem_cache_->Init());
251 } 380 }
252 381
253 void DiskCacheTestWithCache::InitDiskCache() { 382 void DiskCacheTestWithCache::InitDiskCache() {
254 if (first_cleanup_) 383 if (first_cleanup_)
255 ASSERT_TRUE(CleanupCacheDir()); 384 ASSERT_TRUE(CleanupCacheDir());
256 385
257 if (!cache_thread_.IsRunning()) { 386 if (!cache_thread_.IsRunning()) {
258 ASSERT_TRUE(cache_thread_.StartWithOptions( 387 ASSERT_TRUE(cache_thread_.StartWithOptions(
259 base::Thread::Options(MessageLoop::TYPE_IO, 0))); 388 base::Thread::Options(MessageLoop::TYPE_IO, 0)));
260 } 389 }
261 ASSERT_TRUE(cache_thread_.message_loop() != NULL); 390 ASSERT_TRUE(cache_thread_.message_loop() != NULL);
262 391
263 CreateBackend(disk_cache::kNoRandom, &cache_thread_); 392 CreateBackend(&cache_thread_);
264 } 393 }
265 394
266 void DiskCacheTestWithCache::CreateBackend(uint32 flags, base::Thread* thread) { 395 void DiskCacheTestWithCache::CreateBackend(base::Thread* thread) {
267 base::MessageLoopProxy* runner; 396 base::MessageLoopProxy* runner;
268 if (use_current_thread_) 397 if (use_current_thread_)
269 runner = base::MessageLoopProxy::current(); 398 runner = base::MessageLoopProxy::current();
270 else 399 else
271 runner = thread->message_loop_proxy(); 400 runner = thread->message_loop_proxy();
272 401
273 if (simple_cache_mode_) { 402 if (simple_cache_mode_) {
274 net::TestCompletionCallback cb; 403 net::TestCompletionCallback cb;
275 disk_cache::SimpleBackendImpl* simple_backend = 404 disk_cache::SimpleBackendImpl* simple_backend =
276 new disk_cache::SimpleBackendImpl(cache_path_, size_, type_, 405 new disk_cache::SimpleBackendImpl(cache_path_, size_, type_,
277 make_scoped_refptr(runner), NULL); 406 make_scoped_refptr(runner), NULL);
278 int rv = simple_backend->Init(cb.callback()); 407 int rv = simple_backend->Init(cb.callback());
279 ASSERT_EQ(net::OK, cb.GetResult(rv)); 408 ASSERT_EQ(net::OK, cb.GetResult(rv));
280 cache_ = simple_cache_impl_ = simple_backend; 409 cache_ = simple_cache_impl_ = simple_backend;
281 return; 410 return;
282 } 411 }
283 412
284 if (mask_) 413 if (mask_)
285 cache_impl_ = new disk_cache::BackendImpl(cache_path_, mask_, runner, NULL); 414 cache_impl_ = new disk_cache::BackendImpl(cache_path_, mask_, runner, NULL);
415 else if (v3_)
416 cache_impl_v3_ = new disk_cache::BackendImplV3(cache_path_, runner, NULL);
286 else 417 else
287 cache_impl_ = new disk_cache::BackendImpl(cache_path_, runner, NULL); 418 cache_impl_ = new disk_cache::BackendImpl(cache_path_, runner, NULL);
288 cache_ = cache_impl_; 419 cache_ = cache_impl_;
420 if (!cache_)
421 cache_ = cache_impl_v3_;
289 ASSERT_TRUE(NULL != cache_); 422 ASSERT_TRUE(NULL != cache_);
290 if (size_)
291 EXPECT_TRUE(cache_impl_->SetMaxSize(size_));
292 if (new_eviction_)
293 cache_impl_->SetNewEviction();
294 cache_impl_->SetType(type_);
295 cache_impl_->SetFlags(flags);
296 net::TestCompletionCallback cb; 423 net::TestCompletionCallback cb;
297 int rv = cache_impl_->Init(cb.callback()); 424 int rv = 0;
425 if (cache_impl_) {
426 if (size_)
427 EXPECT_TRUE(cache_impl_->SetMaxSize(size_));
428 if (new_eviction_)
429 cache_impl_->SetNewEviction();
430
431 cache_impl_->SetType(type_);
432 if (unit_test_mode_)
433 cache_impl_->SetFlags(disk_cache::kUnitTestMode);
434 if (!avoid_test_flag_)
435 cache_impl_->SetFlags(disk_cache::kNoRandom);
436 rv = cache_impl_->Init(cb.callback());
437 } else {
438 if (size_)
439 EXPECT_TRUE(cache_impl_v3_->SetMaxSize(size_));
440 if (new_eviction_)
441 cache_impl_v3_->SetNewEviction();
442
443 cache_impl_v3_->SetType(type_);
444 cache_impl_v3_->SetFlags(disk_cache::BackendImplV3::BASIC_UNIT_TEST);
445 if (unit_test_mode_)
446 cache_impl_v3_->SetFlags(disk_cache::BackendImplV3::UNIT_TEST_MODE);
447 rv = cache_impl_v3_->Init(cb.callback());
448 }
298 ASSERT_EQ(net::OK, cb.GetResult(rv)); 449 ASSERT_EQ(net::OK, cb.GetResult(rv));
299 cache_ = cache_impl_;
300 } 450 }
OLDNEW
« no previous file with comments | « net/disk_cache/disk_cache_test_base.h ('k') | net/disk_cache/disk_cache_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698