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

Side by Side Diff: components/web_resource/promo_resource_service_unittest.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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <utility> 5 #include <utility>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 int max_views) { 78 int max_views) {
79 double year_from_now_epoch; 79 double year_from_now_epoch;
80 std::string year_from_now_string; 80 std::string year_from_now_string;
81 ASSERT_TRUE(YearFromNow(&year_from_now_epoch, &year_from_now_string)); 81 ASSERT_TRUE(YearFromNow(&year_from_now_epoch, &year_from_now_string));
82 82
83 std::vector<std::string> replacements; 83 std::vector<std::string> replacements;
84 replacements.push_back(year_from_now_string); 84 replacements.push_back(year_from_now_string);
85 85
86 std::string json_with_end_date( 86 std::string json_with_end_date(
87 base::ReplaceStringPlaceholders(json, replacements, NULL)); 87 base::ReplaceStringPlaceholders(json, replacements, NULL));
88 base::Value* value(base::JSONReader::DeprecatedRead(json_with_end_date)); 88 base::Value* value(base::JSONReader::Read(json_with_end_date).release());
89 ASSERT_TRUE(value); 89 ASSERT_TRUE(value);
90 90
91 base::DictionaryValue* dict = NULL; 91 base::DictionaryValue* dict = NULL;
92 value->GetAsDictionary(&dict); 92 value->GetAsDictionary(&dict);
93 ASSERT_TRUE(dict); 93 ASSERT_TRUE(dict);
94 test_json_.reset(dict); 94 test_json_.reset(dict);
95 95
96 promo_type_ = NotificationPromo::NTP_NOTIFICATION_PROMO; 96 promo_type_ = NotificationPromo::NTP_NOTIFICATION_PROMO;
97 promo_text_ = promo_text; 97 promo_text_ = promo_text;
98 98
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 508
509 TEST_F(NotificationPromoTest, PromoServerURLTest) { 509 TEST_F(NotificationPromoTest, PromoServerURLTest) {
510 GURL promo_server_url = NotificationPromo::PromoServerURL(kChannel); 510 GURL promo_server_url = NotificationPromo::PromoServerURL(kChannel);
511 EXPECT_FALSE(promo_server_url.is_empty()); 511 EXPECT_FALSE(promo_server_url.is_empty());
512 EXPECT_TRUE(promo_server_url.is_valid()); 512 EXPECT_TRUE(promo_server_url.is_valid());
513 EXPECT_TRUE(promo_server_url.SchemeIs(url::kHttpsScheme)); 513 EXPECT_TRUE(promo_server_url.SchemeIs(url::kHttpsScheme));
514 // TODO(achuith): Test this better. 514 // TODO(achuith): Test this better.
515 } 515 }
516 516
517 } // namespace web_resource 517 } // namespace web_resource
OLDNEW
« no previous file with comments | « components/web_resource/promo_resource_service_mobile_ntp_unittest.cc ('k') | components/webcrypto/test/test_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698