| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "net/disk_cache/simple/simple_backend_impl.h" | 23 #include "net/disk_cache/simple/simple_backend_impl.h" |
| 24 #include "net/disk_cache/simple/simple_index.h" | 24 #include "net/disk_cache/simple/simple_index.h" |
| 25 #include "net/test/gtest_util.h" | 25 #include "net/test/gtest_util.h" |
| 26 #include "testing/gmock/include/gmock/gmock.h" | 26 #include "testing/gmock/include/gmock/gmock.h" |
| 27 #include "testing/gtest/include/gtest/gtest.h" | 27 #include "testing/gtest/include/gtest/gtest.h" |
| 28 | 28 |
| 29 using net::test::IsOk; | 29 using net::test::IsOk; |
| 30 | 30 |
| 31 DiskCacheTest::DiskCacheTest() { | 31 DiskCacheTest::DiskCacheTest() { |
| 32 CHECK(temp_dir_.CreateUniqueTempDir()); | 32 CHECK(temp_dir_.CreateUniqueTempDir()); |
| 33 cache_path_ = temp_dir_.path(); | 33 cache_path_ = temp_dir_.GetPath(); |
| 34 if (!base::MessageLoop::current()) | 34 if (!base::MessageLoop::current()) |
| 35 message_loop_.reset(new base::MessageLoopForIO()); | 35 message_loop_.reset(new base::MessageLoopForIO()); |
| 36 } | 36 } |
| 37 | 37 |
| 38 DiskCacheTest::~DiskCacheTest() { | 38 DiskCacheTest::~DiskCacheTest() { |
| 39 } | 39 } |
| 40 | 40 |
| 41 bool DiskCacheTest::CopyTestCache(const std::string& name) { | 41 bool DiskCacheTest::CopyTestCache(const std::string& name) { |
| 42 base::FilePath path; | 42 base::FilePath path; |
| 43 PathService::Get(base::DIR_SOURCE_ROOT, &path); | 43 PathService::Get(base::DIR_SOURCE_ROOT, &path); |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 if (size_) | 343 if (size_) |
| 344 EXPECT_TRUE(cache_impl_->SetMaxSize(size_)); | 344 EXPECT_TRUE(cache_impl_->SetMaxSize(size_)); |
| 345 if (new_eviction_) | 345 if (new_eviction_) |
| 346 cache_impl_->SetNewEviction(); | 346 cache_impl_->SetNewEviction(); |
| 347 cache_impl_->SetType(type_); | 347 cache_impl_->SetType(type_); |
| 348 cache_impl_->SetFlags(flags); | 348 cache_impl_->SetFlags(flags); |
| 349 net::TestCompletionCallback cb; | 349 net::TestCompletionCallback cb; |
| 350 int rv = cache_impl_->Init(cb.callback()); | 350 int rv = cache_impl_->Init(cb.callback()); |
| 351 ASSERT_THAT(cb.GetResult(rv), IsOk()); | 351 ASSERT_THAT(cb.GetResult(rv), IsOk()); |
| 352 } | 352 } |
| OLD | NEW |