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

Unified Diff: chrome/browser/chromeos/policy/recommendation_restorer_unittest.cc

Issue 18199003: Allow Chrome OS login profile to have different default pref values (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 years, 5 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/chromeos/login/oauth2_login_manager.cc ('k') | chrome/browser/chromeos/preferences.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/policy/recommendation_restorer_unittest.cc
diff --git a/chrome/browser/chromeos/policy/recommendation_restorer_unittest.cc b/chrome/browser/chromeos/policy/recommendation_restorer_unittest.cc
index c5d5b3aad3e319b368d7cc6705c1cd589e9c797a..13c0e8c24faaad82f5d46cc4a4045f8d2064ba8e 100644
--- a/chrome/browser/chromeos/policy/recommendation_restorer_unittest.cc
+++ b/chrome/browser/chromeos/policy/recommendation_restorer_unittest.cc
@@ -43,6 +43,9 @@ class RecommendationRestorerTest : public testing::Test {
// testing::Test:
virtual void SetUp() OVERRIDE;
+ void RegisterUserProfilePrefs();
+ void RegisterLoginProfilePrefs();
+
void SetRecommendedValues();
void SetUserSettings();
@@ -91,7 +94,6 @@ RecommendationRestorerTest::RecommendationRestorerTest()
runner_handler_(runner_),
prefs_owner_(prefs_),
profile_manager_(TestingBrowserProcess::GetGlobal()) {
- chrome::RegisterUserPrefs(prefs_->registry());
}
void RecommendationRestorerTest::SetUp() {
@@ -99,6 +101,14 @@ void RecommendationRestorerTest::SetUp() {
ASSERT_TRUE(profile_manager_.SetUp());
}
+void RecommendationRestorerTest::RegisterUserProfilePrefs() {
+ chrome::RegisterUserProfilePrefs(prefs_->registry());
+}
+
+void RecommendationRestorerTest::RegisterLoginProfilePrefs() {
+ chrome::RegisterLoginProfilePrefs(prefs_->registry());
+}
+
void RecommendationRestorerTest::SetRecommendedValues() {
recommended_prefs_->SetBoolean(prefs::kLargeCursorEnabled, false);
recommended_prefs_->SetBoolean(prefs::kSpokenFeedbackEnabled, false);
@@ -218,6 +228,7 @@ TEST_F(RecommendationRestorerTest, CreateForUserProfile) {
// it does not start listening for any notifications, does not clear user
// settings on initialization and does not start a timer that will clear user
// settings eventually.
+ RegisterUserProfilePrefs();
SetRecommendedValues();
SetUserSettings();
@@ -232,6 +243,7 @@ TEST_F(RecommendationRestorerTest, NoRecommendations) {
// RecommendationRestorer is created for the login profile, it does not clear
// user settings on initialization and does not start a timer that will clear
// user settings eventually.
+ RegisterLoginProfilePrefs();
SetUserSettings();
CreateLoginProfile();
@@ -243,6 +255,7 @@ TEST_F(RecommendationRestorerTest, RestoreOnStartup) {
// Verifies that when recommended values have been set and a
// RecommendationRestorer is created for the login profile, it clears user
// settings on initialization.
+ RegisterLoginProfilePrefs();
SetRecommendedValues();
SetUserSettings();
@@ -254,6 +267,7 @@ TEST_F(RecommendationRestorerTest, RestoreOnStartup) {
TEST_F(RecommendationRestorerTest, RestoreOnRecommendationChangeOnLoginScreen) {
// Verifies that if recommended values change while the login screen is being
// shown, a timer is started that will clear user settings eventually.
+ RegisterLoginProfilePrefs();
SetUserSettings();
CreateLoginProfile();
@@ -305,6 +319,7 @@ TEST_F(RecommendationRestorerTest, RestoreOnRecommendationChangeOnLoginScreen) {
TEST_F(RecommendationRestorerTest, RestoreOnRecommendationChangeInUserSession) {
// Verifies that if recommended values change while a user session is in
// progress, user settings are cleared immediately.
+ RegisterLoginProfilePrefs();
SetUserSettings();
CreateLoginProfile();
@@ -348,6 +363,7 @@ TEST_F(RecommendationRestorerTest, DoNothingOnUserChange) {
// Verifies that if no recommended values have been set and user settings
// change, the user settings are not cleared immediately and no timer is
// started that will clear the user settings eventually.
+ RegisterLoginProfilePrefs();
CreateLoginProfile();
prefs_->SetBoolean(prefs::kLargeCursorEnabled, true);
@@ -383,6 +399,7 @@ TEST_F(RecommendationRestorerTest, RestoreOnUserChange) {
// Verifies that if recommended values have been set and user settings change
// while the login screen is being shown, a timer is started that will clear
// the user settings eventually.
+ RegisterLoginProfilePrefs();
SetRecommendedValues();
CreateLoginProfile();
@@ -436,6 +453,7 @@ TEST_F(RecommendationRestorerTest, RestoreOnSessionStart) {
// changed and a session is then started, the user settings are cleared
// immediately and the timer that would have cleared them eventually on the
// login screen is stopped.
+ RegisterLoginProfilePrefs();
SetRecommendedValues();
CreateLoginProfile();
@@ -450,6 +468,7 @@ TEST_F(RecommendationRestorerTest, DoNothingOnSessionStart) {
// Verifies that if recommended values have not been set, user settings have
// changed and a session is then started, the user settings are not cleared
// immediately.
+ RegisterLoginProfilePrefs();
CreateLoginProfile();
SetUserSettings();
@@ -460,6 +479,8 @@ TEST_F(RecommendationRestorerTest, DoNothingOnSessionStart) {
TEST_F(RecommendationRestorerTest, UserActivityResetsTimer) {
// Verifies that user activity resets the timer which clears user settings.
+ RegisterLoginProfilePrefs();
+
recommended_prefs_->SetBoolean(prefs::kLargeCursorEnabled, false);
CreateLoginProfile();
« no previous file with comments | « chrome/browser/chromeos/login/oauth2_login_manager.cc ('k') | chrome/browser/chromeos/preferences.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698