| 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 "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 delegate->Cancel(); | 71 delegate->Cancel(); |
| 72 content::RunAllPendingInMessageLoop(); | 72 content::RunAllPendingInMessageLoop(); |
| 73 EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_FIND)); | 73 EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_FIND)); |
| 74 } | 74 } |
| 75 | 75 |
| 76 // Note that a Browser's destructor, when the browser's profile is guest, will | 76 // Note that a Browser's destructor, when the browser's profile is guest, will |
| 77 // create and execute a BrowsingDataRemover. | 77 // create and execute a BrowsingDataRemover. |
| 78 // Flakes http://crbug.com/471953 | 78 // Flakes http://crbug.com/471953 |
| 79 IN_PROC_BROWSER_TEST_F(BrowserCommandControllerBrowserTest, | 79 IN_PROC_BROWSER_TEST_F(BrowserCommandControllerBrowserTest, |
| 80 DISABLED_NewAvatarMenuEnabledInGuestMode) { | 80 DISABLED_NewAvatarMenuEnabledInGuestMode) { |
| 81 switches::EnableNewAvatarMenuForTesting( | |
| 82 base::CommandLine::ForCurrentProcess()); | |
| 83 | |
| 84 EXPECT_EQ(1U, BrowserList::GetInstance(chrome::GetActiveDesktop())->size()); | 81 EXPECT_EQ(1U, BrowserList::GetInstance(chrome::GetActiveDesktop())->size()); |
| 85 | 82 |
| 86 // Create a guest browser nicely. Using CreateProfile() and CreateBrowser() | 83 // Create a guest browser nicely. Using CreateProfile() and CreateBrowser() |
| 87 // does incomplete initialization that would lead to | 84 // does incomplete initialization that would lead to |
| 88 // SystemUrlRequestContextGetter being leaked. | 85 // SystemUrlRequestContextGetter being leaked. |
| 89 content::WindowedNotificationObserver browser_creation_observer( | 86 content::WindowedNotificationObserver browser_creation_observer( |
| 90 chrome::NOTIFICATION_BROWSER_WINDOW_READY, | 87 chrome::NOTIFICATION_BROWSER_WINDOW_READY, |
| 91 content::NotificationService::AllSources()); | 88 content::NotificationService::AllSources()); |
| 92 profiles::SwitchToGuestProfile(chrome::GetActiveDesktop(), | 89 profiles::SwitchToGuestProfile(chrome::GetActiveDesktop(), |
| 93 ProfileManager::CreateCallback()); | 90 ProfileManager::CreateCallback()); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 111 | 108 |
| 112 const CommandUpdater* command_updater = | 109 const CommandUpdater* command_updater = |
| 113 browser->command_controller()->command_updater(); | 110 browser->command_controller()->command_updater(); |
| 114 #if defined(OS_CHROMEOS) | 111 #if defined(OS_CHROMEOS) |
| 115 // Chrome OS uses system tray menu to handle multi-profiles. | 112 // Chrome OS uses system tray menu to handle multi-profiles. |
| 116 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_SHOW_AVATAR_MENU)); | 113 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_SHOW_AVATAR_MENU)); |
| 117 #else | 114 #else |
| 118 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_AVATAR_MENU)); | 115 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_AVATAR_MENU)); |
| 119 #endif | 116 #endif |
| 120 } | 117 } |
| OLD | NEW |