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/ui/settings_window_manager.h" | 5 #include "chrome/browser/ui/settings_window_manager.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 : settings_manager_(chrome::SettingsWindowManager::GetInstance()), | 54 : settings_manager_(chrome::SettingsWindowManager::GetInstance()), |
55 test_profile_(NULL) { | 55 test_profile_(NULL) { |
56 settings_manager_->AddObserver(&observer_); | 56 settings_manager_->AddObserver(&observer_); |
57 } | 57 } |
58 virtual ~SettingsWindowManagerTest() { | 58 virtual ~SettingsWindowManagerTest() { |
59 settings_manager_->RemoveObserver(&observer_); | 59 settings_manager_->RemoveObserver(&observer_); |
60 } | 60 } |
61 | 61 |
62 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 62 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
63 command_line->AppendSwitch(::switches::kEnableSettingsWindow); | 63 command_line->AppendSwitch(::switches::kEnableSettingsWindow); |
64 command_line->AppendSwitch(::switches::kMultiProfiles); | |
65 } | 64 } |
66 | 65 |
67 Profile* CreateTestProfile() { | 66 Profile* CreateTestProfile() { |
68 CHECK(!test_profile_); | 67 CHECK(!test_profile_); |
69 | 68 |
70 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 69 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
71 base::RunLoop run_loop; | 70 base::RunLoop run_loop; |
72 profile_manager->CreateProfileAsync( | 71 profile_manager->CreateProfileAsync( |
73 profile_manager->GenerateNextProfileDirectoryPath(), | 72 profile_manager->GenerateNextProfileDirectoryPath(), |
74 base::Bind(&SettingsWindowManagerTest::ProfileInitialized, | 73 base::Bind(&SettingsWindowManagerTest::ProfileInitialized, |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 std::string extension_to_highlight; // none | 202 std::string extension_to_highlight; // none |
204 chrome::ShowExtensions(browser(), extension_to_highlight); | 203 chrome::ShowExtensions(browser(), extension_to_highlight); |
205 EXPECT_EQ(2u, chrome::GetTotalBrowserCount()); | 204 EXPECT_EQ(2u, chrome::GetTotalBrowserCount()); |
206 | 205 |
207 // Downloads should NOT open a new browser window. | 206 // Downloads should NOT open a new browser window. |
208 CloseNonDefaultBrowsers(); | 207 CloseNonDefaultBrowsers(); |
209 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); | 208 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); |
210 chrome::ShowDownloads(browser()); | 209 chrome::ShowDownloads(browser()); |
211 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); | 210 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); |
212 } | 211 } |
OLD | NEW |