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

Unified Diff: chrome/browser/prefs/session_startup_pref_unittest.cc

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 8 years 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/prefs/session_startup_pref_unittest.cc
diff --git a/chrome/browser/prefs/session_startup_pref_unittest.cc b/chrome/browser/prefs/session_startup_pref_unittest.cc
index 207cbcf7971a6a9dacec8b4a9d50f748e9c04580..675e3271a24430c23c894e034a215e2bcba357c7 100644
--- a/chrome/browser/prefs/session_startup_pref_unittest.cc
+++ b/chrome/browser/prefs/session_startup_pref_unittest.cc
@@ -16,13 +16,16 @@
class SessionStartupPrefTest : public testing::Test {
public:
virtual void SetUp() {
- pref_service_.reset(new TestingPrefService);
+ pref_service_.reset(new TestingPrefServiceSyncable);
SessionStartupPref::RegisterUserPrefs(pref_service_.get());
- pref_service_->RegisterBooleanPref(prefs::kHomePageIsNewTabPage, true);
+ pref_service_->RegisterBooleanPref(prefs::kHomePageIsNewTabPage,
+ true,
+ PrefServiceSyncable::UNSYNCABLE_PREF);
// Make the tests independent of the Mac startup pref migration (see
// SessionStartupPref::MigrateMacDefaultPrefIfNecessary).
pref_service_->RegisterStringPref(prefs::kProfileCreatedByVersion,
- "22.0.0.0");
+ "22.0.0.0",
+ PrefServiceSyncable::UNSYNCABLE_PREF);
}
bool IsUseLastOpenDefault() {
@@ -34,7 +37,7 @@ class SessionStartupPrefTest : public testing::Test {
#endif
}
- scoped_ptr<TestingPrefService> pref_service_;
+ scoped_ptr<TestingPrefServiceSyncable> pref_service_;
};
TEST_F(SessionStartupPrefTest, URLListIsFixedUp) {
@@ -79,7 +82,8 @@ TEST_F(SessionStartupPrefTest, URLListManagedOverridesUser) {
// (so that, in effect, the default value "Open the homepage" was selected),
// their preferences are migrated on upgrade to m19.
TEST_F(SessionStartupPrefTest, DefaultMigration) {
- pref_service_->RegisterStringPref(prefs::kHomePage, "http://google.com/");
+ pref_service_->RegisterStringPref(prefs::kHomePage, "http://google.com/",
+ PrefServiceSyncable::UNSYNCABLE_PREF);
pref_service_->SetString(prefs::kHomePage, "http://chromium.org/");
pref_service_->SetBoolean(prefs::kHomePageIsNewTabPage, false);
@@ -103,7 +107,8 @@ TEST_F(SessionStartupPrefTest, DefaultMigration) {
// and the NTP is being used for the homepage, their preferences are migrated
// to "Open the New Tab Page" on upgrade to M19.
TEST_F(SessionStartupPrefTest, DefaultMigrationHomepageIsNTP) {
- pref_service_->RegisterStringPref(prefs::kHomePage, "http://google.com/");
+ pref_service_->RegisterStringPref(prefs::kHomePage, "http://google.com/",
+ PrefServiceSyncable::UNSYNCABLE_PREF);
pref_service_->SetString(prefs::kHomePage, "http://chromium.org/");
pref_service_->SetBoolean(prefs::kHomePageIsNewTabPage, true);
@@ -124,7 +129,8 @@ TEST_F(SessionStartupPrefTest, DefaultMigrationHomepageIsNTP) {
// Checks to make sure that if the user had previously selected "Open the
// "homepage", their preferences are migrated on upgrade to M19.
TEST_F(SessionStartupPrefTest, HomePageMigration) {
- pref_service_->RegisterStringPref(prefs::kHomePage, "http://google.com/");
+ pref_service_->RegisterStringPref(prefs::kHomePage, "http://google.com/",
+ PrefServiceSyncable::UNSYNCABLE_PREF);
// By design, it's impossible to set the 'restore on startup' pref to 0
// ("open the homepage") using SessionStartupPref::SetStartupPref(), so set it
@@ -145,7 +151,8 @@ TEST_F(SessionStartupPrefTest, HomePageMigration) {
// "homepage", and the NTP is being used for the homepage, their preferences
// are migrated on upgrade to M19.
TEST_F(SessionStartupPrefTest, HomePageMigrationHomepageIsNTP) {
- pref_service_->RegisterStringPref(prefs::kHomePage, "http://google.com/");
+ pref_service_->RegisterStringPref(prefs::kHomePage, "http://google.com/",
+ PrefServiceSyncable::UNSYNCABLE_PREF);
// By design, it's impossible to set the 'restore on startup' pref to 0
// ("open the homepage") using SessionStartupPref::SetStartupPref(), so set it

Powered by Google App Engine
This is Rietveld 408576698