| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/files/scoped_temp_dir.h" | 6 #include "base/files/scoped_temp_dir.h" |
| 7 #include "base/hash.h" | 7 #include "base/hash.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 net::DISK_CACHE, | 79 net::DISK_CACHE, |
| 80 index_file_directory) {} | 80 index_file_directory) {} |
| 81 virtual ~WrappedSimpleIndexFile() { | 81 virtual ~WrappedSimpleIndexFile() { |
| 82 } | 82 } |
| 83 | 83 |
| 84 const base::FilePath& GetIndexFilePath() const { | 84 const base::FilePath& GetIndexFilePath() const { |
| 85 return index_file_; | 85 return index_file_; |
| 86 } | 86 } |
| 87 | 87 |
| 88 bool CreateIndexFileDirectory() const { | 88 bool CreateIndexFileDirectory() const { |
| 89 return file_util::CreateDirectory(index_file_.DirName()); | 89 return base::CreateDirectory(index_file_.DirName()); |
| 90 } | 90 } |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 class SimpleIndexFileTest : public testing::Test { | 93 class SimpleIndexFileTest : public testing::Test { |
| 94 public: | 94 public: |
| 95 bool CompareTwoEntryMetadata(const EntryMetadata& a, const EntryMetadata& b) { | 95 bool CompareTwoEntryMetadata(const EntryMetadata& a, const EntryMetadata& b) { |
| 96 return | 96 return |
| 97 a.last_used_time_seconds_since_epoch_ == | 97 a.last_used_time_seconds_since_epoch_ == |
| 98 b.last_used_time_seconds_since_epoch_ && | 98 b.last_used_time_seconds_since_epoch_ && |
| 99 a.entry_size_ == b.entry_size_; | 99 a.entry_size_ == b.entry_size_; |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 WrappedSimpleIndexFile::Deserialize(contents.data(), | 336 WrappedSimpleIndexFile::Deserialize(contents.data(), |
| 337 contents.size(), | 337 contents.size(), |
| 338 &when_index_last_saw_cache, | 338 &when_index_last_saw_cache, |
| 339 &deserialize_result); | 339 &deserialize_result); |
| 340 EXPECT_TRUE(deserialize_result.did_load); | 340 EXPECT_TRUE(deserialize_result.did_load); |
| 341 } | 341 } |
| 342 | 342 |
| 343 #endif // defined(OS_POSIX) | 343 #endif // defined(OS_POSIX) |
| 344 | 344 |
| 345 } // namespace disk_cache | 345 } // namespace disk_cache |
| OLD | NEW |