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

Unified Diff: chrome/browser/supervised_user/supervised_user_service_browsertest.cc

Issue 335833003: Rename "managed (mode|user)" to "supervised user" (part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments (+ a few other cleanups) 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
Index: chrome/browser/supervised_user/supervised_user_service_browsertest.cc
diff --git a/chrome/browser/managed_mode/managed_user_service_browsertest.cc b/chrome/browser/supervised_user/supervised_user_service_browsertest.cc
similarity index 76%
rename from chrome/browser/managed_mode/managed_user_service_browsertest.cc
rename to chrome/browser/supervised_user/supervised_user_service_browsertest.cc
index 770215488451f1f84e3977dfa075720991549db6..a4789972198073abd3d20bfc5433b0723b16ac22 100644
--- a/chrome/browser/managed_mode/managed_user_service_browsertest.cc
+++ b/chrome/browser/supervised_user/supervised_user_service_browsertest.cc
@@ -7,14 +7,14 @@
#include "base/prefs/pref_service.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/managed_mode/managed_user_constants.h"
-#include "chrome/browser/managed_mode/managed_user_service.h"
-#include "chrome/browser/managed_mode/managed_user_service_factory.h"
-#include "chrome/browser/managed_mode/managed_user_settings_service.h"
-#include "chrome/browser/managed_mode/managed_user_settings_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/supervised_user/supervised_user_constants.h"
+#include "chrome/browser/supervised_user/supervised_user_service.h"
+#include "chrome/browser/supervised_user/supervised_user_service_factory.h"
+#include "chrome/browser/supervised_user/supervised_user_settings_service.h"
+#include "chrome/browser/supervised_user/supervised_user_settings_service_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
@@ -26,7 +26,7 @@ namespace {
void TestAuthErrorCallback(const GoogleServiceAuthError& error) {}
-class ManagedUserServiceTestManaged : public InProcessBrowserTest {
+class SupervisedUserServiceTestSupervised : public InProcessBrowserTest {
public:
// content::BrowserTestBase:
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
@@ -36,7 +36,7 @@ class ManagedUserServiceTestManaged : public InProcessBrowserTest {
} // namespace
-typedef InProcessBrowserTest ManagedUserServiceTest;
+typedef InProcessBrowserTest SupervisedUserServiceTest;
// Crashes on Mac.
// http://crbug.com/339501
@@ -47,7 +47,8 @@ typedef InProcessBrowserTest ManagedUserServiceTest;
#endif
// Ensure that a profile that has completed registration is included in the
// list shown in the avatar menu.
-IN_PROC_BROWSER_TEST_F(ManagedUserServiceTest, MAYBE_ClearOmitOnRegistration) {
+IN_PROC_BROWSER_TEST_F(SupervisedUserServiceTest,
+ MAYBE_ClearOmitOnRegistration) {
// Artificially mark the profile as omitted.
ProfileManager* profile_manager = g_browser_process->profile_manager();
ProfileInfoCache& cache = profile_manager->GetProfileInfoCache();
@@ -56,12 +57,12 @@ IN_PROC_BROWSER_TEST_F(ManagedUserServiceTest, MAYBE_ClearOmitOnRegistration) {
cache.SetIsOmittedProfileAtIndex(index, true);
ASSERT_TRUE(cache.IsOmittedProfileAtIndex(index));
- ManagedUserService* managed_user_service =
- ManagedUserServiceFactory::GetForProfile(profile);
+ SupervisedUserService* supervised_user_service =
+ SupervisedUserServiceFactory::GetForProfile(profile);
// A registration error does not clear the flag (the profile should be deleted
// anyway).
- managed_user_service->OnManagedUserRegistered(
+ supervised_user_service->OnSupervisedUserRegistered(
base::Bind(&TestAuthErrorCallback),
profile,
GoogleServiceAuthError(GoogleServiceAuthError::CONNECTION_FAILED),
@@ -69,7 +70,7 @@ IN_PROC_BROWSER_TEST_F(ManagedUserServiceTest, MAYBE_ClearOmitOnRegistration) {
ASSERT_TRUE(cache.IsOmittedProfileAtIndex(index));
// Successfully completing registration clears the flag.
- managed_user_service->OnManagedUserRegistered(
+ supervised_user_service->OnSupervisedUserRegistered(
base::Bind(&TestAuthErrorCallback),
profile,
GoogleServiceAuthError(GoogleServiceAuthError::NONE),
@@ -77,14 +78,14 @@ IN_PROC_BROWSER_TEST_F(ManagedUserServiceTest, MAYBE_ClearOmitOnRegistration) {
EXPECT_FALSE(cache.IsOmittedProfileAtIndex(index));
}
-IN_PROC_BROWSER_TEST_F(ManagedUserServiceTest, LocalPolicies) {
+IN_PROC_BROWSER_TEST_F(SupervisedUserServiceTest, LocalPolicies) {
Profile* profile = browser()->profile();
PrefService* prefs = profile->GetPrefs();
EXPECT_FALSE(prefs->GetBoolean(prefs::kForceSafeSearch));
EXPECT_TRUE(prefs->IsUserModifiablePreference(prefs::kForceSafeSearch));
}
-IN_PROC_BROWSER_TEST_F(ManagedUserServiceTest, ProfileName) {
+IN_PROC_BROWSER_TEST_F(SupervisedUserServiceTest, ProfileName) {
Profile* profile = browser()->profile();
PrefService* prefs = profile->GetPrefs();
EXPECT_TRUE(prefs->IsUserModifiablePreference(prefs::kProfileName));
@@ -97,26 +98,26 @@ IN_PROC_BROWSER_TEST_F(ManagedUserServiceTest, ProfileName) {
base::UTF16ToUTF8(cache.GetNameOfProfileAtIndex(profile_index)));
}
-IN_PROC_BROWSER_TEST_F(ManagedUserServiceTestManaged, LocalPolicies) {
+IN_PROC_BROWSER_TEST_F(SupervisedUserServiceTestSupervised, LocalPolicies) {
Profile* profile = browser()->profile();
PrefService* prefs = profile->GetPrefs();
EXPECT_TRUE(prefs->GetBoolean(prefs::kForceSafeSearch));
EXPECT_FALSE(prefs->IsUserModifiablePreference(prefs::kForceSafeSearch));
}
-IN_PROC_BROWSER_TEST_F(ManagedUserServiceTestManaged, ProfileName) {
+IN_PROC_BROWSER_TEST_F(SupervisedUserServiceTestSupervised, ProfileName) {
Profile* profile = browser()->profile();
PrefService* prefs = profile->GetPrefs();
std::string original_name = prefs->GetString(prefs::kProfileName);
ProfileManager* profile_manager = g_browser_process->profile_manager();
const ProfileInfoCache& cache = profile_manager->GetProfileInfoCache();
- ManagedUserSettingsService* settings =
- ManagedUserSettingsServiceFactory::GetForProfile(profile);
+ SupervisedUserSettingsService* settings =
+ SupervisedUserSettingsServiceFactory::GetForProfile(profile);
- std::string name = "Managed User Test Name";
+ std::string name = "Supervised User Test Name";
settings->SetLocalSettingForTesting(
- managed_users::kUserName,
+ supervised_users::kUserName,
scoped_ptr<base::Value>(new base::StringValue(name)));
EXPECT_FALSE(prefs->IsUserModifiablePreference(prefs::kProfileName));
EXPECT_EQ(name, prefs->GetString(prefs::kProfileName));
@@ -125,9 +126,9 @@ IN_PROC_BROWSER_TEST_F(ManagedUserServiceTestManaged, ProfileName) {
base::UTF16ToUTF8(cache.GetNameOfProfileAtIndex(profile_index)));
// Change the name once more.
- std::string new_name = "New Managed User Test Name";
+ std::string new_name = "New Supervised User Test Name";
settings->SetLocalSettingForTesting(
- managed_users::kUserName,
+ supervised_users::kUserName,
scoped_ptr<base::Value>(new base::StringValue(new_name)));
EXPECT_EQ(new_name, prefs->GetString(prefs::kProfileName));
profile_index = cache.GetIndexOfProfileWithPath(profile->GetPath());
@@ -135,7 +136,7 @@ IN_PROC_BROWSER_TEST_F(ManagedUserServiceTestManaged, ProfileName) {
base::UTF16ToUTF8(cache.GetNameOfProfileAtIndex(profile_index)));
// Remove the setting.
- settings->SetLocalSettingForTesting(managed_users::kUserName,
+ settings->SetLocalSettingForTesting(supervised_users::kUserName,
scoped_ptr<base::Value>());
EXPECT_EQ(original_name, prefs->GetString(prefs::kProfileName));
profile_index = cache.GetIndexOfProfileWithPath(profile->GetPath());

Powered by Google App Engine
This is Rietveld 408576698