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

Unified Diff: components/pref_registry/testing_pref_service_syncable.cc

Issue 340703002: Add user_prefs::TestPrefServiceSyncable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use TEST_F Created 6 years, 6 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
« no previous file with comments | « components/pref_registry/testing_pref_service_syncable.h ('k') | components/sync_driver/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/pref_registry/testing_pref_service_syncable.cc
diff --git a/components/pref_registry/testing_pref_service_syncable.cc b/components/pref_registry/testing_pref_service_syncable.cc
new file mode 100644
index 0000000000000000000000000000000000000000..22602936c69ce8a870778d12fa2d02ad032c1efa
--- /dev/null
+++ b/components/pref_registry/testing_pref_service_syncable.cc
@@ -0,0 +1,70 @@
+// Copyright 2014 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 "components/pref_registry/testing_pref_service_syncable.h"
+
+#include "base/bind.h"
+#include "base/prefs/pref_notifier_impl.h"
+#include "base/prefs/pref_value_store.h"
+#include "components/pref_registry/pref_registry_syncable.h"
+
+template <>
+TestingPrefServiceBase<PrefService, user_prefs::PrefRegistrySyncable>::
+ TestingPrefServiceBase(TestingPrefStore* managed_prefs,
+ TestingPrefStore* user_prefs,
+ TestingPrefStore* recommended_prefs,
+ user_prefs::PrefRegistrySyncable* pref_registry,
+ PrefNotifierImpl* pref_notifier)
+ : PrefService(pref_notifier,
+ new PrefValueStore(managed_prefs,
+ NULL, // supervised_user_prefs
+ NULL, // extension_prefs
+ NULL, // command_line_prefs
+ user_prefs,
+ recommended_prefs,
+ pref_registry->defaults().get(),
+ pref_notifier),
+ user_prefs,
+ pref_registry,
+ base::Bind(&TestingPrefServiceBase<
+ PrefService,
+ user_prefs::PrefRegistrySyncable>::HandleReadError),
+ false),
+ managed_prefs_(managed_prefs),
+ user_prefs_(user_prefs),
+ recommended_prefs_(recommended_prefs) {}
+
+namespace user_prefs {
+
+TestingPrefServiceSyncable::TestingPrefServiceSyncable()
+ : TestingPrefServiceBase<PrefService, PrefRegistrySyncable>(
+ new TestingPrefStore(),
+ new TestingPrefStore(),
+ new TestingPrefStore(),
+ new PrefRegistrySyncable(),
+ new PrefNotifierImpl()) {
+}
+
+TestingPrefServiceSyncable::TestingPrefServiceSyncable(
+ TestingPrefStore* managed_prefs,
+ TestingPrefStore* user_prefs,
+ TestingPrefStore* recommended_prefs,
+ PrefRegistrySyncable* pref_registry,
+ PrefNotifierImpl* pref_notifier)
+ : TestingPrefServiceBase<PrefService, PrefRegistrySyncable>(
+ managed_prefs,
+ user_prefs,
+ recommended_prefs,
+ pref_registry,
+ pref_notifier) {
+}
+
+TestingPrefServiceSyncable::~TestingPrefServiceSyncable() {
+}
+
+PrefRegistrySyncable* TestingPrefServiceSyncable::registry() {
+ return static_cast<PrefRegistrySyncable*>(DeprecatedGetPrefRegistry());
+}
+
+} // namespace user_prefs
« no previous file with comments | « components/pref_registry/testing_pref_service_syncable.h ('k') | components/sync_driver/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698