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 <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 Loading... |
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 Loading... |
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 |
OLD | NEW |