Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Unified Diff: chrome/browser/profiles/profile_info_cache_unittest.cc

Issue 316863002: Rename "managed (mode|user)" to "supervised user" (part 1) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/profile_info_cache.cc ('k') | chrome/browser/profiles/profile_info_interface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_info_cache_unittest.cc
diff --git a/chrome/browser/profiles/profile_info_cache_unittest.cc b/chrome/browser/profiles/profile_info_cache_unittest.cc
index 1907a22cc300bac80df0b36404e4f777e575ae9e..92638ae3e89c7c0cb20cda2c61ff0284c206453c 100644
--- a/chrome/browser/profiles/profile_info_cache_unittest.cc
+++ b/chrome/browser/profiles/profile_info_cache_unittest.cc
@@ -131,10 +131,10 @@ TEST_F(ProfileInfoCacheTest, AddProfiles) {
const SkBitmap* icon = rb.GetImageNamed(
profiles::GetDefaultAvatarIconResourceIDAtIndex(
i)).ToSkBitmap();
- std::string managed_user_id = i == 3 ? "TEST_ID" : "";
+ std::string supervised_user_id = i == 3 ? "TEST_ID" : "";
GetCache()->AddProfileToCache(profile_path, profile_name, base::string16(),
- i, managed_user_id);
+ i, supervised_user_id);
GetCache()->SetBackgroundStatusOfProfileAtIndex(i, true);
base::string16 gaia_name = ASCIIToUTF16(base::StringPrintf("gaia_%ud", i));
GetCache()->SetGAIANameOfProfileAtIndex(i, gaia_name);
@@ -146,9 +146,10 @@ TEST_F(ProfileInfoCacheTest, AddProfiles) {
GetCache()->GetAvatarIconOfProfileAtIndex(i).ToSkBitmap();
EXPECT_EQ(icon->width(), actual_icon->width());
EXPECT_EQ(icon->height(), actual_icon->height());
- EXPECT_EQ(i == 3, GetCache()->ProfileIsManagedAtIndex(i));
+ EXPECT_EQ(i == 3, GetCache()->ProfileIsSupervisedAtIndex(i));
EXPECT_EQ(i == 3, GetCache()->IsOmittedProfileAtIndex(i));
- EXPECT_EQ(managed_user_id, GetCache()->GetManagedUserIdOfProfileAtIndex(i));
+ EXPECT_EQ(supervised_user_id,
+ GetCache()->GetSupervisedUserIdOfProfileAtIndex(i));
}
// Reset the cache and test the it reloads correctly.
@@ -410,22 +411,22 @@ TEST_F(ProfileInfoCacheTest, PersistGAIAPicture) {
gaia_image, *GetCache()->GetGAIAPictureOfProfileAtIndex(0)));
}
-TEST_F(ProfileInfoCacheTest, SetManagedUserId) {
+TEST_F(ProfileInfoCacheTest, SetSupervisedUserId) {
GetCache()->AddProfileToCache(
GetProfilePath("test"), ASCIIToUTF16("Test"),
base::string16(), 0, std::string());
- EXPECT_FALSE(GetCache()->ProfileIsManagedAtIndex(0));
+ EXPECT_FALSE(GetCache()->ProfileIsSupervisedAtIndex(0));
- GetCache()->SetManagedUserIdOfProfileAtIndex(0, "TEST_ID");
- EXPECT_TRUE(GetCache()->ProfileIsManagedAtIndex(0));
- EXPECT_EQ("TEST_ID", GetCache()->GetManagedUserIdOfProfileAtIndex(0));
+ GetCache()->SetSupervisedUserIdOfProfileAtIndex(0, "TEST_ID");
+ EXPECT_TRUE(GetCache()->ProfileIsSupervisedAtIndex(0));
+ EXPECT_EQ("TEST_ID", GetCache()->GetSupervisedUserIdOfProfileAtIndex(0));
ResetCache();
- EXPECT_TRUE(GetCache()->ProfileIsManagedAtIndex(0));
+ EXPECT_TRUE(GetCache()->ProfileIsSupervisedAtIndex(0));
- GetCache()->SetManagedUserIdOfProfileAtIndex(0, std::string());
- EXPECT_FALSE(GetCache()->ProfileIsManagedAtIndex(0));
- EXPECT_EQ("", GetCache()->GetManagedUserIdOfProfileAtIndex(0));
+ GetCache()->SetSupervisedUserIdOfProfileAtIndex(0, std::string());
+ EXPECT_FALSE(GetCache()->ProfileIsSupervisedAtIndex(0));
+ EXPECT_EQ("", GetCache()->GetSupervisedUserIdOfProfileAtIndex(0));
}
TEST_F(ProfileInfoCacheTest, EmptyGAIAInfo) {
@@ -449,23 +450,24 @@ TEST_F(ProfileInfoCacheTest, EmptyGAIAInfo) {
profile_image, GetCache()->GetAvatarIconOfProfileAtIndex(0)));
}
-TEST_F(ProfileInfoCacheTest, CreateManagedTestingProfile) {
+TEST_F(ProfileInfoCacheTest, CreateSupervisedTestingProfile) {
testing_profile_manager_.CreateTestingProfile("default");
- base::string16 managed_user_name = ASCIIToUTF16("Supervised User");
+ base::string16 supervised_user_name = ASCIIToUTF16("Supervised User");
testing_profile_manager_.CreateTestingProfile(
"test1", scoped_ptr<PrefServiceSyncable>(),
- managed_user_name, 0, "TEST_ID", TestingProfile::TestingFactories());
+ supervised_user_name, 0, "TEST_ID", TestingProfile::TestingFactories());
for (size_t i = 0; i < GetCache()->GetNumberOfProfiles(); i++) {
- bool is_managed =
- GetCache()->GetNameOfProfileAtIndex(i) == managed_user_name;
- EXPECT_EQ(is_managed, GetCache()->ProfileIsManagedAtIndex(i));
- std::string managed_user_id = is_managed ? "TEST_ID" : "";
- EXPECT_EQ(managed_user_id, GetCache()->GetManagedUserIdOfProfileAtIndex(i));
+ bool is_supervised =
+ GetCache()->GetNameOfProfileAtIndex(i) == supervised_user_name;
+ EXPECT_EQ(is_supervised, GetCache()->ProfileIsSupervisedAtIndex(i));
+ std::string supervised_user_id = is_supervised ? "TEST_ID" : "";
+ EXPECT_EQ(supervised_user_id,
+ GetCache()->GetSupervisedUserIdOfProfileAtIndex(i));
}
- // Managed profiles have a custom theme, which needs to be deleted on the FILE
- // thread. Reset the profile manager now so everything is deleted while we
- // still have a FILE thread.
+ // Supervised profiles have a custom theme, which needs to be deleted on the
+ // FILE thread. Reset the profile manager now so everything is deleted while
+ // we still have a FILE thread.
TestingBrowserProcess::GetGlobal()->SetProfileManager(NULL);
}
« no previous file with comments | « chrome/browser/profiles/profile_info_cache.cc ('k') | chrome/browser/profiles/profile_info_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698