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/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 157 |
158 TEST_F(ProfileListChromeOSTest, DontShowSupervisedUsers) { | 158 TEST_F(ProfileListChromeOSTest, DontShowSupervisedUsers) { |
159 base::string16 name1(ASCIIToUTF16("p1")); | 159 base::string16 name1(ASCIIToUTF16("p1")); |
160 base::string16 supervised_name(ASCIIToUTF16("p2@example.com")); | 160 base::string16 supervised_name(ASCIIToUTF16("p2@example.com")); |
161 | 161 |
162 AddProfile(name1, true); | 162 AddProfile(name1, true); |
163 | 163 |
164 // Add a managed user profile. | 164 // Add a managed user profile. |
165 ProfileInfoCache* cache = manager()->profile_info_cache(); | 165 ProfileInfoCache* cache = manager()->profile_info_cache(); |
166 manager()->profile_info_cache()->AddProfileToCache( | 166 manager()->profile_info_cache()->AddProfileToCache( |
167 cache->GetUserDataDir().AppendASCII("p2"), supervised_name, | 167 cache->GetUserDataDir().AppendASCII("p2"), supervised_name, std::string(), |
168 base::string16(), 0, "TEST_ID"); | 168 base::string16(), 0, "TEST_ID"); |
169 | 169 |
170 GetFakeChromeUserManager()->AddUser(base::UTF16ToASCII(supervised_name)); | 170 GetFakeChromeUserManager()->AddUser(base::UTF16ToASCII(supervised_name)); |
171 | 171 |
172 AvatarMenu* menu = GetAvatarMenu(); | 172 AvatarMenu* menu = GetAvatarMenu(); |
173 ASSERT_EQ(1U, menu->GetNumberOfItems()); | 173 ASSERT_EQ(1U, menu->GetNumberOfItems()); |
174 | 174 |
175 const AvatarMenu::Item& item1 = menu->GetItemAt(0); | 175 const AvatarMenu::Item& item1 = menu->GetItemAt(0); |
176 EXPECT_EQ(0U, item1.menu_index); | 176 EXPECT_EQ(0U, item1.menu_index); |
177 EXPECT_EQ(name1, item1.name); | 177 EXPECT_EQ(name1, item1.name); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 | 298 |
299 // Should only show avatar menu with multiple users. | 299 // Should only show avatar menu with multiple users. |
300 EXPECT_FALSE(AvatarMenu::ShouldShowAvatarMenu()); | 300 EXPECT_FALSE(AvatarMenu::ShouldShowAvatarMenu()); |
301 | 301 |
302 AddProfile(name2, false); | 302 AddProfile(name2, false); |
303 | 303 |
304 EXPECT_FALSE(AvatarMenu::ShouldShowAvatarMenu()); | 304 EXPECT_FALSE(AvatarMenu::ShouldShowAvatarMenu()); |
305 } | 305 } |
306 | 306 |
307 } // namespace chromeos | 307 } // namespace chromeos |
OLD | NEW |