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 82c877680f61c79c82fc493bfb5e3ebc51a78529..5ac913c4cfaacf0281364feef1b04fe2e10b7eb0 100644 |
--- a/chrome/browser/chromeos/policy/recommendation_restorer_unittest.cc |
+++ b/chrome/browser/chromeos/policy/recommendation_restorer_unittest.cc |
@@ -42,6 +42,7 @@ class RecommendationRestorerTest : public testing::Test { |
// testing::Test: |
virtual void SetUp() OVERRIDE; |
+ virtual void TearDown() OVERRIDE; |
void RegisterUserProfilePrefs(); |
void RegisterLoginProfilePrefs(); |
@@ -55,11 +56,25 @@ class RecommendationRestorerTest : public testing::Test { |
void NotifyOfSessionStart(); |
void NotifyOfUserActivity(); |
- void VerifyPrefFollowsUser(const char* pref_name, |
- const base::Value& expected_value) const; |
+ void SetGlobalRecommendedValue(const char* pref_name, |
+ base::Value* expected_value); |
+ |
+ void VerifyUserPrefFollowsUser(const char* pref_name, |
+ const base::Value& expected_value) const; |
+ void VerifyGlobalPrefFollowsUser(const char* pref_name, |
+ const base::Value& expected_value) const; |
+ void VerifyPrefFollowsUserInternal( |
+ const PrefServiceSyncable::Preference* pref, |
+ const base::Value& expected_value) const; |
void VerifyPrefsFollowUser() const; |
- void VerifyPrefFollowsRecommendation(const char* pref_name, |
+ |
+ void VerifyUserPrefFollowsRecommendation(const char* pref_name, |
const base::Value& expected_value) const; |
+ void VerifyGlobalPrefFollowsRecommendation(const char* pref_name, |
+ const base::Value& expected_value) const; |
+ void VerifyPrefFollowsRecommendationInternal( |
+ const PrefServiceSyncable::Preference* pref, |
+ const base::Value& expected_value) const; |
void VerifyPrefsFollowRecommendations() const; |
void VerifyNotListeningForNotifications() const; |
@@ -76,6 +91,7 @@ class RecommendationRestorerTest : public testing::Test { |
private: |
scoped_ptr<PrefServiceSyncable> prefs_owner_; |
+ TestingProfile* profile_; |
TestingProfileManager profile_manager_; |
DISALLOW_COPY_AND_ASSIGN(RecommendationRestorerTest); |
@@ -93,6 +109,7 @@ RecommendationRestorerTest::RecommendationRestorerTest() |
runner_(new base::TestSimpleTaskRunner), |
runner_handler_(runner_), |
prefs_owner_(prefs_), |
+ profile_(NULL), |
profile_manager_(TestingBrowserProcess::GetGlobal()) { |
} |
@@ -101,6 +118,11 @@ void RecommendationRestorerTest::SetUp() { |
ASSERT_TRUE(profile_manager_.SetUp()); |
} |
+void RecommendationRestorerTest::TearDown() { |
+ RecommendationRestorerFactory::GetInstance()->SetTestingFactory( |
+ profile_, NULL); |
+} |
+ |
void RecommendationRestorerTest::RegisterUserProfilePrefs() { |
chrome::RegisterUserProfilePrefs(prefs_->registry()); |
} |
@@ -109,17 +131,27 @@ void RecommendationRestorerTest::RegisterLoginProfilePrefs() { |
chrome::RegisterLoginProfilePrefs(prefs_->registry()); |
} |
+void RecommendationRestorerTest::SetGlobalRecommendedValue( |
+ const char* pref_name, |
+ base::Value* recommended_value) { |
+ static_cast<TestingPrefServiceSimple*>( |
+ g_browser_process->local_state())->SetRecommendedPref(pref_name, |
+ recommended_value); |
+} |
+ |
void RecommendationRestorerTest::SetRecommendedValues() { |
+ SetGlobalRecommendedValue(prefs::kSpokenFeedbackEnabled, |
+ base::Value::CreateBooleanValue(false)); |
recommended_prefs_->SetBoolean(prefs::kLargeCursorEnabled, false); |
- recommended_prefs_->SetBoolean(prefs::kSpokenFeedbackEnabled, false); |
recommended_prefs_->SetBoolean(prefs::kHighContrastEnabled, false); |
recommended_prefs_->SetBoolean(prefs::kScreenMagnifierEnabled, false); |
recommended_prefs_->SetInteger(prefs::kScreenMagnifierType, 0); |
} |
void RecommendationRestorerTest::SetUserSettings() { |
+ g_browser_process->local_state()->SetBoolean(prefs::kSpokenFeedbackEnabled, |
+ true); |
prefs_->SetBoolean(prefs::kLargeCursorEnabled, true); |
- prefs_->SetBoolean(prefs::kSpokenFeedbackEnabled, true); |
prefs_->SetBoolean(prefs::kHighContrastEnabled, true); |
prefs_->SetBoolean(prefs::kScreenMagnifierEnabled, true); |
prefs_->SetInteger(prefs::kScreenMagnifierType, ash::MAGNIFIER_FULL); |
@@ -127,20 +159,20 @@ void RecommendationRestorerTest::SetUserSettings() { |
void RecommendationRestorerTest::CreateLoginProfile() { |
ASSERT_FALSE(restorer_); |
- TestingProfile* profile = profile_manager_.CreateTestingProfile( |
+ profile_ = profile_manager_.CreateTestingProfile( |
chrome::kInitialProfile, prefs_owner_.Pass(), |
base::UTF8ToUTF16(chrome::kInitialProfile), 0, std::string(), |
TestingProfile::TestingFactories()); |
- restorer_ = RecommendationRestorerFactory::GetForProfile(profile); |
+ restorer_ = RecommendationRestorerFactory::GetForProfile(profile_); |
EXPECT_TRUE(restorer_); |
} |
void RecommendationRestorerTest::CreateUserProfile() { |
ASSERT_FALSE(restorer_); |
- TestingProfile* profile = profile_manager_.CreateTestingProfile( |
+ profile_ = profile_manager_.CreateTestingProfile( |
"user", prefs_owner_.Pass(), base::UTF8ToUTF16("user"), 0, std::string(), |
TestingProfile::TestingFactories()); |
- restorer_ = RecommendationRestorerFactory::GetForProfile(profile); |
+ restorer_ = RecommendationRestorerFactory::GetForProfile(profile_); |
EXPECT_TRUE(restorer_); |
} |
@@ -156,12 +188,27 @@ void RecommendationRestorerTest::NotifyOfUserActivity() { |
restorer_->OnUserActivity(NULL); |
} |
-void RecommendationRestorerTest::VerifyPrefFollowsUser( |
+void RecommendationRestorerTest::VerifyUserPrefFollowsUser( |
const char* pref_name, |
const base::Value& expected_value) const { |
const PrefServiceSyncable::Preference* pref = |
prefs_->FindPreference(pref_name); |
ASSERT_TRUE(pref); |
+ VerifyPrefFollowsUserInternal(pref, expected_value); |
+} |
+ |
+void RecommendationRestorerTest::VerifyGlobalPrefFollowsUser( |
+ const char* pref_name, |
+ const base::Value& expected_value) const { |
+ const PrefServiceSyncable::Preference* pref = |
+ g_browser_process->local_state()->FindPreference(pref_name); |
+ ASSERT_TRUE(pref); |
+ VerifyPrefFollowsUserInternal(pref, expected_value); |
+} |
+ |
+void RecommendationRestorerTest::VerifyPrefFollowsUserInternal( |
+ const PrefServiceSyncable::Preference* pref, |
+ const base::Value& expected_value) const { |
EXPECT_TRUE(pref->HasUserSetting()); |
const base::Value* value = pref->GetValue(); |
ASSERT_TRUE(value); |
@@ -169,24 +216,39 @@ void RecommendationRestorerTest::VerifyPrefFollowsUser( |
} |
void RecommendationRestorerTest::VerifyPrefsFollowUser() const { |
- VerifyPrefFollowsUser(prefs::kLargeCursorEnabled, |
- base::FundamentalValue(true)); |
- VerifyPrefFollowsUser(prefs::kSpokenFeedbackEnabled, |
- base::FundamentalValue(true)); |
- VerifyPrefFollowsUser(prefs::kHighContrastEnabled, |
- base::FundamentalValue(true)); |
- VerifyPrefFollowsUser(prefs::kScreenMagnifierEnabled, |
- base::FundamentalValue(true)); |
- VerifyPrefFollowsUser(prefs::kScreenMagnifierType, |
- base::FundamentalValue(ash::MAGNIFIER_FULL)); |
-} |
- |
-void RecommendationRestorerTest::VerifyPrefFollowsRecommendation( |
+ VerifyGlobalPrefFollowsUser(prefs::kSpokenFeedbackEnabled, |
+ base::FundamentalValue(true)); |
+ VerifyUserPrefFollowsUser(prefs::kLargeCursorEnabled, |
+ base::FundamentalValue(true)); |
+ VerifyUserPrefFollowsUser(prefs::kHighContrastEnabled, |
+ base::FundamentalValue(true)); |
+ VerifyUserPrefFollowsUser(prefs::kScreenMagnifierEnabled, |
+ base::FundamentalValue(true)); |
+ VerifyUserPrefFollowsUser(prefs::kScreenMagnifierType, |
+ base::FundamentalValue(ash::MAGNIFIER_FULL)); |
+} |
+ |
+void RecommendationRestorerTest::VerifyUserPrefFollowsRecommendation( |
const char* pref_name, |
const base::Value& expected_value) const { |
const PrefServiceSyncable::Preference* pref = |
prefs_->FindPreference(pref_name); |
ASSERT_TRUE(pref); |
+ VerifyPrefFollowsRecommendationInternal(pref, expected_value); |
+} |
+ |
+void RecommendationRestorerTest::VerifyGlobalPrefFollowsRecommendation( |
+ const char* pref_name, |
+ const base::Value& expected_value) const { |
+ const PrefServiceSyncable::Preference* pref = |
+ g_browser_process->local_state()->FindPreference(pref_name); |
+ ASSERT_TRUE(pref); |
+ VerifyPrefFollowsRecommendationInternal(pref, expected_value); |
+} |
+ |
+void RecommendationRestorerTest::VerifyPrefFollowsRecommendationInternal( |
+ const PrefServiceSyncable::Preference* pref, |
+ const base::Value& expected_value) const { |
EXPECT_TRUE(pref->IsRecommended()); |
EXPECT_FALSE(pref->HasUserSetting()); |
const base::Value* value = pref->GetValue(); |
@@ -195,16 +257,16 @@ void RecommendationRestorerTest::VerifyPrefFollowsRecommendation( |
} |
void RecommendationRestorerTest::VerifyPrefsFollowRecommendations() const { |
- VerifyPrefFollowsRecommendation(prefs::kLargeCursorEnabled, |
- base::FundamentalValue(false)); |
- VerifyPrefFollowsRecommendation(prefs::kSpokenFeedbackEnabled, |
- base::FundamentalValue(false)); |
- VerifyPrefFollowsRecommendation(prefs::kHighContrastEnabled, |
- base::FundamentalValue(false)); |
- VerifyPrefFollowsRecommendation(prefs::kScreenMagnifierEnabled, |
- base::FundamentalValue(false)); |
- VerifyPrefFollowsRecommendation(prefs::kScreenMagnifierType, |
- base::FundamentalValue(0)); |
+ VerifyUserPrefFollowsRecommendation(prefs::kLargeCursorEnabled, |
+ base::FundamentalValue(false)); |
+ VerifyGlobalPrefFollowsRecommendation(prefs::kSpokenFeedbackEnabled, |
+ base::FundamentalValue(false)); |
+ VerifyUserPrefFollowsRecommendation(prefs::kHighContrastEnabled, |
+ base::FundamentalValue(false)); |
+ VerifyUserPrefFollowsRecommendation(prefs::kScreenMagnifierEnabled, |
+ base::FundamentalValue(false)); |
+ VerifyUserPrefFollowsRecommendation(prefs::kScreenMagnifierType, |
+ base::FundamentalValue(0)); |
} |
void RecommendationRestorerTest::VerifyNotListeningForNotifications() const { |
@@ -276,44 +338,45 @@ TEST_F(RecommendationRestorerTest, RestoreOnRecommendationChangeOnLoginScreen) { |
VerifyTimerIsStopped(); |
recommended_prefs_->SetBoolean(prefs::kLargeCursorEnabled, false); |
- VerifyPrefFollowsUser(prefs::kLargeCursorEnabled, |
- base::FundamentalValue(true)); |
+ VerifyUserPrefFollowsUser(prefs::kLargeCursorEnabled, |
+ base::FundamentalValue(true)); |
VerifyTimerIsRunning(); |
runner_->RunUntilIdle(); |
- VerifyPrefFollowsRecommendation(prefs::kLargeCursorEnabled, |
- base::FundamentalValue(false)); |
+ VerifyUserPrefFollowsRecommendation(prefs::kLargeCursorEnabled, |
+ base::FundamentalValue(false)); |
VerifyTimerIsStopped(); |
- recommended_prefs_->SetBoolean(prefs::kSpokenFeedbackEnabled, false); |
- VerifyPrefFollowsUser(prefs::kSpokenFeedbackEnabled, |
- base::FundamentalValue(true)); |
+ SetGlobalRecommendedValue(prefs::kSpokenFeedbackEnabled, |
+ base::Value::CreateBooleanValue(false)); |
+ VerifyGlobalPrefFollowsUser(prefs::kSpokenFeedbackEnabled, |
+ base::FundamentalValue(true)); |
VerifyTimerIsRunning(); |
runner_->RunUntilIdle(); |
- VerifyPrefFollowsRecommendation(prefs::kSpokenFeedbackEnabled, |
- base::FundamentalValue(false)); |
+ VerifyGlobalPrefFollowsRecommendation(prefs::kSpokenFeedbackEnabled, |
+ base::FundamentalValue(false)); |
VerifyTimerIsStopped(); |
recommended_prefs_->SetBoolean(prefs::kHighContrastEnabled, false); |
- VerifyPrefFollowsUser(prefs::kHighContrastEnabled, |
- base::FundamentalValue(true)); |
+ VerifyUserPrefFollowsUser(prefs::kHighContrastEnabled, |
+ base::FundamentalValue(true)); |
VerifyTimerIsRunning(); |
runner_->RunUntilIdle(); |
- VerifyPrefFollowsRecommendation(prefs::kHighContrastEnabled, |
- base::FundamentalValue(false)); |
+ VerifyUserPrefFollowsRecommendation(prefs::kHighContrastEnabled, |
+ base::FundamentalValue(false)); |
VerifyTimerIsStopped(); |
recommended_prefs_->SetBoolean(prefs::kScreenMagnifierEnabled, false); |
recommended_prefs_->SetInteger(prefs::kScreenMagnifierType, 0); |
- VerifyPrefFollowsUser(prefs::kScreenMagnifierEnabled, |
- base::FundamentalValue(true)); |
- VerifyPrefFollowsUser(prefs::kScreenMagnifierType, |
- base::FundamentalValue(ash::MAGNIFIER_FULL)); |
+ VerifyUserPrefFollowsUser(prefs::kScreenMagnifierEnabled, |
+ base::FundamentalValue(true)); |
+ VerifyUserPrefFollowsUser(prefs::kScreenMagnifierType, |
+ base::FundamentalValue(ash::MAGNIFIER_FULL)); |
VerifyTimerIsRunning(); |
runner_->RunUntilIdle(); |
- VerifyPrefFollowsRecommendation(prefs::kScreenMagnifierEnabled, |
- base::FundamentalValue(false)); |
- VerifyPrefFollowsRecommendation(prefs::kScreenMagnifierType, |
- base::FundamentalValue(0)); |
+ VerifyUserPrefFollowsRecommendation(prefs::kScreenMagnifierEnabled, |
+ base::FundamentalValue(false)); |
+ VerifyUserPrefFollowsRecommendation(prefs::kScreenMagnifierType, |
+ base::FundamentalValue(0)); |
VerifyTimerIsStopped(); |
} |
@@ -327,38 +390,39 @@ TEST_F(RecommendationRestorerTest, RestoreOnRecommendationChangeInUserSession) { |
CreateLoginProfile(); |
NotifyOfSessionStart(); |
- VerifyPrefFollowsUser(prefs::kLargeCursorEnabled, |
- base::FundamentalValue(true)); |
+ VerifyUserPrefFollowsUser(prefs::kLargeCursorEnabled, |
+ base::FundamentalValue(true)); |
recommended_prefs_->SetBoolean(prefs::kLargeCursorEnabled, false); |
VerifyTimerIsStopped(); |
- VerifyPrefFollowsRecommendation(prefs::kLargeCursorEnabled, |
- base::FundamentalValue(false)); |
+ VerifyUserPrefFollowsRecommendation(prefs::kLargeCursorEnabled, |
+ base::FundamentalValue(false)); |
- VerifyPrefFollowsUser(prefs::kSpokenFeedbackEnabled, |
- base::FundamentalValue(true)); |
- recommended_prefs_->SetBoolean(prefs::kSpokenFeedbackEnabled, false); |
+ VerifyGlobalPrefFollowsUser(prefs::kSpokenFeedbackEnabled, |
+ base::FundamentalValue(true)); |
+ SetGlobalRecommendedValue(prefs::kSpokenFeedbackEnabled, |
+ base::Value::CreateBooleanValue(false)); |
VerifyTimerIsStopped(); |
- VerifyPrefFollowsRecommendation(prefs::kSpokenFeedbackEnabled, |
- base::FundamentalValue(false)); |
+ VerifyGlobalPrefFollowsRecommendation(prefs::kSpokenFeedbackEnabled, |
+ base::FundamentalValue(false)); |
- VerifyPrefFollowsUser(prefs::kHighContrastEnabled, |
- base::FundamentalValue(true)); |
- recommended_prefs_->SetBoolean(prefs::kHighContrastEnabled, false); |
+ VerifyUserPrefFollowsUser(prefs::kHighContrastEnabled, |
+ base::FundamentalValue(true)); |
+ recommended_prefs_->SetBoolean(prefs::kHighContrastEnabled, false); |
VerifyTimerIsStopped(); |
- VerifyPrefFollowsRecommendation(prefs::kHighContrastEnabled, |
- base::FundamentalValue(false)); |
+ VerifyUserPrefFollowsRecommendation(prefs::kHighContrastEnabled, |
+ base::FundamentalValue(false)); |
- VerifyPrefFollowsUser(prefs::kScreenMagnifierEnabled, |
- base::FundamentalValue(true)); |
- VerifyPrefFollowsUser(prefs::kScreenMagnifierType, |
- base::FundamentalValue(ash::MAGNIFIER_FULL)); |
+ VerifyUserPrefFollowsUser(prefs::kScreenMagnifierEnabled, |
+ base::FundamentalValue(true)); |
+ VerifyUserPrefFollowsUser(prefs::kScreenMagnifierType, |
+ base::FundamentalValue(ash::MAGNIFIER_FULL)); |
recommended_prefs_->SetBoolean(prefs::kScreenMagnifierEnabled, false); |
recommended_prefs_->SetInteger(prefs::kScreenMagnifierType, 0); |
VerifyTimerIsStopped(); |
- VerifyPrefFollowsRecommendation(prefs::kScreenMagnifierEnabled, |
- base::FundamentalValue(false)); |
- VerifyPrefFollowsRecommendation(prefs::kScreenMagnifierType, |
- base::FundamentalValue(0)); |
+ VerifyUserPrefFollowsRecommendation(prefs::kScreenMagnifierEnabled, |
+ base::FundamentalValue(false)); |
+ VerifyUserPrefFollowsRecommendation(prefs::kScreenMagnifierType, |
+ base::FundamentalValue(0)); |
} |
TEST_F(RecommendationRestorerTest, DoNothingOnUserChange) { |
@@ -369,31 +433,32 @@ TEST_F(RecommendationRestorerTest, DoNothingOnUserChange) { |
CreateLoginProfile(); |
prefs_->SetBoolean(prefs::kLargeCursorEnabled, true); |
- VerifyPrefFollowsUser(prefs::kLargeCursorEnabled, |
- base::FundamentalValue(true)); |
+ VerifyUserPrefFollowsUser(prefs::kLargeCursorEnabled, |
+ base::FundamentalValue(true)); |
VerifyTimerIsStopped(); |
- prefs_->SetBoolean(prefs::kSpokenFeedbackEnabled, true); |
- VerifyPrefFollowsUser(prefs::kSpokenFeedbackEnabled, |
- base::FundamentalValue(true)); |
+ g_browser_process->local_state()->SetBoolean(prefs::kSpokenFeedbackEnabled, |
+ true); |
+ VerifyGlobalPrefFollowsUser(prefs::kSpokenFeedbackEnabled, |
+ base::FundamentalValue(true)); |
VerifyTimerIsStopped(); |
prefs_->SetBoolean(prefs::kHighContrastEnabled, true); |
- VerifyPrefFollowsUser(prefs::kHighContrastEnabled, |
- base::FundamentalValue(true)); |
+ VerifyUserPrefFollowsUser(prefs::kHighContrastEnabled, |
+ base::FundamentalValue(true)); |
VerifyTimerIsStopped(); |
prefs_->SetBoolean(prefs::kScreenMagnifierEnabled, true); |
- VerifyPrefFollowsUser(prefs::kScreenMagnifierEnabled, |
- base::FundamentalValue(true)); |
+ VerifyUserPrefFollowsUser(prefs::kScreenMagnifierEnabled, |
+ base::FundamentalValue(true)); |
VerifyTimerIsStopped(); |
prefs_->SetBoolean(prefs::kScreenMagnifierEnabled, true); |
prefs_->SetInteger(prefs::kScreenMagnifierType, ash::MAGNIFIER_FULL); |
- VerifyPrefFollowsUser(prefs::kScreenMagnifierEnabled, |
- base::FundamentalValue(true)); |
- VerifyPrefFollowsUser(prefs::kScreenMagnifierType, |
- base::FundamentalValue(ash::MAGNIFIER_FULL)); |
+ VerifyUserPrefFollowsUser(prefs::kScreenMagnifierEnabled, |
+ base::FundamentalValue(true)); |
+ VerifyUserPrefFollowsUser(prefs::kScreenMagnifierType, |
+ base::FundamentalValue(ash::MAGNIFIER_FULL)); |
VerifyTimerIsStopped(); |
} |
@@ -408,44 +473,45 @@ TEST_F(RecommendationRestorerTest, RestoreOnUserChange) { |
VerifyTimerIsStopped(); |
prefs_->SetBoolean(prefs::kLargeCursorEnabled, true); |
- VerifyPrefFollowsUser(prefs::kLargeCursorEnabled, |
- base::FundamentalValue(true)); |
+ VerifyUserPrefFollowsUser(prefs::kLargeCursorEnabled, |
+ base::FundamentalValue(true)); |
VerifyTimerIsRunning(); |
runner_->RunUntilIdle(); |
- VerifyPrefFollowsRecommendation(prefs::kLargeCursorEnabled, |
- base::FundamentalValue(false)); |
+ VerifyUserPrefFollowsRecommendation(prefs::kLargeCursorEnabled, |
+ base::FundamentalValue(false)); |
VerifyTimerIsStopped(); |
- prefs_->SetBoolean(prefs::kSpokenFeedbackEnabled, true); |
- VerifyPrefFollowsUser(prefs::kSpokenFeedbackEnabled, |
- base::FundamentalValue(true)); |
+ g_browser_process->local_state()->SetBoolean(prefs::kSpokenFeedbackEnabled, |
+ true); |
+ VerifyGlobalPrefFollowsUser(prefs::kSpokenFeedbackEnabled, |
+ base::FundamentalValue(true)); |
VerifyTimerIsRunning(); |
runner_->RunUntilIdle(); |
- VerifyPrefFollowsRecommendation(prefs::kSpokenFeedbackEnabled, |
- base::FundamentalValue(false)); |
+ VerifyGlobalPrefFollowsRecommendation(prefs::kSpokenFeedbackEnabled, |
+ base::FundamentalValue(false)); |
VerifyTimerIsStopped(); |
prefs_->SetBoolean(prefs::kHighContrastEnabled, true); |
- VerifyPrefFollowsUser(prefs::kHighContrastEnabled, |
- base::FundamentalValue(true)); |
+ VerifyUserPrefFollowsUser(prefs::kHighContrastEnabled, |
+ base::FundamentalValue(true)); |
VerifyTimerIsRunning(); |
runner_->RunUntilIdle(); |
- VerifyPrefFollowsRecommendation(prefs::kHighContrastEnabled, |
- base::FundamentalValue(false)); |
+ VerifyUserPrefFollowsRecommendation(prefs::kHighContrastEnabled, |
+ base::FundamentalValue(false)); |
VerifyTimerIsStopped(); |
prefs_->SetBoolean(prefs::kScreenMagnifierEnabled, true); |
prefs_->SetInteger(prefs::kScreenMagnifierType, ash::MAGNIFIER_FULL); |
- VerifyPrefFollowsUser(prefs::kScreenMagnifierEnabled, |
- base::FundamentalValue(true)); |
- VerifyPrefFollowsUser(prefs::kScreenMagnifierType, |
- base::FundamentalValue(ash::MAGNIFIER_FULL)); |
+ VerifyUserPrefFollowsUser(prefs::kScreenMagnifierEnabled, |
+ base::FundamentalValue(true)); |
+ VerifyUserPrefFollowsUser(prefs::kScreenMagnifierType, |
+ base::FundamentalValue(ash::MAGNIFIER_FULL)); |
VerifyTimerIsRunning(); |
runner_->RunUntilIdle(); |
- VerifyPrefFollowsRecommendation(prefs::kScreenMagnifierEnabled, |
- base::FundamentalValue(false)); |
- VerifyPrefFollowsRecommendation(prefs::kScreenMagnifierType, |
- base::FundamentalValue(0)); |
+ VerifyUserPrefFollowsRecommendation(prefs::kScreenMagnifierEnabled, |
+ base::FundamentalValue(false)); |
+ VerifyUserPrefFollowsRecommendation(prefs::kScreenMagnifierType, |
+ base::FundamentalValue(0)); |
VerifyTimerIsStopped(); |
} |
@@ -494,14 +560,14 @@ TEST_F(RecommendationRestorerTest, UserActivityResetsTimer) { |
// set timer fires. |
NotifyOfUserActivity(); |
runner_->RunPendingTasks(); |
- VerifyPrefFollowsUser(prefs::kLargeCursorEnabled, |
- base::FundamentalValue(true)); |
+ VerifyUserPrefFollowsUser(prefs::kLargeCursorEnabled, |
+ base::FundamentalValue(true)); |
// Fast forward until the reset timer fires. |
VerifyTimerIsRunning(); |
runner_->RunUntilIdle(); |
- VerifyPrefFollowsRecommendation(prefs::kLargeCursorEnabled, |
- base::FundamentalValue(false)); |
+ VerifyUserPrefFollowsRecommendation(prefs::kLargeCursorEnabled, |
+ base::FundamentalValue(false)); |
VerifyTimerIsStopped(); |
} |