OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/media_galleries/media_folder_finder.h" | 5 #include "chrome/browser/media_galleries/media_folder_finder.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 if (uniquifier > 0) { | 124 if (uniquifier > 0) { |
125 test_file = test_file.InsertBeforeExtensionASCII( | 125 test_file = test_file.InsertBeforeExtensionASCII( |
126 base::StringPrintf(" (%d)", uniquifier)); | 126 base::StringPrintf(" (%d)", uniquifier)); |
127 filesize += uniquifier; | 127 filesize += uniquifier; |
128 } | 128 } |
129 | 129 |
130 std::string dummy_data; | 130 std::string dummy_data; |
131 dummy_data.resize(filesize); | 131 dummy_data.resize(filesize); |
132 | 132 |
133 int bytes_written = | 133 int bytes_written = |
134 file_util::WriteFile(test_file, dummy_data.c_str(), filesize); | 134 base::WriteFile(test_file, dummy_data.c_str(), filesize); |
135 ASSERT_GE(bytes_written, 0); | 135 ASSERT_GE(bytes_written, 0); |
136 ASSERT_EQ(filesize, static_cast<size_t>(bytes_written)); | 136 ASSERT_EQ(filesize, static_cast<size_t>(bytes_written)); |
137 } | 137 } |
138 } | 138 } |
139 | 139 |
140 void RunLoop() { | 140 void RunLoop() { |
141 base::RunLoop().RunUntilIdle(); | 141 base::RunLoop().RunUntilIdle(); |
142 content::BrowserThread::GetBlockingPool()->FlushForTesting(); | 142 content::BrowserThread::GetBlockingPool()->FlushForTesting(); |
143 } | 143 } |
144 | 144 |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 | 403 |
404 // |fake_home_dir| and its ancestors do not show up in results. | 404 // |fake_home_dir| and its ancestors do not show up in results. |
405 expected_results.erase(fake_dir()); | 405 expected_results.erase(fake_dir()); |
406 expected_results.erase(fake_home_dir); | 406 expected_results.erase(fake_home_dir); |
407 | 407 |
408 CreateMediaFolderFinder(folders, true, expected_results); | 408 CreateMediaFolderFinder(folders, true, expected_results); |
409 StartScan(); | 409 StartScan(); |
410 RunLoopUntilReceivedCallback(); | 410 RunLoopUntilReceivedCallback(); |
411 DeleteMediaFolderFinder(); | 411 DeleteMediaFolderFinder(); |
412 } | 412 } |
OLD | NEW |