| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 net::DISK_CACHE); |
| 62 return; | 62 return; |
| 63 } | 63 } |
| 64 | 64 |
| 65 InitDiskCacheImpl(path); | 65 InitDiskCacheImpl(path); |
| 66 } | 66 } |
| 67 | 67 |
| 68 void DiskCacheTestWithCache::InitDiskCacheImpl(const std::wstring path) { | 68 void DiskCacheTestWithCache::InitDiskCacheImpl(const std::wstring& path) { |
| 69 if (mask_) | 69 if (mask_) |
| 70 cache_impl_ = new disk_cache::BackendImpl(path, mask_); | 70 cache_impl_ = new disk_cache::BackendImpl(path, mask_); |
| 71 else | 71 else |
| 72 cache_impl_ = new disk_cache::BackendImpl(path); | 72 cache_impl_ = new disk_cache::BackendImpl(path); |
| 73 | 73 |
| 74 cache_ = cache_impl_; | 74 cache_ = cache_impl_; |
| 75 ASSERT_TRUE(NULL != cache_); | 75 ASSERT_TRUE(NULL != cache_); |
| 76 | 76 |
| 77 if (size_) | 77 if (size_) |
| 78 EXPECT_TRUE(cache_impl_->SetMaxSize(size_)); | 78 EXPECT_TRUE(cache_impl_->SetMaxSize(size_)); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 104 std::wstring path = GetCachePath(); | 104 std::wstring path = GetCachePath(); |
| 105 EXPECT_TRUE(CheckCacheIntegrity(path, new_eviction_)); | 105 EXPECT_TRUE(CheckCacheIntegrity(path, new_eviction_)); |
| 106 | 106 |
| 107 InitDiskCacheImpl(path); | 107 InitDiskCacheImpl(path); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void DiskCacheTestWithCache::SetTestMode() { | 110 void DiskCacheTestWithCache::SetTestMode() { |
| 111 ASSERT_TRUE(implementation_ && !memory_only_); | 111 ASSERT_TRUE(implementation_ && !memory_only_); |
| 112 cache_impl_->SetUnitTestMode(); | 112 cache_impl_->SetUnitTestMode(); |
| 113 } | 113 } |
| OLD | NEW |