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 #include "net/disk_cache/disk_cache_test_base.h" | 5 #include "net/disk_cache/disk_cache_test_base.h" |
6 | 6 |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 int rv = cache_->DoomEntriesBetween(initial_time, end_time, cb.callback()); | 146 int rv = cache_->DoomEntriesBetween(initial_time, end_time, cb.callback()); |
147 return cb.GetResult(rv); | 147 return cb.GetResult(rv); |
148 } | 148 } |
149 | 149 |
150 int DiskCacheTestWithCache::DoomEntriesSince(const base::Time initial_time) { | 150 int DiskCacheTestWithCache::DoomEntriesSince(const base::Time initial_time) { |
151 net::TestCompletionCallback cb; | 151 net::TestCompletionCallback cb; |
152 int rv = cache_->DoomEntriesSince(initial_time, cb.callback()); | 152 int rv = cache_->DoomEntriesSince(initial_time, cb.callback()); |
153 return cb.GetResult(rv); | 153 return cb.GetResult(rv); |
154 } | 154 } |
155 | 155 |
156 int DiskCacheTestWithCache::OpenNextEntry(void** iter, | 156 int DiskCacheTestWithCache::OpenNextEntry(disk_cache::Backend::Iterator* iter, |
157 disk_cache::Entry** next_entry) { | 157 disk_cache::Entry** next_entry) { |
158 net::TestCompletionCallback cb; | 158 net::TestCompletionCallback cb; |
159 int rv = cache_->OpenNextEntry(iter, next_entry, cb.callback()); | 159 int rv = cache_->OpenNextEntry(iter, next_entry, cb.callback()); |
160 return cb.GetResult(rv); | 160 return cb.GetResult(rv); |
161 } | 161 } |
162 | 162 |
163 void DiskCacheTestWithCache::FlushQueueForTest() { | 163 void DiskCacheTestWithCache::FlushQueueForTest() { |
164 if (memory_only_ || !cache_impl_) | 164 if (memory_only_ || !cache_impl_) |
165 return; | 165 return; |
166 | 166 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 if (size_) | 315 if (size_) |
316 EXPECT_TRUE(cache_impl_->SetMaxSize(size_)); | 316 EXPECT_TRUE(cache_impl_->SetMaxSize(size_)); |
317 if (new_eviction_) | 317 if (new_eviction_) |
318 cache_impl_->SetNewEviction(); | 318 cache_impl_->SetNewEviction(); |
319 cache_impl_->SetType(type_); | 319 cache_impl_->SetType(type_); |
320 cache_impl_->SetFlags(flags); | 320 cache_impl_->SetFlags(flags); |
321 net::TestCompletionCallback cb; | 321 net::TestCompletionCallback cb; |
322 int rv = cache_impl_->Init(cb.callback()); | 322 int rv = cache_impl_->Init(cb.callback()); |
323 ASSERT_EQ(net::OK, cb.GetResult(rv)); | 323 ASSERT_EQ(net::OK, cb.GetResult(rv)); |
324 } | 324 } |
OLD | NEW |