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

Unified Diff: base/prefs/public/pref_member_unittest.cc

Issue 11741003: Remove PrefServiceSimple, replacing it with PrefService and PrefRegistrySimple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix double registration in Chrome Frame test. 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
« no previous file with comments | « base/prefs/public/pref_change_registrar_unittest.cc ('k') | base/prefs/public/pref_service_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/prefs/public/pref_member_unittest.cc
diff --git a/base/prefs/public/pref_member_unittest.cc b/base/prefs/public/pref_member_unittest.cc
index 3439c0f04fc37e56a5b8acaf08f6e6c24642cb9a..fb81f3978407f8961e57ffa5c8ec57809d8c2108 100644
--- a/base/prefs/public/pref_member_unittest.cc
+++ b/base/prefs/public/pref_member_unittest.cc
@@ -8,6 +8,7 @@
#include "base/message_loop.h"
#include "base/synchronization/waitable_event.h"
#include "base/threading/thread.h"
+#include "chrome/browser/prefs/pref_registry_simple.h"
#include "chrome/test/base/testing_pref_service.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -19,12 +20,12 @@ const char kDoublePref[] = "double";
const char kStringPref[] = "string";
const char kStringListPref[] = "string_list";
-void RegisterTestPrefs(PrefServiceSimple* prefs) {
- prefs->RegisterBooleanPref(kBoolPref, false);
- prefs->RegisterIntegerPref(kIntPref, 0);
- prefs->RegisterDoublePref(kDoublePref, 0.0);
- prefs->RegisterStringPref(kStringPref, "default");
- prefs->RegisterListPref(kStringListPref, new ListValue());
+void RegisterTestPrefs(PrefRegistrySimple* registry) {
+ registry->RegisterBooleanPref(kBoolPref, false);
+ registry->RegisterIntegerPref(kIntPref, 0);
+ registry->RegisterDoublePref(kDoublePref, 0.0);
+ registry->RegisterStringPref(kStringPref, "default");
+ registry->RegisterListPref(kStringListPref, new ListValue());
}
class GetPrefValueHelper
@@ -101,7 +102,7 @@ class PrefMemberTestClass {
TEST(PrefMemberTest, BasicGetAndSet) {
TestingPrefServiceSimple prefs;
- RegisterTestPrefs(&prefs);
+ RegisterTestPrefs(prefs.registry());
// Test bool
BooleanPrefMember boolean;
@@ -247,7 +248,7 @@ TEST(PrefMemberTest, InvalidList) {
TEST(PrefMemberTest, TwoPrefs) {
// Make sure two DoublePrefMembers stay in sync.
TestingPrefServiceSimple prefs;
- RegisterTestPrefs(&prefs);
+ RegisterTestPrefs(prefs.registry());
DoublePrefMember pref1;
pref1.Init(kDoublePref, &prefs);
@@ -267,7 +268,7 @@ TEST(PrefMemberTest, TwoPrefs) {
TEST(PrefMemberTest, Observer) {
TestingPrefServiceSimple prefs;
- RegisterTestPrefs(&prefs);
+ RegisterTestPrefs(prefs.registry());
PrefMemberTestClass test_obj(&prefs);
EXPECT_EQ("default", *test_obj.str_);
@@ -300,7 +301,7 @@ TEST(PrefMemberTest, NoInit) {
TEST(PrefMemberTest, MoveToThread) {
TestingPrefServiceSimple prefs;
scoped_refptr<GetPrefValueHelper> helper(new GetPrefValueHelper());
- RegisterTestPrefs(&prefs);
+ RegisterTestPrefs(prefs.registry());
helper->Init(kBoolPref, &prefs);
helper->FetchValue();
« no previous file with comments | « base/prefs/public/pref_change_registrar_unittest.cc ('k') | base/prefs/public/pref_service_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698