Chromium Code Reviews| Index: chromeos/network/onc/onc_test_utils.cc |
| diff --git a/chromeos/network/onc/onc_test_utils.cc b/chromeos/network/onc/onc_test_utils.cc |
| index 522a9ed338a8a0bf534d3574b645d37d3b39b53c..8f125f7b549082c9e6b5ad653f7b6a2d5f00eaa8 100644 |
| --- a/chromeos/network/onc/onc_test_utils.cc |
| +++ b/chromeos/network/onc/onc_test_utils.cc |
| @@ -38,29 +38,30 @@ std::string ReadTestData(const std::string& filename) { |
| scoped_ptr<base::DictionaryValue> ReadTestDictionary( |
| const std::string& filename) { |
| - base::DictionaryValue* dict = NULL; |
| + scoped_ptr<base::DictionaryValue> dict = NULL; |
|
Lei Zhang
2015/10/14 16:55:35
No need to initialize to NULL.
|
| base::FilePath path; |
| if (!chromeos::test_utils::GetTestDataPath(kNetworkComponentDirectory, |
| filename, |
| &path)) { |
| NOTREACHED() << "Unable to get test dictionary path for " |
| << kNetworkComponentDirectory << "/" << filename; |
| - return make_scoped_ptr(dict); |
| + return dict; |
| } |
| JSONFileValueDeserializer deserializer(path); |
| deserializer.set_allow_trailing_comma(true); |
| std::string error_message; |
| - base::Value* content = deserializer.Deserialize(NULL, &error_message); |
| + scoped_ptr<base::Value> content = |
| + deserializer.Deserialize(NULL, &error_message); |
| CHECK(content != NULL) << "Couldn't json-deserialize file '" |
| << filename << "': " << error_message; |
| - CHECK(content->GetAsDictionary(&dict)) |
| - << "File '" << filename |
| - << "' does not contain a dictionary as expected, but type " |
| - << content->GetType(); |
| - return make_scoped_ptr(dict); |
| + dict = base::DictionaryValue::From(content.Pass()); |
| + CHECK(dict) << "File '" << filename |
| + << "' does not contain a dictionary as expected, but type " |
| + << content->GetType(); |
| + return dict; |
| } |
| ::testing::AssertionResult Equals(const base::Value* expected, |