Chromium Code Reviews| Index: chrome/test/base/testing_pref_service_syncable.cc |
| diff --git a/chrome/test/base/testing_pref_service.cc b/chrome/test/base/testing_pref_service_syncable.cc |
| similarity index 57% |
| copy from chrome/test/base/testing_pref_service.cc |
| copy to chrome/test/base/testing_pref_service_syncable.cc |
| index 39205a0b238f2ebe517db5f5a5d1609d87bed78a..fe2f19540c0ff12264de7b623439b6875a9b0f53 100644 |
| --- a/chrome/test/base/testing_pref_service.cc |
| +++ b/chrome/test/base/testing_pref_service_syncable.cc |
| @@ -1,53 +1,17 @@ |
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2013 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 "chrome/test/base/testing_pref_service.h" |
| +#include "chrome/test/base/testing_pref_service_syncable.h" |
| #include "base/bind.h" |
| -#include "base/compiler_specific.h" |
| -#include "base/prefs/default_pref_store.h" |
| #include "base/prefs/pref_notifier_impl.h" |
| -#include "base/prefs/pref_registry_simple.h" |
| #include "base/prefs/pref_value_store.h" |
| #include "chrome/browser/prefs/browser_prefs.h" |
| #include "chrome/browser/prefs/pref_registry_syncable.h" |
| #include "chrome/test/base/testing_browser_process.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| -namespace { |
| - |
| -// Do-nothing implementation for TestingPrefService. |
| -void HandleReadError(PersistentPrefStore::PrefReadError error) { |
| -} |
| - |
| -} // namespace |
| - |
| -template<> |
| -TestingPrefServiceBase<PrefService>::TestingPrefServiceBase( |
| - TestingPrefStore* managed_prefs, |
| - TestingPrefStore* user_prefs, |
| - TestingPrefStore* recommended_prefs, |
| - PrefRegistry* pref_registry, |
| - PrefNotifierImpl* pref_notifier) |
| - : PrefService(pref_notifier, |
| - new PrefValueStore( |
| - managed_prefs, |
| - NULL, |
| - NULL, |
| - user_prefs, |
| - recommended_prefs, |
| - pref_registry->defaults(), |
| - pref_notifier), |
| - user_prefs, |
| - pref_registry, |
| - base::Bind(&HandleReadError), |
| - false), |
| - managed_prefs_(managed_prefs), |
| - user_prefs_(user_prefs), |
| - recommended_prefs_(recommended_prefs) { |
| -} |
| - |
| template<> |
| TestingPrefServiceBase<PrefServiceSyncable>::TestingPrefServiceBase( |
| TestingPrefStore* managed_prefs, |
| @@ -66,29 +30,14 @@ TestingPrefServiceBase<PrefServiceSyncable>::TestingPrefServiceBase( |
| pref_notifier), |
| user_prefs, |
| static_cast<PrefRegistrySyncable*>(pref_registry), |
|
Mattias Nissler (ping if slow)
2013/02/12 13:53:32
Hm, so this hack is here to stay? I guess the only
Jói
2013/02/12 14:35:51
Which hack do you mean, the cast to PrefRegistrySy
Mattias Nissler (ping if slow)
2013/02/12 14:42:57
Yes, I mean the cast. Thinking more about it, ther
|
| - base::Bind(&HandleReadError), |
| + base::Bind(&TestingPrefServiceBase< |
| + PrefServiceSyncable>::HandleReadError), |
| false), |
| managed_prefs_(managed_prefs), |
| user_prefs_(user_prefs), |
| recommended_prefs_(recommended_prefs) { |
| } |
| -TestingPrefServiceSimple::TestingPrefServiceSimple() |
| - : TestingPrefServiceBase<PrefService>( |
| - new TestingPrefStore(), |
| - new TestingPrefStore(), |
| - new TestingPrefStore(), |
| - new PrefRegistrySimple(), |
| - new PrefNotifierImpl()) { |
| -} |
| - |
| -TestingPrefServiceSimple::~TestingPrefServiceSimple() { |
| -} |
| - |
| -PrefRegistrySimple* TestingPrefServiceSimple::registry() { |
| - return static_cast<PrefRegistrySimple*>(DeprecatedGetPrefRegistry()); |
| -} |
| - |
| TestingPrefServiceSyncable::TestingPrefServiceSyncable() |
| : TestingPrefServiceBase<PrefServiceSyncable>( |
| new TestingPrefStore(), |