| 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 <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 void AddOmittedProfile(const std::string& name) { | 82 void AddOmittedProfile(const std::string& name) { |
| 83 ProfileAttributesStorage* storage = manager()->profile_attributes_storage(); | 83 ProfileAttributesStorage* storage = manager()->profile_attributes_storage(); |
| 84 storage->AddProfile(manager()->profiles_dir().AppendASCII(name), | 84 storage->AddProfile(manager()->profiles_dir().AppendASCII(name), |
| 85 ASCIIToUTF16(name), std::string(), base::string16(), 0, "TEST_ID"); | 85 ASCIIToUTF16(name), std::string(), base::string16(), 0, "TEST_ID"); |
| 86 } | 86 } |
| 87 | 87 |
| 88 int change_count() const { return mock_observer_->change_count(); } | 88 int change_count() const { return mock_observer_->change_count(); } |
| 89 | 89 |
| 90 private: | 90 private: |
| 91 content::TestBrowserThreadBundle thread_bundle_; |
| 91 TestingProfileManager manager_; | 92 TestingProfileManager manager_; |
| 92 std::unique_ptr<MockObserver> mock_observer_; | 93 std::unique_ptr<MockObserver> mock_observer_; |
| 93 std::unique_ptr<AvatarMenu> avatar_menu_; | 94 std::unique_ptr<AvatarMenu> avatar_menu_; |
| 94 content::TestBrowserThreadBundle thread_bundle_; | |
| 95 | 95 |
| 96 DISALLOW_COPY_AND_ASSIGN(ProfileListDesktopTest); | 96 DISALLOW_COPY_AND_ASSIGN(ProfileListDesktopTest); |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 TEST_F(ProfileListDesktopTest, InitialCreation) { | 99 TEST_F(ProfileListDesktopTest, InitialCreation) { |
| 100 manager()->CreateTestingProfile("Test 1"); | 100 manager()->CreateTestingProfile("Test 1"); |
| 101 manager()->CreateTestingProfile("Test 2"); | 101 manager()->CreateTestingProfile("Test 2"); |
| 102 | 102 |
| 103 AvatarMenu* menu = GetAvatarMenu(); | 103 AvatarMenu* menu = GetAvatarMenu(); |
| 104 EXPECT_EQ(0, change_count()); | 104 EXPECT_EQ(0, change_count()); |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 base::string16 supervised_user_label = | 322 base::string16 supervised_user_label = |
| 323 l10n_util::GetStringUTF16(IDS_LEGACY_SUPERVISED_USER_AVATAR_LABEL); | 323 l10n_util::GetStringUTF16(IDS_LEGACY_SUPERVISED_USER_AVATAR_LABEL); |
| 324 const AvatarMenu::Item& item1 = menu->GetItemAt(0u); | 324 const AvatarMenu::Item& item1 = menu->GetItemAt(0u); |
| 325 EXPECT_NE(item1.username, supervised_user_label); | 325 EXPECT_NE(item1.username, supervised_user_label); |
| 326 | 326 |
| 327 const AvatarMenu::Item& item2 = menu->GetItemAt(1u); | 327 const AvatarMenu::Item& item2 = menu->GetItemAt(1u); |
| 328 EXPECT_EQ(item2.username, supervised_user_label); | 328 EXPECT_EQ(item2.username, supervised_user_label); |
| 329 } | 329 } |
| 330 | 330 |
| 331 } // namespace | 331 } // namespace |
| OLD | NEW |