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

Unified Diff: components/webcrypto/test/test_helpers.cc

Issue 1323923002: Remove use of JSONReader::DeprecatedRead from components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Error fix Created 5 years, 3 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/web_resource/promo_resource_service_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/webcrypto/test/test_helpers.cc
diff --git a/components/webcrypto/test/test_helpers.cc b/components/webcrypto/test/test_helpers.cc
index cd5362a2441c5c5f4569797e38395ed61cf30c4a..7096d45f2bd7a11fcd9f31c72638b95d517432f1 100644
--- a/components/webcrypto/test/test_helpers.cc
+++ b/components/webcrypto/test/test_helpers.cc
@@ -201,7 +201,7 @@ std::vector<uint8_t> MakeJsonVector(const base::DictionaryValue& dict) {
re2::RE2::GlobalReplace(&file_contents, re2::RE2("\\s*//.*"), "");
// Parse the JSON to a dictionary.
- value->reset(base::JSONReader::DeprecatedRead(file_contents));
+ *value = base::JSONReader::Read(file_contents);
if (!value->get()) {
return ::testing::AssertionFailure()
<< "Couldn't parse test file JSON: " << file_path.value();
@@ -428,11 +428,12 @@ scoped_ptr<base::DictionaryValue> GetJwkDictionary(
const std::vector<uint8_t>& json) {
base::StringPiece json_string(
reinterpret_cast<const char*>(vector_as_array(&json)), json.size());
- base::Value* value = base::JSONReader::DeprecatedRead(json_string);
- EXPECT_TRUE(value);
- base::DictionaryValue* dict_value = NULL;
- value->GetAsDictionary(&dict_value);
- return scoped_ptr<base::DictionaryValue>(dict_value);
+ scoped_ptr<base::Value> value = base::JSONReader::Read(json_string);
+ EXPECT_TRUE(value.get());
+ EXPECT_TRUE(value->IsType(base::Value::TYPE_DICTIONARY));
+
+ return scoped_ptr<base::DictionaryValue>(
+ static_cast<base::DictionaryValue*>(value.release()));
}
// Verifies the input dictionary contains the expected values. Exact matches are
« no previous file with comments | « components/web_resource/promo_resource_service_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698