| 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/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 GetFakeUserManager()->UserLoggedIn( | 91 GetFakeUserManager()->UserLoggedIn( |
| 92 email_string, | 92 email_string, |
| 93 email_string + kUserIdHashSuffix, | 93 email_string + kUserIdHashSuffix, |
| 94 false); | 94 false); |
| 95 } | 95 } |
| 96 | 96 |
| 97 // Create a profile for the user. | 97 // Create a profile for the user. |
| 98 manager()->CreateTestingProfile( | 98 manager()->CreateTestingProfile( |
| 99 chrome::kProfileDirPrefix + email_string + kUserIdHashSuffix, | 99 chrome::kProfileDirPrefix + email_string + kUserIdHashSuffix, |
| 100 scoped_ptr<PrefServiceSyncable>(), | 100 scoped_ptr<PrefServiceSyncable>(), |
| 101 ASCIIToUTF16(email_string), 0, std::string()); | 101 ASCIIToUTF16(email_string), 0, std::string(), |
| 102 TestingProfile::TestingFactories()); |
| 102 } | 103 } |
| 103 | 104 |
| 104 AvatarMenu* GetAvatarMenu() { | 105 AvatarMenu* GetAvatarMenu() { |
| 105 // Reset the MockObserver. | 106 // Reset the MockObserver. |
| 106 mock_observer_.reset(new MockObserver()); | 107 mock_observer_.reset(new MockObserver()); |
| 107 EXPECT_EQ(0, change_count()); | 108 EXPECT_EQ(0, change_count()); |
| 108 | 109 |
| 109 // Reset the menu. | 110 // Reset the menu. |
| 110 avatar_menu_.reset(new AvatarMenu( | 111 avatar_menu_.reset(new AvatarMenu( |
| 111 manager()->profile_info_cache(), | 112 manager()->profile_info_cache(), |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 | 329 |
| 329 // Should only show avatar menu with multiple users. | 330 // Should only show avatar menu with multiple users. |
| 330 EXPECT_FALSE(AvatarMenu::ShouldShowAvatarMenu()); | 331 EXPECT_FALSE(AvatarMenu::ShouldShowAvatarMenu()); |
| 331 | 332 |
| 332 AddProfile(name2, false); | 333 AddProfile(name2, false); |
| 333 | 334 |
| 334 EXPECT_TRUE(AvatarMenu::ShouldShowAvatarMenu()); | 335 EXPECT_TRUE(AvatarMenu::ShouldShowAvatarMenu()); |
| 335 } | 336 } |
| 336 | 337 |
| 337 } // namespace chromeos | 338 } // namespace chromeos |
| OLD | NEW |