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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 EXPECT_EQ(4, dialog()->update_count()); | 356 EXPECT_EQ(4, dialog()->update_count()); |
357 EXPECT_EQ(4U, controller()->GetGalleryList().size()); | 357 EXPECT_EQ(4U, controller()->GetGalleryList().size()); |
358 | 358 |
359 // Update names. | 359 // Update names. |
360 const MediaGalleryPrefInfo& unselected_update_info = | 360 const MediaGalleryPrefInfo& unselected_update_info = |
361 gallery_prefs()->known_galleries().find(unselected_update)->second; | 361 gallery_prefs()->known_galleries().find(unselected_update)->second; |
362 gallery_prefs()->AddGallery( | 362 gallery_prefs()->AddGallery( |
363 unselected_update_info.device_id, base::FilePath(), | 363 unselected_update_info.device_id, base::FilePath(), |
364 MediaGalleryPrefInfo::kScanResult, | 364 MediaGalleryPrefInfo::kScanResult, |
365 base::ASCIIToUTF16("Updated & Unselected"), | 365 base::ASCIIToUTF16("Updated & Unselected"), |
366 base::string16(), base::string16(), 0, base::Time(), 0, 0, 0); | 366 base::string16(), base::string16(), 0, base::Time(), 1, 0, 0); |
367 EXPECT_EQ(5, dialog()->update_count()); | 367 EXPECT_EQ(5, dialog()->update_count()); |
368 EXPECT_EQ(4U, controller()->GetGalleryList().size()); | 368 EXPECT_EQ(4U, controller()->GetGalleryList().size()); |
369 const MediaGalleryPrefInfo& selected_update_info = | 369 const MediaGalleryPrefInfo& selected_update_info = |
370 gallery_prefs()->known_galleries().find(selected_update)->second; | 370 gallery_prefs()->known_galleries().find(selected_update)->second; |
371 gallery_prefs()->AddGallery( | 371 gallery_prefs()->AddGallery( |
372 selected_update_info.device_id, base::FilePath(), | 372 selected_update_info.device_id, base::FilePath(), |
373 MediaGalleryPrefInfo::kScanResult, | 373 MediaGalleryPrefInfo::kScanResult, |
374 base::ASCIIToUTF16("Updated & Selected"), | 374 base::ASCIIToUTF16("Updated & Selected"), |
375 base::string16(), base::string16(), 0, base::Time(), 0, 0, 0); | 375 base::string16(), base::string16(), 0, base::Time(), 1, 0, 0); |
376 EXPECT_EQ(6, dialog()->update_count()); | 376 EXPECT_EQ(6, dialog()->update_count()); |
377 ASSERT_EQ(4U, controller()->GetGalleryList().size()); | 377 ASSERT_EQ(4U, controller()->GetGalleryList().size()); |
378 | 378 |
379 MediaGalleriesScanResultDialogController::OrderedScanResults results = | 379 MediaGalleriesScanResultDialogController::OrderedScanResults results = |
380 controller()->GetGalleryList(); | 380 controller()->GetGalleryList(); |
381 EXPECT_EQ(selected, results[0].pref_info.pref_id); | 381 EXPECT_EQ(selected, results[0].pref_info.pref_id); |
382 EXPECT_TRUE(results[0].selected); | 382 EXPECT_TRUE(results[0].selected); |
383 EXPECT_EQ(selected_update, results[1].pref_info.pref_id); | 383 EXPECT_EQ(selected_update, results[1].pref_info.pref_id); |
384 EXPECT_TRUE(results[1].selected); | 384 EXPECT_TRUE(results[1].selected); |
385 EXPECT_EQ(base::ASCIIToUTF16("Updated & Selected"), | 385 EXPECT_EQ(base::ASCIIToUTF16("Updated & Selected"), |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 MediaGalleriesScanResultDialogController::OrderedScanResults results = | 448 MediaGalleriesScanResultDialogController::OrderedScanResults results = |
449 controller()->GetGalleryList(); | 449 controller()->GetGalleryList(); |
450 ASSERT_EQ(5U, results.size()); | 450 ASSERT_EQ(5U, results.size()); |
451 EXPECT_EQ(first, results[0].pref_info.pref_id); | 451 EXPECT_EQ(first, results[0].pref_info.pref_id); |
452 EXPECT_EQ(second, results[1].pref_info.pref_id); | 452 EXPECT_EQ(second, results[1].pref_info.pref_id); |
453 EXPECT_EQ(third, results[2].pref_info.pref_id); | 453 EXPECT_EQ(third, results[2].pref_info.pref_id); |
454 EXPECT_EQ(fourth, results[3].pref_info.pref_id); | 454 EXPECT_EQ(fourth, results[3].pref_info.pref_id); |
455 EXPECT_EQ(fifth, results[4].pref_info.pref_id); | 455 EXPECT_EQ(fifth, results[4].pref_info.pref_id); |
456 controller()->DialogFinished(false); | 456 controller()->DialogFinished(false); |
457 } | 457 } |
OLD | NEW |