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

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

Issue 132453004: Add Profile metric counting to new User Manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more mac compilation fixes Created 6 years, 11 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 | Annotate | Revision Log
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"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 ASSERT_EQ(cache.GetNumberOfProfiles(), 2U); 109 ASSERT_EQ(cache.GetNumberOfProfiles(), 2U);
110 110
111 AvatarMenu* menu = GetAvatarMenu(&cache); 111 AvatarMenu* menu = GetAvatarMenu(&cache);
112 menu->RebuildMenu(); 112 menu->RebuildMenu();
113 BrowserList* browser_list = 113 BrowserList* browser_list =
114 BrowserList::GetInstance(chrome::GetActiveDesktop()); 114 BrowserList::GetInstance(chrome::GetActiveDesktop());
115 EXPECT_EQ(1U, browser_list->size()); 115 EXPECT_EQ(1U, browser_list->size());
116 EXPECT_EQ(path_profile1, browser_list->get(0)->profile()->GetPath()); 116 EXPECT_EQ(path_profile1, browser_list->get(0)->profile()->GetPath());
117 117
118 // Open a browser window for the first profile. 118 // Open a browser window for the first profile.
119 menu->SwitchToProfile(cache.GetIndexOfProfileWithPath(path_profile1), false); 119 menu->SwitchToProfile(
120 cache.GetIndexOfProfileWithPath(path_profile1),
121 false,
122 ProfileMetrics::SWITCH_PROFILE_ICON);
120 EXPECT_EQ(1U, browser_list->size()); 123 EXPECT_EQ(1U, browser_list->size());
121 EXPECT_EQ(path_profile1, browser_list->get(0)->profile()->GetPath()); 124 EXPECT_EQ(path_profile1, browser_list->get(0)->profile()->GetPath());
122 125
123 // Open a browser window for the second profile. 126 // Open a browser window for the second profile.
124 menu->SwitchToProfile(cache.GetIndexOfProfileWithPath(path_profile2), false); 127 menu->SwitchToProfile(
128 cache.GetIndexOfProfileWithPath(path_profile2),
129 false,
130 ProfileMetrics::SWITCH_PROFILE_ICON);
125 EXPECT_EQ(2U, browser_list->size()); 131 EXPECT_EQ(2U, browser_list->size());
126 132
127 // Switch to the first profile without opening a new window. 133 // Switch to the first profile without opening a new window.
128 menu->SwitchToProfile(cache.GetIndexOfProfileWithPath(path_profile1), false); 134 menu->SwitchToProfile(
135 cache.GetIndexOfProfileWithPath(path_profile1),
136 false,
137 ProfileMetrics::SWITCH_PROFILE_ICON);
129 EXPECT_EQ(2U, browser_list->size()); 138 EXPECT_EQ(2U, browser_list->size());
130 EXPECT_EQ(path_profile1, browser_list->get(0)->profile()->GetPath()); 139 EXPECT_EQ(path_profile1, browser_list->get(0)->profile()->GetPath());
131 EXPECT_EQ(path_profile2, browser_list->get(1)->profile()->GetPath()); 140 EXPECT_EQ(path_profile2, browser_list->get(1)->profile()->GetPath());
132 } 141 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698