Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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(cache.GetIndexOfProfileWithPath(path_profile1), |
| 120 false, | |
| 121 ProfileMetrics::SWITCH_PROFILE_ICON); | |
|
msw
2014/01/29 17:51:58
optional nit: you could wrap this onto the line ab
bcwhite
2014/01/29 19:50:52
Done.
| |
| 120 EXPECT_EQ(1U, browser_list->size()); | 122 EXPECT_EQ(1U, browser_list->size()); |
| 121 EXPECT_EQ(path_profile1, browser_list->get(0)->profile()->GetPath()); | 123 EXPECT_EQ(path_profile1, browser_list->get(0)->profile()->GetPath()); |
| 122 | 124 |
| 123 // Open a browser window for the second profile. | 125 // Open a browser window for the second profile. |
| 124 menu->SwitchToProfile(cache.GetIndexOfProfileWithPath(path_profile2), false); | 126 menu->SwitchToProfile(cache.GetIndexOfProfileWithPath(path_profile2), |
| 127 false, | |
| 128 ProfileMetrics::SWITCH_PROFILE_ICON); | |
| 125 EXPECT_EQ(2U, browser_list->size()); | 129 EXPECT_EQ(2U, browser_list->size()); |
| 126 | 130 |
| 127 // Switch to the first profile without opening a new window. | 131 // Switch to the first profile without opening a new window. |
| 128 menu->SwitchToProfile(cache.GetIndexOfProfileWithPath(path_profile1), false); | 132 menu->SwitchToProfile(cache.GetIndexOfProfileWithPath(path_profile1), |
| 133 false, | |
| 134 ProfileMetrics::SWITCH_PROFILE_ICON); | |
| 129 EXPECT_EQ(2U, browser_list->size()); | 135 EXPECT_EQ(2U, browser_list->size()); |
| 130 EXPECT_EQ(path_profile1, browser_list->get(0)->profile()->GetPath()); | 136 EXPECT_EQ(path_profile1, browser_list->get(0)->profile()->GetPath()); |
| 131 EXPECT_EQ(path_profile2, browser_list->get(1)->profile()->GetPath()); | 137 EXPECT_EQ(path_profile2, browser_list->get(1)->profile()->GetPath()); |
| 132 } | 138 } |
| OLD | NEW |