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

Side by Side Diff: net/cert/ct_log_response_parser_unittest.cc

Issue 1545233002: Convert Pass()→std::move() in //net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
« no previous file with comments | « net/cert/cert_verifier.cc ('k') | net/cert/ct_signed_certificate_timestamp_log_param.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "net/cert/ct_log_response_parser.h" 5 #include "net/cert/ct_log_response_parser.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
11 #include "base/strings/stringprintf.h" 11 #include "base/strings/stringprintf.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "base/values.h" 13 #include "base/values.h"
14 #include "net/cert/ct_serialization.h" 14 #include "net/cert/ct_serialization.h"
15 #include "net/cert/signed_tree_head.h" 15 #include "net/cert/signed_tree_head.h"
16 #include "net/test/ct_test_util.h" 16 #include "net/test/ct_test_util.h"
17 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
18 18
19 namespace net { 19 namespace net {
20 20
21 namespace ct { 21 namespace ct {
22 22
23 namespace { 23 namespace {
24 scoped_ptr<base::Value> ParseJson(const std::string& json) { 24 scoped_ptr<base::Value> ParseJson(const std::string& json) {
25 base::JSONReader json_reader; 25 base::JSONReader json_reader;
26 return json_reader.Read(json).Pass(); 26 return json_reader.Read(json);
27 } 27 }
28 } 28 }
29 29
30 TEST(CTLogResponseParserTest, ParsesValidJsonSTH) { 30 TEST(CTLogResponseParserTest, ParsesValidJsonSTH) {
31 scoped_ptr<base::Value> sample_sth_json = ParseJson(GetSampleSTHAsJson()); 31 scoped_ptr<base::Value> sample_sth_json = ParseJson(GetSampleSTHAsJson());
32 SignedTreeHead tree_head; 32 SignedTreeHead tree_head;
33 EXPECT_TRUE(FillSignedTreeHead(*sample_sth_json.get(), &tree_head)); 33 EXPECT_TRUE(FillSignedTreeHead(*sample_sth_json.get(), &tree_head));
34 34
35 SignedTreeHead sample_sth; 35 SignedTreeHead sample_sth;
36 GetSampleSignedTreeHead(&sample_sth); 36 GetSampleSignedTreeHead(&sample_sth);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 std::vector<std::string> output; 138 std::vector<std::string> output;
139 139
140 scoped_ptr<base::Value> badly_encoded = 140 scoped_ptr<base::Value> badly_encoded =
141 ParseJson(std::string("{\"consistency\": [], \"somethingelse\": 3}")); 141 ParseJson(std::string("{\"consistency\": [], \"somethingelse\": 3}"));
142 EXPECT_TRUE(FillConsistencyProof(*badly_encoded.get(), &output)); 142 EXPECT_TRUE(FillConsistencyProof(*badly_encoded.get(), &output));
143 } 143 }
144 144
145 } // namespace ct 145 } // namespace ct
146 146
147 } // namespace net 147 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/cert_verifier.cc ('k') | net/cert/ct_signed_certificate_timestamp_log_param.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698