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

Unified Diff: components/policy/core/common/registry_dict_unittest.cc

Issue 2911033002: Remove raw base::DictionaryValue::Set (Closed)
Patch Set: Proper Windows Fix Created 3 years, 6 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 | « components/policy/core/common/policy_loader_win_unittest.cc ('k') | components/wifi/network_properties.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/policy/core/common/registry_dict_unittest.cc
diff --git a/components/policy/core/common/registry_dict_unittest.cc b/components/policy/core/common/registry_dict_unittest.cc
index e415d554bf04290ed0ed8e27c0702f456ff9e9a2..ca27f321cfdb21c5bedd2fc98540594c1a8a7126 100644
--- a/components/policy/core/common/registry_dict_unittest.cc
+++ b/components/policy/core/common/registry_dict_unittest.cc
@@ -230,22 +230,21 @@ TEST(RegistryDictTest, ConvertToJSON) {
std::unique_ptr<base::Value> actual(test_dict.ConvertToJSON(schema));
base::DictionaryValue expected;
- expected.Set("one", int_value.CreateDeepCopy());
- std::unique_ptr<base::DictionaryValue> expected_subdict(
- new base::DictionaryValue());
- expected_subdict->Set("two", string_value.CreateDeepCopy());
+ expected.Set("one", base::MakeUnique<base::Value>(int_value));
+ auto expected_subdict = base::MakeUnique<base::DictionaryValue>();
+ expected_subdict->Set("two", base::MakeUnique<base::Value>(string_value));
expected.Set("three", std::move(expected_subdict));
- std::unique_ptr<base::ListValue> expected_list(new base::ListValue());
- expected_list->Append(string_value.CreateDeepCopy());
+ auto expected_list = base::MakeUnique<base::ListValue>();
+ expected_list->Append(base::MakeUnique<base::Value>(string_value));
expected.Set("dict-to-list", std::move(expected_list));
- expected.Set("int-to-bool", new base::Value(true));
- expected.Set("int-to-double", new base::Value(42.0));
- expected.Set("string-to-bool", new base::Value(false));
- expected.Set("string-to-double", new base::Value(0.0));
- expected.Set("string-to-int", new base::Value(static_cast<int>(0)));
- expected_list.reset(new base::ListValue());
+ expected.SetBoolean("int-to-bool", true);
+ expected.SetDouble("int-to-double", 42.0);
+ expected.SetBoolean("string-to-bool", false);
+ expected.SetDouble("string-to-double", 0.0);
+ expected.SetInteger("string-to-int", static_cast<int>(0));
+ expected_list = base::MakeUnique<base::ListValue>();
expected_list->Append(base::MakeUnique<base::Value>("value"));
- expected_subdict.reset(new base::DictionaryValue());
+ expected_subdict = base::MakeUnique<base::DictionaryValue>();
expected_subdict->Set("key", std::move(expected_list));
expected.Set("string-to-dict", std::move(expected_subdict));
« no previous file with comments | « components/policy/core/common/policy_loader_win_unittest.cc ('k') | components/wifi/network_properties.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698