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

Side by Side Diff: net/base/directory_lister_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 | « mojo/shell/storage.cc ('k') | net/disk_cache/backend_impl.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) 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 <list> 5 #include <list>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_WRITE, 115 base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_WRITE,
116 NULL, 116 NULL,
117 NULL); 117 NULL);
118 ASSERT_NE(base::kInvalidPlatformFileValue, file); 118 ASSERT_NE(base::kInvalidPlatformFileValue, file);
119 ASSERT_TRUE(base::ClosePlatformFile(file)); 119 ASSERT_TRUE(base::ClosePlatformFile(file));
120 } 120 }
121 if (dir_data.second < kMaxDepth - 1) { 121 if (dir_data.second < kMaxDepth - 1) {
122 for (int i = 0; i < kBranchingFactor; i++) { 122 for (int i = 0; i < kBranchingFactor; i++) {
123 std::string dir_name = base::StringPrintf("child_dir_%d", i); 123 std::string dir_name = base::StringPrintf("child_dir_%d", i);
124 base::FilePath dir_path = dir_data.first.AppendASCII(dir_name); 124 base::FilePath dir_path = dir_data.first.AppendASCII(dir_name);
125 ASSERT_TRUE(file_util::CreateDirectory(dir_path)); 125 ASSERT_TRUE(base::CreateDirectory(dir_path));
126 directories.push_back(std::make_pair(dir_path, dir_data.second + 1)); 126 directories.push_back(std::make_pair(dir_path, dir_data.second + 1));
127 } 127 }
128 } 128 }
129 } 129 }
130 PlatformTest::SetUp(); 130 PlatformTest::SetUp();
131 } 131 }
132 132
133 const base::FilePath& root_path() const { 133 const base::FilePath& root_path() const {
134 return temp_root_dir_.path(); 134 return temp_root_dir_.path();
135 } 135 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 lister.Start(); 186 lister.Start();
187 187
188 base::MessageLoop::current()->Run(); 188 base::MessageLoop::current()->Run();
189 189
190 // Contains only the parent directory ("..") 190 // Contains only the parent directory ("..")
191 EXPECT_EQ(1, delegate.num_files()); 191 EXPECT_EQ(1, delegate.num_files());
192 EXPECT_EQ(OK, delegate.error()); 192 EXPECT_EQ(OK, delegate.error());
193 } 193 }
194 194
195 } // namespace net 195 } // namespace net
OLDNEW
« no previous file with comments | « mojo/shell/storage.cc ('k') | net/disk_cache/backend_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698