OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/policy/recommendation_restorer.h" | 5 #include "chrome/browser/chromeos/policy/recommendation_restorer.h" |
6 | 6 |
7 #include "ash/magnifier/magnifier_constants.h" | 7 #include "ash/magnifier/magnifier_constants.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/prefs/pref_notifier_impl.h" | 9 #include "base/prefs/pref_notifier_impl.h" |
10 #include "base/prefs/testing_pref_store.h" | 10 #include "base/prefs/testing_pref_store.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 prefs_->SetBoolean(prefs::kSpokenFeedbackEnabled, true); | 122 prefs_->SetBoolean(prefs::kSpokenFeedbackEnabled, true); |
123 prefs_->SetBoolean(prefs::kHighContrastEnabled, true); | 123 prefs_->SetBoolean(prefs::kHighContrastEnabled, true); |
124 prefs_->SetBoolean(prefs::kScreenMagnifierEnabled, true); | 124 prefs_->SetBoolean(prefs::kScreenMagnifierEnabled, true); |
125 prefs_->SetInteger(prefs::kScreenMagnifierType, ash::MAGNIFIER_FULL); | 125 prefs_->SetInteger(prefs::kScreenMagnifierType, ash::MAGNIFIER_FULL); |
126 } | 126 } |
127 | 127 |
128 void RecommendationRestorerTest::CreateLoginProfile() { | 128 void RecommendationRestorerTest::CreateLoginProfile() { |
129 ASSERT_FALSE(restorer_); | 129 ASSERT_FALSE(restorer_); |
130 TestingProfile* profile = profile_manager_.CreateTestingProfile( | 130 TestingProfile* profile = profile_manager_.CreateTestingProfile( |
131 chrome::kInitialProfile, prefs_owner_.Pass(), | 131 chrome::kInitialProfile, prefs_owner_.Pass(), |
132 UTF8ToUTF16(chrome::kInitialProfile), 0, std::string()); | 132 UTF8ToUTF16(chrome::kInitialProfile), 0, std::string(), |
| 133 TestingProfile::TestingFactories()); |
133 restorer_ = RecommendationRestorerFactory::GetForProfile(profile); | 134 restorer_ = RecommendationRestorerFactory::GetForProfile(profile); |
134 EXPECT_TRUE(restorer_); | 135 EXPECT_TRUE(restorer_); |
135 } | 136 } |
136 | 137 |
137 void RecommendationRestorerTest::CreateUserProfile() { | 138 void RecommendationRestorerTest::CreateUserProfile() { |
138 ASSERT_FALSE(restorer_); | 139 ASSERT_FALSE(restorer_); |
139 TestingProfile* profile = profile_manager_.CreateTestingProfile( | 140 TestingProfile* profile = profile_manager_.CreateTestingProfile( |
140 "user", prefs_owner_.Pass(), UTF8ToUTF16("user"), 0, std::string()); | 141 "user", prefs_owner_.Pass(), UTF8ToUTF16("user"), 0, std::string(), |
| 142 TestingProfile::TestingFactories()); |
141 restorer_ = RecommendationRestorerFactory::GetForProfile(profile); | 143 restorer_ = RecommendationRestorerFactory::GetForProfile(profile); |
142 EXPECT_TRUE(restorer_); | 144 EXPECT_TRUE(restorer_); |
143 } | 145 } |
144 | 146 |
145 void RecommendationRestorerTest::NotifyOfSessionStart() { | 147 void RecommendationRestorerTest::NotifyOfSessionStart() { |
146 ASSERT_TRUE(restorer_); | 148 ASSERT_TRUE(restorer_); |
147 restorer_->Observe(chrome::NOTIFICATION_LOGIN_USER_CHANGED, | 149 restorer_->Observe(chrome::NOTIFICATION_LOGIN_USER_CHANGED, |
148 content::Source<RecommendationRestorerTest>(this), | 150 content::Source<RecommendationRestorerTest>(this), |
149 content::NotificationService::NoDetails()); | 151 content::NotificationService::NoDetails()); |
150 } | 152 } |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 | 499 |
498 // Fast forward until the reset timer fires. | 500 // Fast forward until the reset timer fires. |
499 VerifyTimerIsRunning(); | 501 VerifyTimerIsRunning(); |
500 runner_->RunUntilIdle(); | 502 runner_->RunUntilIdle(); |
501 VerifyPrefFollowsRecommendation(prefs::kLargeCursorEnabled, | 503 VerifyPrefFollowsRecommendation(prefs::kLargeCursorEnabled, |
502 base::FundamentalValue(false)); | 504 base::FundamentalValue(false)); |
503 VerifyTimerIsStopped(); | 505 VerifyTimerIsStopped(); |
504 } | 506 } |
505 | 507 |
506 } // namespace policy | 508 } // namespace policy |
OLD | NEW |