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/file_util.h" | 7 #include "base/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/threading/platform_thread.h" | 10 #include "base/threading/platform_thread.h" |
11 #include "net/base/io_buffer.h" | 11 #include "net/base/io_buffer.h" |
12 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
13 #include "net/base/test_completion_callback.h" | 13 #include "net/base/test_completion_callback.h" |
14 #include "net/disk_cache/backend_impl.h" | 14 #include "net/disk_cache/blockfile/backend_impl.h" |
15 #include "net/disk_cache/cache_util.h" | 15 #include "net/disk_cache/cache_util.h" |
16 #include "net/disk_cache/disk_cache.h" | 16 #include "net/disk_cache/disk_cache.h" |
17 #include "net/disk_cache/disk_cache_test_util.h" | 17 #include "net/disk_cache/disk_cache_test_util.h" |
18 #include "net/disk_cache/mem_backend_impl.h" | 18 #include "net/disk_cache/memory/mem_backend_impl.h" |
19 #include "net/disk_cache/simple/simple_backend_impl.h" | 19 #include "net/disk_cache/simple/simple_backend_impl.h" |
20 #include "net/disk_cache/simple/simple_index.h" | 20 #include "net/disk_cache/simple/simple_index.h" |
21 | 21 |
22 DiskCacheTest::DiskCacheTest() { | 22 DiskCacheTest::DiskCacheTest() { |
23 CHECK(temp_dir_.CreateUniqueTempDir()); | 23 CHECK(temp_dir_.CreateUniqueTempDir()); |
24 cache_path_ = temp_dir_.path(); | 24 cache_path_ = temp_dir_.path(); |
25 if (!base::MessageLoop::current()) | 25 if (!base::MessageLoop::current()) |
26 message_loop_.reset(new base::MessageLoopForIO()); | 26 message_loop_.reset(new base::MessageLoopForIO()); |
27 } | 27 } |
28 | 28 |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 if (size_) | 313 if (size_) |
314 EXPECT_TRUE(cache_impl_->SetMaxSize(size_)); | 314 EXPECT_TRUE(cache_impl_->SetMaxSize(size_)); |
315 if (new_eviction_) | 315 if (new_eviction_) |
316 cache_impl_->SetNewEviction(); | 316 cache_impl_->SetNewEviction(); |
317 cache_impl_->SetType(type_); | 317 cache_impl_->SetType(type_); |
318 cache_impl_->SetFlags(flags); | 318 cache_impl_->SetFlags(flags); |
319 net::TestCompletionCallback cb; | 319 net::TestCompletionCallback cb; |
320 int rv = cache_impl_->Init(cb.callback()); | 320 int rv = cache_impl_->Init(cb.callback()); |
321 ASSERT_EQ(net::OK, cb.GetResult(rv)); | 321 ASSERT_EQ(net::OK, cb.GetResult(rv)); |
322 } | 322 } |
OLD | NEW |