Index: chrome/test/base/testing_pref_service.h |
diff --git a/chrome/test/base/testing_pref_service.h b/chrome/test/base/testing_pref_service.h |
index 24323ed40776597bebc087a3b1e49cf665f6a9f5..78abfaff85f112412006364d6a81fad05dee0936 100644 |
--- a/chrome/test/base/testing_pref_service.h |
+++ b/chrome/test/base/testing_pref_service.h |
@@ -10,21 +10,16 @@ |
#include "base/prefs/pref_registry.h" |
#include "base/prefs/pref_service.h" |
#include "base/prefs/testing_pref_store.h" |
-#include "chrome/browser/prefs/pref_service_syncable.h" |
-class PrefModelAssociator; |
class PrefNotifierImpl; |
class PrefRegistrySimple; |
-class PrefRegistrySyncable; |
-class TestingBrowserProcess; |
class TestingPrefStore; |
// A PrefService subclass for testing. It operates totally in memory and |
// provides additional API for manipulating preferences at the different levels |
// (managed, extension, user) conveniently. |
// |
-// Use this via its specializations, TestingPrefServiceSimple and |
-// TestingPrefServiceSyncable. |
+// Use this via its specializations, e.g. TestingPrefServiceSimple. |
template <class SuperPrefService> |
class TestingPrefServiceBase : public SuperPrefService { |
public: |
@@ -52,6 +47,9 @@ class TestingPrefServiceBase : public SuperPrefService { |
void SetRecommendedPref(const char* path, Value* value); |
void RemoveRecommendedPref(const char* path); |
+ // Do-nothing implementation for TestingPrefService. |
+ static void HandleReadError(PersistentPrefStore::PrefReadError error) {} |
+ |
protected: |
TestingPrefServiceBase( |
TestingPrefStore* managed_prefs, |
@@ -97,41 +95,6 @@ class TestingPrefServiceSimple |
DISALLOW_COPY_AND_ASSIGN(TestingPrefServiceSimple); |
}; |
-// Test version of PrefServiceSyncable. |
-class TestingPrefServiceSyncable |
- : public TestingPrefServiceBase<PrefServiceSyncable> { |
- public: |
- TestingPrefServiceSyncable(); |
- virtual ~TestingPrefServiceSyncable(); |
- |
- // This is provided as a convenience; on a production PrefService |
- // you would do all registrations before constructing it, passing it |
- // a PrefRegistry via its constructor (or via |
- // e.g. PrefServiceBuilder). |
- PrefRegistrySyncable* registry(); |
- |
- private: |
- DISALLOW_COPY_AND_ASSIGN(TestingPrefServiceSyncable); |
-}; |
- |
-// Helper class to temporarily set up a |local_state| in the global |
-// TestingBrowserProcess (for most unit tests it's NULL). |
-class ScopedTestingLocalState { |
- public: |
- explicit ScopedTestingLocalState(TestingBrowserProcess* browser_process); |
- ~ScopedTestingLocalState(); |
- |
- TestingPrefServiceSimple* Get() { |
- return &local_state_; |
- } |
- |
- private: |
- TestingBrowserProcess* browser_process_; |
- TestingPrefServiceSimple local_state_; |
- |
- DISALLOW_COPY_AND_ASSIGN(ScopedTestingLocalState); |
-}; |
- |
template<> |
TestingPrefServiceBase<PrefService>::TestingPrefServiceBase( |
TestingPrefStore* managed_prefs, |
@@ -140,14 +103,6 @@ TestingPrefServiceBase<PrefService>::TestingPrefServiceBase( |
PrefRegistry* pref_registry, |
PrefNotifierImpl* pref_notifier); |
-template<> |
-TestingPrefServiceBase<PrefServiceSyncable>::TestingPrefServiceBase( |
- TestingPrefStore* managed_prefs, |
- TestingPrefStore* user_prefs, |
- TestingPrefStore* recommended_prefs, |
- PrefRegistry* pref_registry, |
- PrefNotifierImpl* pref_notifier); |
- |
template<class SuperPrefService> |
TestingPrefServiceBase<SuperPrefService>::~TestingPrefServiceBase() { |
} |