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

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

Issue 753603002: Change preference APIs to take std::string instead of const char*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed all calls to c_str() in prefs. Created 6 years 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
« no previous file with comments | « base/prefs/pref_value_store.cc ('k') | base/prefs/scoped_user_pref_update.h » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <string> 5 #include <string>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/prefs/pref_notifier.h" 10 #include "base/prefs/pref_notifier.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 prefs::kUserPref, 230 prefs::kUserPref,
231 default_pref::kUserValue); 231 default_pref::kUserValue);
232 default_pref_store_->SetString( 232 default_pref_store_->SetString(
233 prefs::kRecommendedPref, 233 prefs::kRecommendedPref,
234 default_pref::kRecommendedValue); 234 default_pref::kRecommendedValue);
235 default_pref_store_->SetString( 235 default_pref_store_->SetString(
236 prefs::kDefaultPref, 236 prefs::kDefaultPref,
237 default_pref::kDefaultValue); 237 default_pref::kDefaultValue);
238 } 238 }
239 239
240 void ExpectValueChangeNotifications(const char* name) { 240 void ExpectValueChangeNotifications(const std::string& name) {
241 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(name)); 241 EXPECT_CALL(pref_notifier_, OnPreferenceChanged(name));
242 EXPECT_CALL(*sync_associator_, ProcessPrefChange(name)); 242 EXPECT_CALL(*sync_associator_, ProcessPrefChange(name));
243 } 243 }
244 244
245 void CheckAndClearValueChangeNotifications() { 245 void CheckAndClearValueChangeNotifications() {
246 Mock::VerifyAndClearExpectations(&pref_notifier_); 246 Mock::VerifyAndClearExpectations(&pref_notifier_);
247 Mock::VerifyAndClearExpectations(sync_associator_.get()); 247 Mock::VerifyAndClearExpectations(sync_associator_.get());
248 } 248 }
249 249
250 MockPrefNotifier pref_notifier_; 250 MockPrefNotifier pref_notifier_;
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 prefs::kCommandLinePref)); 661 prefs::kCommandLinePref));
662 EXPECT_TRUE(pref_value_store_->PrefValueExtensionModifiable( 662 EXPECT_TRUE(pref_value_store_->PrefValueExtensionModifiable(
663 prefs::kUserPref)); 663 prefs::kUserPref));
664 EXPECT_TRUE(pref_value_store_->PrefValueExtensionModifiable( 664 EXPECT_TRUE(pref_value_store_->PrefValueExtensionModifiable(
665 prefs::kRecommendedPref)); 665 prefs::kRecommendedPref));
666 EXPECT_TRUE(pref_value_store_->PrefValueExtensionModifiable( 666 EXPECT_TRUE(pref_value_store_->PrefValueExtensionModifiable(
667 prefs::kDefaultPref)); 667 prefs::kDefaultPref));
668 EXPECT_TRUE(pref_value_store_->PrefValueExtensionModifiable( 668 EXPECT_TRUE(pref_value_store_->PrefValueExtensionModifiable(
669 prefs::kMissingPref)); 669 prefs::kMissingPref));
670 } 670 }
OLDNEW
« no previous file with comments | « base/prefs/pref_value_store.cc ('k') | base/prefs/scoped_user_pref_update.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698