diff options
author | mnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-21 13:54:08 +0000 |
---|---|---|
committer | mnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-21 13:54:08 +0000 |
commit | 74379bc51320fd98a47c98053a056b4ddd7271a7 (patch) | |
tree | 721fb4cbad36a304162745d8a0a5ee0930f054f0 /chrome/browser/pref_member_unittest.cc | |
parent | 7082b2329218da9a77fd6bc9587e86d0ed817196 (diff) | |
download | chromium_src-74379bc51320fd98a47c98053a056b4ddd7271a7.zip chromium_src-74379bc51320fd98a47c98053a056b4ddd7271a7.tar.gz chromium_src-74379bc51320fd98a47c98053a056b4ddd7271a7.tar.bz2 |
Adjust preference sync code to only sync user modifiable preferences.
Switch to the new preference value source checkers in Preference. While at it,
add a unit test and better test infrastructure for controlling preference
values in tests. Convert existing unit tests where appropriate.
BUG=48952
TEST=ProfileSyncServicePreferenceTest.ManagedPreferences
Review URL: http://codereview.chromium.org/3051001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53179 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/pref_member_unittest.cc')
-rw-r--r-- | chrome/browser/pref_member_unittest.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/chrome/browser/pref_member_unittest.cc b/chrome/browser/pref_member_unittest.cc index 98d11a7..b0379d6 100644 --- a/chrome/browser/pref_member_unittest.cc +++ b/chrome/browser/pref_member_unittest.cc @@ -1,13 +1,13 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/file_path.h" #include "chrome/browser/dummy_pref_store.h" #include "chrome/browser/pref_member.h" -#include "chrome/browser/pref_service.h" #include "chrome/browser/pref_value_store.h" #include "chrome/common/notification_service.h" +#include "chrome/test/testing_pref_service.h" #include "testing/gtest/include/gtest/gtest.h" namespace { @@ -53,8 +53,7 @@ class PrefMemberTestClass : public NotificationObserver { } // anonymous namespace TEST(PrefMemberTest, BasicGetAndSet) { - PrefService prefs(new PrefValueStore(NULL, NULL, NULL, new DummyPrefStore(), - NULL)); + TestingPrefService prefs; RegisterTestPrefs(&prefs); // Test bool @@ -144,8 +143,7 @@ TEST(PrefMemberTest, BasicGetAndSet) { TEST(PrefMemberTest, TwoPrefs) { // Make sure two RealPrefMembers stay in sync. - PrefService prefs(new PrefValueStore(NULL, NULL, NULL, new DummyPrefStore(), - NULL)); + TestingPrefService prefs; RegisterTestPrefs(&prefs); RealPrefMember pref1; @@ -165,8 +163,7 @@ TEST(PrefMemberTest, TwoPrefs) { } TEST(PrefMemberTest, Observer) { - PrefService prefs(new PrefValueStore(NULL, NULL, NULL, new DummyPrefStore(), - NULL)); + TestingPrefService prefs; RegisterTestPrefs(&prefs); PrefMemberTestClass test_obj(&prefs); |