From 74379bc51320fd98a47c98053a056b4ddd7271a7 Mon Sep 17 00:00:00 2001 From: "mnissler@chromium.org" Date: Wed, 21 Jul 2010 13:54:08 +0000 Subject: 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 --- chrome/browser/pref_member_unittest.cc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'chrome/browser/pref_member_unittest.cc') 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); -- cgit v1.1