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

Unified Diff: services/preferences/public/cpp/tests/pref_observer_store_unittest.cc

Issue 2577563002: Add struct traits for base::Value. (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: services/preferences/public/cpp/tests/pref_observer_store_unittest.cc
diff --git a/services/preferences/public/cpp/tests/pref_observer_store_unittest.cc b/services/preferences/public/cpp/tests/pref_observer_store_unittest.cc
index d18cfbe75cf953f9656202ab7a40c303d99a572d..b12f597014c53a1298f4cfda87914b3c3651ab09 100644
--- a/services/preferences/public/cpp/tests/pref_observer_store_unittest.cc
+++ b/services/preferences/public/cpp/tests/pref_observer_store_unittest.cc
@@ -35,7 +35,8 @@ class TestPreferenceManager : public prefs::mojom::PreferencesManager {
// prefs::mojom::TestPreferenceManager:
void AddObserver(const std::vector<std::string>& preferences,
prefs::mojom::PreferencesObserverPtr client) override;
- void SetPreferences(const base::DictionaryValue& preferences) override;
+ void SetPreferences(
+ std::unique_ptr<base::DictionaryValue> preferences) override;
private:
bool add_observer_called_;
@@ -55,7 +56,7 @@ void TestPreferenceManager::AddObserver(
}
void TestPreferenceManager::SetPreferences(
- const base::DictionaryValue& preferences) {
+ std::unique_ptr<base::DictionaryValue> preferences) {
set_preferences_called_ = true;
}
@@ -72,7 +73,7 @@ class PrefObserverStoreTest : public testing::Test {
bool Initialized() { return store_->initialized_; }
void OnPreferencesChanged(const base::DictionaryValue& preferences) {
- store_->OnPreferencesChanged(std::move(preferences));
+ store_->OnPreferencesChanged(preferences.CreateDeepCopy());
}
// testing::Test:
« mojo/common/values.mojom ('K') | « services/preferences/public/cpp/pref_observer_store.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698