| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/disk_cache/backend_impl.h" | 7 #include "net/disk_cache/backend_impl.h" |
| 8 #include "net/disk_cache/disk_cache_test_util.h" | 8 #include "net/disk_cache/disk_cache_test_util.h" |
| 9 #include "net/disk_cache/mem_backend_impl.h" | 9 #include "net/disk_cache/mem_backend_impl.h" |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 ASSERT_TRUE(mem_cache_->Init()); | 51 ASSERT_TRUE(mem_cache_->Init()); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void DiskCacheTestWithCache::InitDiskCache() { | 54 void DiskCacheTestWithCache::InitDiskCache() { |
| 55 std::wstring path = GetCachePath(); | 55 std::wstring path = GetCachePath(); |
| 56 if (first_cleanup_) | 56 if (first_cleanup_) |
| 57 ASSERT_TRUE(DeleteCache(path.c_str())); | 57 ASSERT_TRUE(DeleteCache(path.c_str())); |
| 58 | 58 |
| 59 if (!implementation_) { | 59 if (!implementation_) { |
| 60 cache_ = disk_cache::CreateCacheBackend(path, force_creation_, size_); | 60 cache_ = disk_cache::CreateCacheBackend(path, force_creation_, size_, |
| 61 net::DISK_CACHE); |
| 61 return; | 62 return; |
| 62 } | 63 } |
| 63 | 64 |
| 64 if (mask_) | 65 if (mask_) |
| 65 cache_impl_ = new disk_cache::BackendImpl(path, mask_); | 66 cache_impl_ = new disk_cache::BackendImpl(path, mask_); |
| 66 else | 67 else |
| 67 cache_impl_ = new disk_cache::BackendImpl(path); | 68 cache_impl_ = new disk_cache::BackendImpl(path); |
| 68 | 69 |
| 69 cache_ = cache_impl_; | 70 cache_ = cache_impl_; |
| 70 ASSERT_TRUE(NULL != cache_); | 71 ASSERT_TRUE(NULL != cache_); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 107 |
| 107 if (size_) | 108 if (size_) |
| 108 cache_impl_->SetMaxSize(size_); | 109 cache_impl_->SetMaxSize(size_); |
| 109 ASSERT_TRUE(cache_impl_->Init()); | 110 ASSERT_TRUE(cache_impl_->Init()); |
| 110 } | 111 } |
| 111 | 112 |
| 112 void DiskCacheTestWithCache::SetTestMode() { | 113 void DiskCacheTestWithCache::SetTestMode() { |
| 113 ASSERT_TRUE(implementation_ && !memory_only_); | 114 ASSERT_TRUE(implementation_ && !memory_only_); |
| 114 cache_impl_->SetUnitTestMode(); | 115 cache_impl_->SetUnitTestMode(); |
| 115 } | 116 } |
| OLD | NEW |