Chromium Code Reviews| Index: components/policy/core/common/preg_parser_win_unittest.cc |
| diff --git a/components/policy/core/common/preg_parser_win_unittest.cc b/components/policy/core/common/preg_parser_win_unittest.cc |
| index 220062ecb4f1bbfe06869f49c97df34f8cb2955b..8bd16f0eaf60b1bdafe157cbdbf8d07b6cce2da2 100644 |
| --- a/components/policy/core/common/preg_parser_win_unittest.cc |
| +++ b/components/policy/core/common/preg_parser_win_unittest.cc |
| @@ -10,6 +10,7 @@ |
| #include "base/files/file_path.h" |
| #include "base/json/json_writer.h" |
| #include "base/logging.h" |
| +#include "base/memory/ptr_util.h" |
| #include "base/path_service.h" |
| #include "base/values.h" |
| #include "components/policy/core/common/policy_load_status.h" |
| @@ -58,16 +59,14 @@ void SetInteger(RegistryDict* dict, |
| const std::string& name, |
| int value) { |
| dict->SetValue( |
| - name, |
| - make_scoped_ptr<base::Value>(new base::FundamentalValue(value))); |
| + name, base::WrapUnique<base::Value>(new base::FundamentalValue(value))); |
|
Thiemo Nagel
2016/04/20 20:34:19
Optional nit: Keeping existing indentation would s
dcheng
2016/04/20 20:56:31
See previous reply.
|
| } |
| void SetString(RegistryDict* dict, |
| const std::string& name, |
| const std::string& value) { |
| - dict->SetValue( |
| - name, |
| - make_scoped_ptr<base::Value>(new base::StringValue(value))); |
| + dict->SetValue(name, |
| + base::WrapUnique<base::Value>(new base::StringValue(value))); |
| } |
| TEST(PRegParserWinTest, TestParseFile) { |
| @@ -79,15 +78,15 @@ TEST(PRegParserWinTest, TestParseFile) { |
| RegistryDict dict; |
| SetInteger(&dict, "DeleteValuesTest1", 1); |
| SetString(&dict, "DeleteValuesTest2", "2"); |
| - dict.SetKey("DeleteKeysTest1", make_scoped_ptr(new RegistryDict())); |
| - scoped_ptr<RegistryDict> delete_keys_test(new RegistryDict()); |
| + dict.SetKey("DeleteKeysTest1", base::WrapUnique(new RegistryDict())); |
| + std::unique_ptr<RegistryDict> delete_keys_test(new RegistryDict()); |
| SetInteger(delete_keys_test.get(), "DeleteKeysTest2Entry", 1); |
| dict.SetKey("DeleteKeysTest2", std::move(delete_keys_test)); |
| SetInteger(&dict, "DelTest", 1); |
| - scoped_ptr<RegistryDict> subdict(new RegistryDict()); |
| + std::unique_ptr<RegistryDict> subdict(new RegistryDict()); |
| SetInteger(subdict.get(), "DelValsTest1", 1); |
| SetString(subdict.get(), "DelValsTest2", "2"); |
| - subdict->SetKey("DelValsTest3", make_scoped_ptr(new RegistryDict())); |
| + subdict->SetKey("DelValsTest3", base::WrapUnique(new RegistryDict())); |
| dict.SetKey("DelValsTest", std::move(subdict)); |
| // Run the parser. |
| @@ -99,13 +98,13 @@ TEST(PRegParserWinTest, TestParseFile) { |
| // Build the expected output dictionary. |
| RegistryDict expected; |
| - scoped_ptr<RegistryDict> del_vals_dict(new RegistryDict()); |
| - del_vals_dict->SetKey("DelValsTest3", make_scoped_ptr(new RegistryDict())); |
| + std::unique_ptr<RegistryDict> del_vals_dict(new RegistryDict()); |
| + del_vals_dict->SetKey("DelValsTest3", base::WrapUnique(new RegistryDict())); |
| expected.SetKey("DelValsTest", std::move(del_vals_dict)); |
| SetInteger(&expected, "HomepageIsNewTabPage", 1); |
| SetString(&expected, "HomepageLocation", "http://www.example.com"); |
| SetInteger(&expected, "RestoreOnStartup", 4); |
| - scoped_ptr<RegistryDict> startup_urls(new RegistryDict()); |
| + std::unique_ptr<RegistryDict> startup_urls(new RegistryDict()); |
| SetString(startup_urls.get(), "1", "http://www.chromium.org"); |
| SetString(startup_urls.get(), "2", "http://www.example.com"); |
| expected.SetKey("RestoreOnStartupURLs", std::move(startup_urls)); |