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 "base/base_paths.h" | 5 #include "base/base_paths.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 find_folders_results_ = results; | 182 find_folders_results_ = results; |
183 } | 183 } |
184 | 184 |
185 void SetExpectedScanResults(int gallery_count, | 185 void SetExpectedScanResults(int gallery_count, |
186 const MediaGalleryScanResult& file_counts) { | 186 const MediaGalleryScanResult& file_counts) { |
187 expected_gallery_count_ = gallery_count; | 187 expected_gallery_count_ = gallery_count; |
188 expected_file_counts_ = file_counts; | 188 expected_file_counts_ = file_counts; |
189 } | 189 } |
190 | 190 |
191 void StartScan() { | 191 void StartScan() { |
192 media_scan_manager_->StartScan(profile_.get(), extension_, | 192 media_scan_manager_->StartScan( |
193 true /* user_gesture */); | 193 profile_.get(), extension_.get(), true /* user_gesture */); |
194 } | 194 } |
195 | 195 |
196 MediaGalleriesPreferences* gallery_prefs() { | 196 MediaGalleriesPreferences* gallery_prefs() { |
197 return gallery_prefs_; | 197 return gallery_prefs_; |
198 } | 198 } |
199 | 199 |
200 const MediaGalleriesPrefInfoMap& known_galleries() const { | 200 const MediaGalleriesPrefInfoMap& known_galleries() const { |
201 return gallery_prefs_->known_galleries(); | 201 return gallery_prefs_->known_galleries(); |
202 } | 202 } |
203 | 203 |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 file_counts.audio_count *= kGalleriesAdded; | 727 file_counts.audio_count *= kGalleriesAdded; |
728 file_counts.image_count *= kGalleriesAdded; | 728 file_counts.image_count *= kGalleriesAdded; |
729 file_counts.video_count *= kGalleriesAdded; | 729 file_counts.video_count *= kGalleriesAdded; |
730 SetExpectedScanResults(kGalleriesAdded, file_counts); | 730 SetExpectedScanResults(kGalleriesAdded, file_counts); |
731 StartScan(); | 731 StartScan(); |
732 | 732 |
733 base::RunLoop().RunUntilIdle(); | 733 base::RunLoop().RunUntilIdle(); |
734 EXPECT_EQ(1, FindFolderDestroyCount()); | 734 EXPECT_EQ(1, FindFolderDestroyCount()); |
735 EXPECT_EQ(galleries_before + kGalleriesAdded, gallery_count()); | 735 EXPECT_EQ(galleries_before + kGalleriesAdded, gallery_count()); |
736 } | 736 } |
OLD | NEW |