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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 default: | 112 default: |
113 NOTREACHED(); | 113 NOTREACHED(); |
114 return; | 114 return; |
115 } | 115 } |
116 if (big) | 116 if (big) |
117 filesize *= 100000; | 117 filesize *= 100000; |
118 | 118 |
119 for (size_t i = 0; i < count; ++i) { | 119 for (size_t i = 0; i < count; ++i) { |
120 base::FilePath test_file(parent_dir.AppendASCII("dummy." + extension)); | 120 base::FilePath test_file(parent_dir.AppendASCII("dummy." + extension)); |
121 int uniquifier = | 121 int uniquifier = |
122 file_util::GetUniquePathNumber(test_file, | 122 base::GetUniquePathNumber(test_file, base::FilePath::StringType()); |
123 base::FilePath::StringType()); | |
124 if (uniquifier > 0) { | 123 if (uniquifier > 0) { |
125 test_file = test_file.InsertBeforeExtensionASCII( | 124 test_file = test_file.InsertBeforeExtensionASCII( |
126 base::StringPrintf(" (%d)", uniquifier)); | 125 base::StringPrintf(" (%d)", uniquifier)); |
127 filesize += uniquifier; | 126 filesize += uniquifier; |
128 } | 127 } |
129 | 128 |
130 std::string dummy_data; | 129 std::string dummy_data; |
131 dummy_data.resize(filesize); | 130 dummy_data.resize(filesize); |
132 | 131 |
133 int bytes_written = | 132 int bytes_written = |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 | 402 |
404 // |fake_home_dir| and its ancestors do not show up in results. | 403 // |fake_home_dir| and its ancestors do not show up in results. |
405 expected_results.erase(fake_dir()); | 404 expected_results.erase(fake_dir()); |
406 expected_results.erase(fake_home_dir); | 405 expected_results.erase(fake_home_dir); |
407 | 406 |
408 CreateMediaFolderFinder(folders, true, expected_results); | 407 CreateMediaFolderFinder(folders, true, expected_results); |
409 StartScan(); | 408 StartScan(); |
410 RunLoopUntilReceivedCallback(); | 409 RunLoopUntilReceivedCallback(); |
411 DeleteMediaFolderFinder(); | 410 DeleteMediaFolderFinder(); |
412 } | 411 } |
OLD | NEW |