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

Side by Side Diff: base/prefs/pref_change_registrar_unittest.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/pickle_unittest.cc ('k') | base/prefs/pref_service_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/prefs/pref_change_registrar.h" 7 #include "base/prefs/pref_change_registrar.h"
8 #include "base/prefs/pref_observer.h" 8 #include "base/prefs/pref_observer.h"
9 #include "base/prefs/pref_registry_simple.h" 9 #include "base/prefs/pref_registry_simple.h"
10 #include "base/prefs/testing_pref_service.h" 10 #include "base/prefs/testing_pref_service.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 Mock::VerifyAndClearExpectations(service()); 125 Mock::VerifyAndClearExpectations(service());
126 } 126 }
127 127
128 class ObserveSetOfPreferencesTest : public testing::Test { 128 class ObserveSetOfPreferencesTest : public testing::Test {
129 public: 129 public:
130 virtual void SetUp() { 130 virtual void SetUp() {
131 pref_service_.reset(new TestingPrefServiceSimple); 131 pref_service_.reset(new TestingPrefServiceSimple);
132 PrefRegistrySimple* registry = pref_service_->registry(); 132 PrefRegistrySimple* registry = pref_service_->registry();
133 registry->RegisterStringPref(kHomePage, "http://google.com"); 133 registry->RegisterStringPref(kHomePage, "http://google.com");
134 registry->RegisterBooleanPref(kHomePageIsNewTabPage, false); 134 registry->RegisterBooleanPref(kHomePageIsNewTabPage, false);
135 registry->RegisterStringPref(kApplicationLocale, ""); 135 registry->RegisterStringPref(kApplicationLocale, std::string());
136 } 136 }
137 137
138 PrefChangeRegistrar* CreatePrefChangeRegistrar() { 138 PrefChangeRegistrar* CreatePrefChangeRegistrar() {
139 PrefChangeRegistrar* pref_set = new PrefChangeRegistrar(); 139 PrefChangeRegistrar* pref_set = new PrefChangeRegistrar();
140 base::Closure callback = base::Bind(&base::DoNothing); 140 base::Closure callback = base::Bind(&base::DoNothing);
141 pref_set->Init(pref_service_.get()); 141 pref_set->Init(pref_service_.get());
142 pref_set->Add(kHomePage, callback); 142 pref_set->Add(kHomePage, callback);
143 pref_set->Add(kHomePageIsNewTabPage, callback); 143 pref_set->Add(kHomePageIsNewTabPage, callback);
144 return pref_set; 144 return pref_set;
145 } 145 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 pref_service_->SetUserPref(kHomePageIsNewTabPage, 191 pref_service_->SetUserPref(kHomePageIsNewTabPage,
192 new FundamentalValue(true)); 192 new FundamentalValue(true));
193 Mock::VerifyAndClearExpectations(this); 193 Mock::VerifyAndClearExpectations(this);
194 194
195 EXPECT_CALL(*this, OnPreferenceChanged(_)).Times(0); 195 EXPECT_CALL(*this, OnPreferenceChanged(_)).Times(0);
196 pref_service_->SetUserPref(kApplicationLocale, new StringValue("en_US.utf8")); 196 pref_service_->SetUserPref(kApplicationLocale, new StringValue("en_US.utf8"));
197 Mock::VerifyAndClearExpectations(this); 197 Mock::VerifyAndClearExpectations(this);
198 } 198 }
199 199
200 } // namespace base 200 } // namespace base
OLDNEW
« no previous file with comments | « base/pickle_unittest.cc ('k') | base/prefs/pref_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698