Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: chrome/browser/profiles/profile_list_desktop_browsertest.cc

Issue 564453003: Access to Chrome via the System Tray should go through the User Manager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase continued Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/path_service.h" 6 #include "base/path_service.h"
7 #include "chrome/browser/chrome_notification_types.h" 7 #include "chrome/browser/chrome_notification_types.h"
8 #include "chrome/browser/profiles/avatar_menu.h" 8 #include "chrome/browser/profiles/avatar_menu.h"
9 #include "chrome/browser/profiles/profile_manager.h" 9 #include "chrome/browser/profiles/profile_manager.h"
10 #include "chrome/browser/profiles/profile_window.h" 10 #include "chrome/browser/profiles/profile_window.h"
11 #include "chrome/browser/profiles/profiles_state.h" 11 #include "chrome/browser/profiles/profiles_state.h"
12 #include "chrome/browser/ui/browser.h" 12 #include "chrome/browser/ui/browser.h"
13 #include "chrome/browser/ui/browser_dialogs.h"
14 #include "chrome/browser/ui/browser_list.h" 13 #include "chrome/browser/ui/browser_list.h"
14 #include "chrome/browser/ui/user_manager.h"
15 #include "chrome/common/chrome_paths.h" 15 #include "chrome/common/chrome_paths.h"
16 #include "chrome/test/base/in_process_browser_test.h" 16 #include "chrome/test/base/in_process_browser_test.h"
17 #include "chrome/test/base/test_switches.h" 17 #include "chrome/test/base/test_switches.h"
18 #include "chrome/test/base/testing_browser_process.h" 18 #include "chrome/test/base/testing_browser_process.h"
19 #include "content/public/test/test_utils.h" 19 #include "content/public/test/test_utils.h"
20 20
21 namespace { 21 namespace {
22 22
23 // An observer that returns back to test code after a new profile is 23 // An observer that returns back to test code after a new profile is
24 // initialized. 24 // initialized.
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 content::Source<Browser>(browser())); 79 content::Source<Browser>(browser()));
80 80
81 EXPECT_FALSE(cache.ProfileIsSigninRequiredAtIndex(index)); 81 EXPECT_FALSE(cache.ProfileIsSigninRequiredAtIndex(index));
82 profiles::LockProfile(current_profile); 82 profiles::LockProfile(current_profile);
83 window_close_observer.Wait(); // rely on test time-out for failure indication 83 window_close_observer.Wait(); // rely on test time-out for failure indication
84 84
85 EXPECT_TRUE(cache.ProfileIsSigninRequiredAtIndex(index)); 85 EXPECT_TRUE(cache.ProfileIsSigninRequiredAtIndex(index));
86 EXPECT_EQ(0U, browser_list->size()); 86 EXPECT_EQ(0U, browser_list->size());
87 87
88 // Signing out brings up the User Manager which we should close before exit. 88 // Signing out brings up the User Manager which we should close before exit.
89 chrome::HideUserManager(); 89 UserManager::Hide();
90 } 90 }
91 91
92 #if defined(OS_CHROMEOS) 92 #if defined(OS_CHROMEOS)
93 // This test doesn't make sense for Chrome OS since it has a different 93 // This test doesn't make sense for Chrome OS since it has a different
94 // multi-profiles menu in the system tray instead. 94 // multi-profiles menu in the system tray instead.
95 #define MAYBE_SwitchToProfile DISABLED_SwitchToProfile 95 #define MAYBE_SwitchToProfile DISABLED_SwitchToProfile
96 #else 96 #else
97 #define MAYBE_SwitchToProfile SwitchToProfile 97 #define MAYBE_SwitchToProfile SwitchToProfile
98 #endif 98 #endif
99 IN_PROC_BROWSER_TEST_F(ProfileListDesktopBrowserTest, MAYBE_SwitchToProfile) { 99 IN_PROC_BROWSER_TEST_F(ProfileListDesktopBrowserTest, MAYBE_SwitchToProfile) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 false, ProfileMetrics::SWITCH_PROFILE_ICON); 143 false, ProfileMetrics::SWITCH_PROFILE_ICON);
144 EXPECT_EQ(2U, browser_list->size()); 144 EXPECT_EQ(2U, browser_list->size());
145 145
146 // Switch to the first profile without opening a new window. 146 // Switch to the first profile without opening a new window.
147 menu->SwitchToProfile(cache.GetIndexOfProfileWithPath(path_profile1), 147 menu->SwitchToProfile(cache.GetIndexOfProfileWithPath(path_profile1),
148 false, ProfileMetrics::SWITCH_PROFILE_ICON); 148 false, ProfileMetrics::SWITCH_PROFILE_ICON);
149 EXPECT_EQ(2U, browser_list->size()); 149 EXPECT_EQ(2U, browser_list->size());
150 EXPECT_EQ(path_profile1, browser_list->get(0)->profile()->GetPath()); 150 EXPECT_EQ(path_profile1, browser_list->get(0)->profile()->GetPath());
151 EXPECT_EQ(path_profile2, browser_list->get(1)->profile()->GetPath()); 151 EXPECT_EQ(path_profile2, browser_list->get(1)->profile()->GetPath());
152 } 152 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/avatar_menu.cc ('k') | chrome/browser/profiles/profile_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698