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

Unified Diff: chrome/test/base/testing_pref_service.cc

Issue 12223091: Split testing_pref_service.h/.cc into two parts, generic vs. Chrome-specific. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 7 years, 10 months 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/test/base/testing_pref_service.cc
diff --git a/chrome/test/base/testing_pref_service.cc b/chrome/test/base/testing_pref_service.cc
index 39205a0b238f2ebe517db5f5a5d1609d87bed78a..3d2daf6a99a174192e6f4edbdd0200e96091cbab 100644
--- a/chrome/test/base/testing_pref_service.cc
+++ b/chrome/test/base/testing_pref_service.cc
@@ -10,19 +10,8 @@
#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,
@@ -41,38 +30,14 @@ TestingPrefServiceBase<PrefService>::TestingPrefServiceBase(
pref_notifier),
user_prefs,
pref_registry,
- base::Bind(&HandleReadError),
+ base::Bind(&TestingPrefServiceBase<PrefService>::
+ HandleReadError),
false),
managed_prefs_(managed_prefs),
user_prefs_(user_prefs),
recommended_prefs_(recommended_prefs) {
}
-template<>
-TestingPrefServiceBase<PrefServiceSyncable>::TestingPrefServiceBase(
- TestingPrefStore* managed_prefs,
- TestingPrefStore* user_prefs,
- TestingPrefStore* recommended_prefs,
- PrefRegistry* pref_registry,
- PrefNotifierImpl* pref_notifier)
- : PrefServiceSyncable(pref_notifier,
- new PrefValueStore(
- managed_prefs,
- NULL,
- NULL,
- user_prefs,
- recommended_prefs,
- pref_registry->defaults(),
- pref_notifier),
- user_prefs,
- static_cast<PrefRegistrySyncable*>(pref_registry),
- base::Bind(&HandleReadError),
- false),
- managed_prefs_(managed_prefs),
- user_prefs_(user_prefs),
- recommended_prefs_(recommended_prefs) {
-}
-
TestingPrefServiceSimple::TestingPrefServiceSimple()
: TestingPrefServiceBase<PrefService>(
new TestingPrefStore(),
@@ -88,33 +53,3 @@ TestingPrefServiceSimple::~TestingPrefServiceSimple() {
PrefRegistrySimple* TestingPrefServiceSimple::registry() {
return static_cast<PrefRegistrySimple*>(DeprecatedGetPrefRegistry());
}
-
-TestingPrefServiceSyncable::TestingPrefServiceSyncable()
- : TestingPrefServiceBase<PrefServiceSyncable>(
- new TestingPrefStore(),
- new TestingPrefStore(),
- new TestingPrefStore(),
- new PrefRegistrySyncable(),
- new PrefNotifierImpl()) {
-}
-
-TestingPrefServiceSyncable::~TestingPrefServiceSyncable() {
-}
-
-PrefRegistrySyncable* TestingPrefServiceSyncable::registry() {
- return static_cast<PrefRegistrySyncable*>(DeprecatedGetPrefRegistry());
-}
-
-ScopedTestingLocalState::ScopedTestingLocalState(
- TestingBrowserProcess* browser_process)
- : browser_process_(browser_process) {
- chrome::RegisterLocalState(&local_state_,
- local_state_.registry());
- EXPECT_FALSE(browser_process->local_state());
- browser_process->SetLocalState(&local_state_);
-}
-
-ScopedTestingLocalState::~ScopedTestingLocalState() {
- EXPECT_EQ(&local_state_, browser_process_->local_state());
- browser_process_->SetLocalState(NULL);
-}

Powered by Google App Engine
This is Rietveld 408576698