| OLD | NEW |
| 1 // Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2010 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 "net/base/io_buffer.h" | 7 #include "net/base/io_buffer.h" |
| 8 #include "net/base/net_errors.h" | 8 #include "net/base/net_errors.h" |
| 9 #include "net/base/test_completion_callback.h" | 9 #include "net/base/test_completion_callback.h" |
| 10 #include "net/disk_cache/backend_impl.h" | 10 #include "net/disk_cache/backend_impl.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 if (!memory_only_ && integrity_) { | 214 if (!memory_only_ && integrity_) { |
| 215 FilePath path = GetCacheFilePath(); | 215 FilePath path = GetCacheFilePath(); |
| 216 EXPECT_TRUE(CheckCacheIntegrity(path, new_eviction_)); | 216 EXPECT_TRUE(CheckCacheIntegrity(path, new_eviction_)); |
| 217 } | 217 } |
| 218 | 218 |
| 219 PlatformTest::TearDown(); | 219 PlatformTest::TearDown(); |
| 220 } | 220 } |
| 221 | 221 |
| 222 void DiskCacheTestWithCache::InitMemoryCache() { | 222 void DiskCacheTestWithCache::InitMemoryCache() { |
| 223 if (!implementation_) { | 223 if (!implementation_) { |
| 224 cache_ = disk_cache::MemBackendImpl::CreateBackend(size_); | 224 cache_ = disk_cache::MemBackendImpl::CreateBackend(size_, NULL); |
| 225 return; | 225 return; |
| 226 } | 226 } |
| 227 | 227 |
| 228 mem_cache_ = new disk_cache::MemBackendImpl(); | 228 mem_cache_ = new disk_cache::MemBackendImpl(NULL); |
| 229 cache_ = mem_cache_; | 229 cache_ = mem_cache_; |
| 230 ASSERT_TRUE(NULL != cache_); | 230 ASSERT_TRUE(NULL != cache_); |
| 231 | 231 |
| 232 if (size_) | 232 if (size_) |
| 233 EXPECT_TRUE(mem_cache_->SetMaxSize(size_)); | 233 EXPECT_TRUE(mem_cache_->SetMaxSize(size_)); |
| 234 | 234 |
| 235 ASSERT_TRUE(mem_cache_->Init()); | 235 ASSERT_TRUE(mem_cache_->Init()); |
| 236 } | 236 } |
| 237 | 237 |
| 238 void DiskCacheTestWithCache::InitDiskCache() { | 238 void DiskCacheTestWithCache::InitDiskCache() { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 277 |
| 278 if (new_eviction_) | 278 if (new_eviction_) |
| 279 cache_impl_->SetNewEviction(); | 279 cache_impl_->SetNewEviction(); |
| 280 | 280 |
| 281 cache_impl_->SetType(type_); | 281 cache_impl_->SetType(type_); |
| 282 cache_impl_->SetFlags(disk_cache::kNoRandom); | 282 cache_impl_->SetFlags(disk_cache::kNoRandom); |
| 283 TestCompletionCallback cb; | 283 TestCompletionCallback cb; |
| 284 int rv = cache_impl_->Init(&cb); | 284 int rv = cache_impl_->Init(&cb); |
| 285 ASSERT_EQ(net::OK, cb.GetResult(rv)); | 285 ASSERT_EQ(net::OK, cb.GetResult(rv)); |
| 286 } | 286 } |
| OLD | NEW |