Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: net/disk_cache/simple/simple_index_file_unittest.cc

Issue 100573002: Move directory creation functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/disk_cache/simple/simple_index_file.cc ('k') | net/disk_cache/v3/backend_worker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/disk_cache/simple/simple_index_file.cc ('k') | net/disk_cache/v3/backend_worker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698