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

Unified Diff: components/sync_preferences/pref_model_associator_unittest.cc

Issue 2843813002: Remove SetWithoutPathExpansion (Closed)
Patch Set: Fix CrOS Error Created 3 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 side-by-side diff with in-line comments
Download patch
Index: components/sync_preferences/pref_model_associator_unittest.cc
diff --git a/components/sync_preferences/pref_model_associator_unittest.cc b/components/sync_preferences/pref_model_associator_unittest.cc
index d9c4f17d4e689903417da9e6a5da18bc33c461ea..4b2d9bc80770ea17d3efe7b1ee03a4ee9f5a6187 100644
--- a/components/sync_preferences/pref_model_associator_unittest.cc
+++ b/components/sync_preferences/pref_model_associator_unittest.cc
@@ -65,15 +65,16 @@ class AbstractPreferenceMergeTest : public testing::Test {
void SetContentPattern(base::DictionaryValue* patterns_dict,
const std::string& expression,
int setting) {
- base::DictionaryValue* expression_dict;
+ base::DictionaryValue* expression_dict = nullptr;
bool found = patterns_dict->GetDictionaryWithoutPathExpansion(
expression, &expression_dict);
if (!found) {
- expression_dict = new base::DictionaryValue;
- patterns_dict->SetWithoutPathExpansion(expression, expression_dict);
+ patterns_dict->SetWithoutPathExpansion(
+ expression, base::MakeUnique<base::DictionaryValue>());
+ patterns_dict->GetDictionaryWithoutPathExpansion(expression,
+ &expression_dict);
}
- expression_dict->SetWithoutPathExpansion("setting",
- new base::Value(setting));
+ expression_dict->SetIntegerWithoutPathExpansion("setting", setting);
}
void SetPrefToEmpty(const std::string& pref_name) {
« no previous file with comments | « components/sync_preferences/pref_model_associator.cc ('k') | components/url_matcher/url_matcher_factory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698