OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser_command_controller.h" | 5 #include "chrome/browser/ui/browser_command_controller.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 // RunUntilIdle() (racily) isn't sufficient to ensure browser creation, so | 94 // RunUntilIdle() (racily) isn't sufficient to ensure browser creation, so |
95 // listen for the notification. | 95 // listen for the notification. |
96 base::MessageLoop::current()->RunUntilIdle(); | 96 base::MessageLoop::current()->RunUntilIdle(); |
97 browser_creation_observer.Wait(); | 97 browser_creation_observer.Wait(); |
98 EXPECT_EQ(2U, BrowserList::GetInstance()->size()); | 98 EXPECT_EQ(2U, BrowserList::GetInstance()->size()); |
99 | 99 |
100 // Access the browser that was created for the new Guest Profile. | 100 // Access the browser that was created for the new Guest Profile. |
101 Profile* guest = g_browser_process->profile_manager()->GetProfileByPath( | 101 Profile* guest = g_browser_process->profile_manager()->GetProfileByPath( |
102 ProfileManager::GetGuestProfilePath()); | 102 ProfileManager::GetGuestProfilePath()); |
103 Browser* browser = chrome::FindAnyBrowser( | 103 Browser* browser = chrome::FindAnyBrowser(guest, true); |
104 guest, true, chrome::GetActiveDesktop()); | |
105 EXPECT_TRUE(browser); | 104 EXPECT_TRUE(browser); |
106 | 105 |
107 // The BrowsingDataRemover needs a loaded TemplateUrlService or else it hangs | 106 // The BrowsingDataRemover needs a loaded TemplateUrlService or else it hangs |
108 // on to a CallbackList::Subscription forever. | 107 // on to a CallbackList::Subscription forever. |
109 TemplateURLServiceFactory::GetForProfile(guest)->set_loaded(true); | 108 TemplateURLServiceFactory::GetForProfile(guest)->set_loaded(true); |
110 | 109 |
111 const CommandUpdater* command_updater = | 110 const CommandUpdater* command_updater = |
112 browser->command_controller()->command_updater(); | 111 browser->command_controller()->command_updater(); |
113 #if defined(OS_CHROMEOS) | 112 #if defined(OS_CHROMEOS) |
114 // Chrome OS uses system tray menu to handle multi-profiles. | 113 // Chrome OS uses system tray menu to handle multi-profiles. |
115 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_SHOW_AVATAR_MENU)); | 114 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_SHOW_AVATAR_MENU)); |
116 #else | 115 #else |
117 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_AVATAR_MENU)); | 116 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_AVATAR_MENU)); |
118 #endif | 117 #endif |
119 } | 118 } |
OLD | NEW |