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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 EXPECT_FALSE(dialog_); | 45 EXPECT_FALSE(dialog_); |
46 } | 46 } |
47 | 47 |
48 void SetUp() override { | 48 void SetUp() override { |
49 ASSERT_TRUE(storage_monitor::TestStorageMonitor::CreateAndInstall()); | 49 ASSERT_TRUE(storage_monitor::TestStorageMonitor::CreateAndInstall()); |
50 | 50 |
51 extensions::TestExtensionSystem* extension_system( | 51 extensions::TestExtensionSystem* extension_system( |
52 static_cast<extensions::TestExtensionSystem*>( | 52 static_cast<extensions::TestExtensionSystem*>( |
53 extensions::ExtensionSystem::Get(profile_.get()))); | 53 extensions::ExtensionSystem::Get(profile_.get()))); |
54 extension_system->CreateExtensionService( | 54 extension_system->CreateExtensionService( |
55 CommandLine::ForCurrentProcess(), base::FilePath(), false); | 55 base::CommandLine::ForCurrentProcess(), base::FilePath(), false); |
56 | 56 |
57 gallery_prefs_.reset(new MediaGalleriesPreferences(profile_.get())); | 57 gallery_prefs_.reset(new MediaGalleriesPreferences(profile_.get())); |
58 base::RunLoop loop; | 58 base::RunLoop loop; |
59 gallery_prefs_->EnsureInitialized(loop.QuitClosure()); | 59 gallery_prefs_->EnsureInitialized(loop.QuitClosure()); |
60 loop.Run(); | 60 loop.Run(); |
61 | 61 |
62 std::vector<std::string> read_permissions; | 62 std::vector<std::string> read_permissions; |
63 read_permissions.push_back( | 63 read_permissions.push_back( |
64 extensions::MediaGalleriesPermission::kReadPermission); | 64 extensions::MediaGalleriesPermission::kReadPermission); |
65 extension_ = AddMediaGalleriesApp("read", read_permissions, profile_.get()); | 65 extension_ = AddMediaGalleriesApp("read", read_permissions, profile_.get()); |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 MediaGalleriesDialogController::Entries results = | 413 MediaGalleriesDialogController::Entries results = |
414 controller()->GetSectionEntries(0); | 414 controller()->GetSectionEntries(0); |
415 ASSERT_EQ(5U, results.size()); | 415 ASSERT_EQ(5U, results.size()); |
416 EXPECT_EQ(first, results[0].pref_info.pref_id); | 416 EXPECT_EQ(first, results[0].pref_info.pref_id); |
417 EXPECT_EQ(second, results[1].pref_info.pref_id); | 417 EXPECT_EQ(second, results[1].pref_info.pref_id); |
418 EXPECT_EQ(third, results[2].pref_info.pref_id); | 418 EXPECT_EQ(third, results[2].pref_info.pref_id); |
419 EXPECT_EQ(fourth, results[3].pref_info.pref_id); | 419 EXPECT_EQ(fourth, results[3].pref_info.pref_id); |
420 EXPECT_EQ(fifth, results[4].pref_info.pref_id); | 420 EXPECT_EQ(fifth, results[4].pref_info.pref_id); |
421 controller()->DialogFinished(false); | 421 controller()->DialogFinished(false); |
422 } | 422 } |
OLD | NEW |