| 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 <memory> |
| 5 #include <string> | 6 #include <string> |
| 6 | 7 |
| 7 #include "ash/ash_switches.h" | 8 #include "ash/ash_switches.h" |
| 8 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 9 #include "base/macros.h" | 10 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" | 13 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" |
| 14 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" | 14 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" |
| 15 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 15 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 16 #include "chrome/browser/profiles/avatar_menu.h" | 16 #include "chrome/browser/profiles/avatar_menu.h" |
| 17 #include "chrome/browser/profiles/avatar_menu_observer.h" | 17 #include "chrome/browser/profiles/avatar_menu_observer.h" |
| 18 #include "chrome/browser/profiles/profile_attributes_entry.h" | 18 #include "chrome/browser/profiles/profile_attributes_entry.h" |
| 19 #include "chrome/browser/profiles/profile_attributes_storage.h" | 19 #include "chrome/browser/profiles/profile_attributes_storage.h" |
| 20 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" | 20 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 GetFakeChromeUserManager()->SwitchActiveUser(account_id); | 105 GetFakeChromeUserManager()->SwitchActiveUser(account_id); |
| 106 } | 106 } |
| 107 | 107 |
| 108 TestingProfileManager* manager() { return &manager_; } | 108 TestingProfileManager* manager() { return &manager_; } |
| 109 | 109 |
| 110 int change_count() const { return mock_observer_->change_count(); } | 110 int change_count() const { return mock_observer_->change_count(); } |
| 111 | 111 |
| 112 private: | 112 private: |
| 113 content::TestBrowserThreadBundle thread_bundle_; | 113 content::TestBrowserThreadBundle thread_bundle_; |
| 114 TestingProfileManager manager_; | 114 TestingProfileManager manager_; |
| 115 scoped_ptr<MockObserver> mock_observer_; | 115 std::unique_ptr<MockObserver> mock_observer_; |
| 116 scoped_ptr<ScopedUserManagerEnabler> user_manager_enabler_; | 116 std::unique_ptr<ScopedUserManagerEnabler> user_manager_enabler_; |
| 117 scoped_ptr<AvatarMenu> avatar_menu_; | 117 std::unique_ptr<AvatarMenu> avatar_menu_; |
| 118 ChromeShellDelegate chrome_shell_delegate_; | 118 ChromeShellDelegate chrome_shell_delegate_; |
| 119 | 119 |
| 120 DISALLOW_COPY_AND_ASSIGN(ProfileListChromeOSTest); | 120 DISALLOW_COPY_AND_ASSIGN(ProfileListChromeOSTest); |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 TEST_F(ProfileListChromeOSTest, InitialCreation) { | 123 TEST_F(ProfileListChromeOSTest, InitialCreation) { |
| 124 base::string16 name1(ASCIIToUTF16("p1")); | 124 base::string16 name1(ASCIIToUTF16("p1")); |
| 125 | 125 |
| 126 AddProfile(name1, true); | 126 AddProfile(name1, true); |
| 127 | 127 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 | 308 |
| 309 // Should only show avatar menu with multiple users. | 309 // Should only show avatar menu with multiple users. |
| 310 EXPECT_FALSE(AvatarMenu::ShouldShowAvatarMenu()); | 310 EXPECT_FALSE(AvatarMenu::ShouldShowAvatarMenu()); |
| 311 | 311 |
| 312 AddProfile(name2, false); | 312 AddProfile(name2, false); |
| 313 | 313 |
| 314 EXPECT_FALSE(AvatarMenu::ShouldShowAvatarMenu()); | 314 EXPECT_FALSE(AvatarMenu::ShouldShowAvatarMenu()); |
| 315 } | 315 } |
| 316 | 316 |
| 317 } // namespace chromeos | 317 } // namespace chromeos |
| OLD | NEW |