diff options
author | treib@chromium.org <treib@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-12 17:14:05 +0000 |
---|---|---|
committer | treib@chromium.org <treib@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-12 17:14:05 +0000 |
commit | d20d04315d2dabd1e5d613adb8dda59a10325508 (patch) | |
tree | 27fb5092d2a17611e07c0057edbeb341c8c596b0 /chrome/browser/profiles/profile_manager_unittest.cc | |
parent | d882d90bf572cb52afe79970acac4f7bd14da5d4 (diff) | |
download | chromium_src-d20d04315d2dabd1e5d613adb8dda59a10325508.zip chromium_src-d20d04315d2dabd1e5d613adb8dda59a10325508.tar.gz chromium_src-d20d04315d2dabd1e5d613adb8dda59a10325508.tar.bz2 |
Rename "managed (mode|user)" to "supervised user" (part 1)
This CL changes:
- "IsManaged" and similar methods in Profile, ProfileInfoCache, and a few other places (which mostly forward to either of those)
- Enum and constant names
- Variable names
- Comments
Still missing:
- I almost certainly missed a few variables and comments
- The actual SU implementation, i.e. c/b/managed_mode/
- JavaScript
- Resource names
But since this CL is already way too huge, I'll try to commit this part now and do the rest in one or more followup CLs.
TBR=thakis@chromium.org (chrome/)
TBR=rogerta@chromium.org (google_apis/)
TBR=haitaol@chromium.org (sync/ and components/sync_driver/)
All the TBRs are simple renames.
BUG=none
Review URL: https://codereview.chromium.org/316863002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276722 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profiles/profile_manager_unittest.cc')
-rw-r--r-- | chrome/browser/profiles/profile_manager_unittest.cc | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/chrome/browser/profiles/profile_manager_unittest.cc b/chrome/browser/profiles/profile_manager_unittest.cc index a0f1660..50e2760 100644 --- a/chrome/browser/profiles/profile_manager_unittest.cc +++ b/chrome/browser/profiles/profile_manager_unittest.cc @@ -120,7 +120,7 @@ class ProfileManagerTest : public testing::Test { // Helper function to create a profile with |name| for a profile |manager|. void CreateProfileAsync(ProfileManager* manager, const std::string& name, - bool is_managed, + bool is_supervised, MockObserver* mock_observer) { manager->CreateProfileAsync( temp_dir_.path().AppendASCII(name), @@ -128,7 +128,7 @@ class ProfileManagerTest : public testing::Test { base::Unretained(mock_observer)), base::UTF8ToUTF16(name), base::UTF8ToUTF16(profiles::GetDefaultAvatarIconUrl(0)), - is_managed ? "Dummy ID" : std::string()); + is_supervised ? "Dummy ID" : std::string()); } // Helper function to add a profile with |profile_name| to @@ -302,7 +302,7 @@ TEST_F(ProfileManagerTest, CreateProfilesAsync) { } TEST_F(ProfileManagerTest, CreateProfileAsyncCheckOmitted) { - std::string name = "Managed Profile"; + std::string name = "0 Supervised Profile"; MockObserver mock_observer; EXPECT_CALL(mock_observer, OnProfileCreated( @@ -316,15 +316,15 @@ TEST_F(ProfileManagerTest, CreateProfileAsyncCheckOmitted) { base::RunLoop().RunUntilIdle(); EXPECT_EQ(1u, cache.GetNumberOfProfiles()); - // Managed profiles should start out omitted from the profile list. + // Supervised profiles should start out omitted from the profile list. EXPECT_TRUE(cache.IsOmittedProfileAtIndex(0)); - name = "Regular Profile"; + name = "1 Regular Profile"; CreateProfileAsync(profile_manager, name, false, &mock_observer); base::RunLoop().RunUntilIdle(); EXPECT_EQ(2u, cache.GetNumberOfProfiles()); - // Non-managed profiles should be included in the profile list. + // Non-supervised profiles should be included in the profile list. EXPECT_FALSE(cache.IsOmittedProfileAtIndex(1)); } @@ -333,26 +333,29 @@ TEST_F(ProfileManagerTest, AddProfileToCacheCheckOmitted) { ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); EXPECT_EQ(0u, cache.GetNumberOfProfiles()); - const base::FilePath managed_path = temp_dir_.path().AppendASCII("Managed"); - TestingProfile* managed_profile = new TestingProfile(managed_path, NULL); - managed_profile->GetPrefs()->SetString(prefs::kManagedUserId, "An ID"); + const base::FilePath supervised_path = + temp_dir_.path().AppendASCII("Supervised"); + TestingProfile* supervised_profile = + new TestingProfile(supervised_path, NULL); + supervised_profile->GetPrefs()->SetString(prefs::kSupervisedUserId, "An ID"); // RegisterTestingProfile adds the profile to the cache and takes ownership. - profile_manager->RegisterTestingProfile(managed_profile, true, false); + profile_manager->RegisterTestingProfile(supervised_profile, true, false); EXPECT_EQ(1u, cache.GetNumberOfProfiles()); EXPECT_TRUE(cache.IsOmittedProfileAtIndex(0)); - const base::FilePath nonmanaged_path = temp_dir_.path().AppendASCII( - "Non-Managed"); - TestingProfile* nonmanaged_profile = new TestingProfile(nonmanaged_path, - NULL); - profile_manager->RegisterTestingProfile(nonmanaged_profile, true, false); + const base::FilePath nonsupervised_path = temp_dir_.path().AppendASCII( + "Non-Supervised"); + TestingProfile* nonsupervised_profile = new TestingProfile(nonsupervised_path, + NULL); + profile_manager->RegisterTestingProfile(nonsupervised_profile, true, false); EXPECT_EQ(2u, cache.GetNumberOfProfiles()); - size_t managed_index = cache.GetIndexOfProfileWithPath(managed_path); - EXPECT_TRUE(cache.IsOmittedProfileAtIndex(managed_index)); - size_t nonmanaged_index = cache.GetIndexOfProfileWithPath(nonmanaged_path); - EXPECT_FALSE(cache.IsOmittedProfileAtIndex(nonmanaged_index)); + size_t supervised_index = cache.GetIndexOfProfileWithPath(supervised_path); + EXPECT_TRUE(cache.IsOmittedProfileAtIndex(supervised_index)); + size_t nonsupervised_index = + cache.GetIndexOfProfileWithPath(nonsupervised_path); + EXPECT_FALSE(cache.IsOmittedProfileAtIndex(nonsupervised_index)); } TEST_F(ProfileManagerTest, GetGuestProfilePath) { |