Index: chrome/browser/media_galleries/media_scan_manager_unittest.cc |
=================================================================== |
--- chrome/browser/media_galleries/media_scan_manager_unittest.cc (revision 252098) |
+++ chrome/browser/media_galleries/media_scan_manager_unittest.cc (working copy) |
@@ -178,9 +178,11 @@ |
void SetFindFoldersResults( |
bool success, |
- const MediaFolderFinder::MediaFolderFinderResults& results) { |
+ const MediaFolderFinder::MediaFolderFinderResults& results, |
+ const std::vector<base::FilePath>& sensitive_locations) { |
find_folders_success_ = success; |
find_folders_results_ = results; |
+ find_folders_sensitive_locations_ = sensitive_locations; |
vandebo (ex-Chrome)
2014/02/20 23:00:23
Clearly we should have a test that does remove a s
Lei Zhang
2014/02/25 01:24:25
Done.
|
} |
void SetExpectedScanResults(int gallery_count, |
@@ -239,7 +241,9 @@ |
void OnFindFoldersStarted( |
MediaFolderFinder::MediaFolderFinderResultsCallback callback) { |
find_folders_start_count_++; |
- callback.Run(find_folders_success_, find_folders_results_); |
+ callback.Run(find_folders_success_, |
+ find_folders_results_, |
+ find_folders_sensitive_locations_); |
} |
void OnFindFoldersDestroyed() { |
@@ -252,6 +256,7 @@ |
int find_folders_destroy_count_; |
bool find_folders_success_; |
MediaFolderFinder::MediaFolderFinderResults find_folders_results_; |
+ std::vector<base::FilePath> find_folders_sensitive_locations_; |
int expected_gallery_count_; |
MediaGalleryScanResult expected_file_counts_; |
@@ -288,7 +293,8 @@ |
MediaFolderFinder::MediaFolderFinderResults found_folders; |
found_folders[path] = file_counts; |
- SetFindFoldersResults(true, found_folders); |
+ std::vector<base::FilePath> empty_sensitive_locations; |
+ SetFindFoldersResults(true, found_folders, empty_sensitive_locations); |
SetExpectedScanResults(1 /*gallery_count*/, file_counts); |
StartScan(); |
@@ -348,7 +354,8 @@ |
found_folders[path] = file_counts; |
expected_galleries.insert(path.DirName()); |
- SetFindFoldersResults(true, found_folders); |
+ std::vector<base::FilePath> empty_sensitive_locations; |
+ SetFindFoldersResults(true, found_folders, empty_sensitive_locations); |
file_counts.audio_count = 9; |
SetExpectedScanResults(5 /*gallery_count*/, file_counts); |
@@ -387,7 +394,8 @@ |
// Run once with no scan results. "uscan" should go away and "gscan" should |
// have its scan counts updated. |
MediaFolderFinder::MediaFolderFinderResults found_folders; |
- SetFindFoldersResults(true, found_folders); |
+ std::vector<base::FilePath> empty_sensitive_locations; |
+ SetFindFoldersResults(true, found_folders, empty_sensitive_locations); |
MediaGalleryScanResult file_counts; |
SetExpectedScanResults(0 /*gallery_count*/, file_counts); |
@@ -414,7 +422,7 @@ |
path = MakeTestFolder("gscan/dir1"); |
found_folders[path] = file_counts; |
- SetFindFoldersResults(true, found_folders); |
+ SetFindFoldersResults(true, found_folders, empty_sensitive_locations); |
file_counts.video_count = 7; |
SetExpectedScanResults(1 /*gallery_count*/, file_counts); |
StartScan(); |
@@ -457,7 +465,8 @@ |
path = MakeTestFolder("user/dir2"); |
found_folders[path] = file_counts; |
- SetFindFoldersResults(true, found_folders); |
+ std::vector<base::FilePath> empty_sensitive_locations; |
+ SetFindFoldersResults(true, found_folders, empty_sensitive_locations); |
file_counts.audio_count = 0; |
SetExpectedScanResults(0 /*gallery_count*/, file_counts); |
@@ -471,7 +480,7 @@ |
CheckFileCounts(scan_id, 6, 0, 0); |
EXPECT_EQ(1U, found_folders.erase(path)); |
- SetFindFoldersResults(true, found_folders); |
+ SetFindFoldersResults(true, found_folders, empty_sensitive_locations); |
SetExpectedScanResults(0 /*gallery_count*/, file_counts); |
StartScan(); |