| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/profiles/profile_list_desktop.h" | 5 #include "chrome/browser/profiles/profile_list_desktop.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // AvatarMenu and multiple profiles works after user logged in. | 56 // AvatarMenu and multiple profiles works after user logged in. |
| 57 manager_.SetLoggedIn(true); | 57 manager_.SetLoggedIn(true); |
| 58 #endif | 58 #endif |
| 59 } | 59 } |
| 60 | 60 |
| 61 AvatarMenu* GetAvatarMenu() { | 61 AvatarMenu* GetAvatarMenu() { |
| 62 // Reset the MockObserver. | 62 // Reset the MockObserver. |
| 63 mock_observer_.reset(new MockObserver()); | 63 mock_observer_.reset(new MockObserver()); |
| 64 EXPECT_EQ(0, change_count()); | 64 EXPECT_EQ(0, change_count()); |
| 65 | 65 |
| 66 // Reset the model. | 66 // Reset the menu. |
| 67 avatar_menu_.reset(new AvatarMenu( | 67 avatar_menu_.reset(new AvatarMenu( |
| 68 manager()->profile_info_cache(), | 68 manager()->profile_attributes_storage(), |
| 69 mock_observer_.get(), | 69 mock_observer_.get(), |
| 70 NULL)); | 70 NULL)); |
| 71 avatar_menu_->RebuildMenu(); | 71 avatar_menu_->RebuildMenu(); |
| 72 EXPECT_EQ(0, change_count()); | 72 EXPECT_EQ(0, change_count()); |
| 73 return avatar_menu_.get(); | 73 return avatar_menu_.get(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 TestingProfileManager* manager() { return &manager_; } | 76 TestingProfileManager* manager() { return &manager_; } |
| 77 | 77 |
| 78 void AddOmittedProfile(const std::string& name) { | 78 void AddOmittedProfile(const std::string& name) { |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 base::string16 supervised_user_label = | 323 base::string16 supervised_user_label = |
| 324 l10n_util::GetStringUTF16(IDS_LEGACY_SUPERVISED_USER_AVATAR_LABEL); | 324 l10n_util::GetStringUTF16(IDS_LEGACY_SUPERVISED_USER_AVATAR_LABEL); |
| 325 const AvatarMenu::Item& item1 = model->GetItemAt(0); | 325 const AvatarMenu::Item& item1 = model->GetItemAt(0); |
| 326 EXPECT_NE(item1.username, supervised_user_label); | 326 EXPECT_NE(item1.username, supervised_user_label); |
| 327 | 327 |
| 328 const AvatarMenu::Item& item2 = model->GetItemAt(1); | 328 const AvatarMenu::Item& item2 = model->GetItemAt(1); |
| 329 EXPECT_EQ(item2.username, supervised_user_label); | 329 EXPECT_EQ(item2.username, supervised_user_label); |
| 330 } | 330 } |
| 331 | 331 |
| 332 } // namespace | 332 } // namespace |
| OLD | NEW |