| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // Create a profile for the user. | 83 // Create a profile for the user. |
| 84 manager()->CreateTestingProfile(account_id.GetUserEmail()); | 84 manager()->CreateTestingProfile(account_id.GetUserEmail()); |
| 85 } | 85 } |
| 86 | 86 |
| 87 AvatarMenu* GetAvatarMenu() { | 87 AvatarMenu* GetAvatarMenu() { |
| 88 // Reset the MockObserver. | 88 // Reset the MockObserver. |
| 89 mock_observer_.reset(new MockObserver()); | 89 mock_observer_.reset(new MockObserver()); |
| 90 EXPECT_EQ(0, change_count()); | 90 EXPECT_EQ(0, change_count()); |
| 91 | 91 |
| 92 // Reset the menu. | 92 // Reset the menu. |
| 93 avatar_menu_.reset(new AvatarMenu( | 93 avatar_menu_.reset(new AvatarMenu(manager()->profile_attributes_storage(), |
| 94 manager()->profile_info_cache(), | 94 mock_observer_.get(), NULL)); |
| 95 mock_observer_.get(), | |
| 96 NULL)); | |
| 97 avatar_menu_->RebuildMenu(); | 95 avatar_menu_->RebuildMenu(); |
| 98 EXPECT_EQ(0, change_count()); | 96 EXPECT_EQ(0, change_count()); |
| 99 return avatar_menu_.get(); | 97 return avatar_menu_.get(); |
| 100 } | 98 } |
| 101 | 99 |
| 102 void ActiveUserChanged(const base::string16& name) { | 100 void ActiveUserChanged(const base::string16& name) { |
| 103 std::string email_string = base::UTF16ToASCII(name) + "@example.com"; | 101 std::string email_string = base::UTF16ToASCII(name) + "@example.com"; |
| 104 const AccountId account_id(AccountId::FromUserEmail(email_string)); | 102 const AccountId account_id(AccountId::FromUserEmail(email_string)); |
| 105 GetFakeChromeUserManager()->SwitchActiveUser(account_id); | 103 GetFakeChromeUserManager()->SwitchActiveUser(account_id); |
| 106 } | 104 } |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 | 301 |
| 304 // Should only show avatar menu with multiple users. | 302 // Should only show avatar menu with multiple users. |
| 305 EXPECT_FALSE(AvatarMenu::ShouldShowAvatarMenu()); | 303 EXPECT_FALSE(AvatarMenu::ShouldShowAvatarMenu()); |
| 306 | 304 |
| 307 AddProfile(name2, false); | 305 AddProfile(name2, false); |
| 308 | 306 |
| 309 EXPECT_FALSE(AvatarMenu::ShouldShowAvatarMenu()); | 307 EXPECT_FALSE(AvatarMenu::ShouldShowAvatarMenu()); |
| 310 } | 308 } |
| 311 | 309 |
| 312 } // namespace chromeos | 310 } // namespace chromeos |
| OLD | NEW |