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

Side by Side Diff: net/quic/quartc/quartc_session_test.cc

Issue 2463093003: Landing Recent QUIC changes until Sat Oct 29 14:59:35. (Closed)
Patch Set: add change to quiartc_session_test.cc Created 4 years, 1 month 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/quic/quartc/quartc_session.cc ('k') | net/quic/test_tools/crypto_test_utils.h » ('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 (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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/quic/quartc/quartc_session.h" 5 #include "net/quic/quartc/quartc_session.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 class FakeProofSource : public net::ProofSource { 49 class FakeProofSource : public net::ProofSource {
50 public: 50 public:
51 explicit FakeProofSource(bool success) : success_(success) {} 51 explicit FakeProofSource(bool success) : success_(success) {}
52 52
53 // ProofSource override. 53 // ProofSource override.
54 bool GetProof(const IPAddress& server_ip, 54 bool GetProof(const IPAddress& server_ip,
55 const std::string& hostname, 55 const std::string& hostname,
56 const std::string& server_config, 56 const std::string& server_config,
57 net::QuicVersion quic_version, 57 net::QuicVersion quic_version,
58 base::StringPiece chlo_hash, 58 base::StringPiece chlo_hash,
59 const net::QuicTagVector& connection_options,
59 scoped_refptr<net::ProofSource::Chain>* out_certs, 60 scoped_refptr<net::ProofSource::Chain>* out_certs,
60 std::string* out_signature, 61 std::string* out_signature,
61 std::string* out_leaf_cert_sct) override { 62 std::string* out_leaf_cert_sct) override {
62 if (success_) { 63 if (success_) {
63 std::vector<std::string> certs; 64 std::vector<std::string> certs;
64 certs.push_back("Required to establish handshake"); 65 certs.push_back("Required to establish handshake");
65 *out_certs = new ProofSource::Chain(certs); 66 *out_certs = new ProofSource::Chain(certs);
66 *out_signature = "Signature"; 67 *out_signature = "Signature";
67 *out_leaf_cert_sct = "Time"; 68 *out_leaf_cert_sct = "Time";
68 } 69 }
69 return success_; 70 return success_;
70 } 71 }
71 72
72 void GetProof(const net::IPAddress& server_ip, 73 void GetProof(const net::IPAddress& server_ip,
73 const std::string& hostname, 74 const std::string& hostname,
74 const std::string& server_config, 75 const std::string& server_config,
75 net::QuicVersion quic_version, 76 net::QuicVersion quic_version,
76 base::StringPiece chlo_hash, 77 base::StringPiece chlo_hash,
78 const net::QuicTagVector& connection_options,
77 std::unique_ptr<Callback> callback) override { 79 std::unique_ptr<Callback> callback) override {
78 LOG(INFO) << "GetProof() providing dummy credentials for insecure QUIC"; 80 LOG(INFO) << "GetProof() providing dummy credentials for insecure QUIC";
79 } 81 }
80 82
81 private: 83 private:
82 // Whether or not obtaining proof source succeeds. 84 // Whether or not obtaining proof source succeeds.
83 bool success_; 85 bool success_;
84 }; 86 };
85 87
86 // Used by QuicCryptoClientConfig to verify server credentials, returning a 88 // Used by QuicCryptoClientConfig to verify server credentials, returning a
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 EXPECT_FALSE(client_peer_->IsClosedStream(id)); 500 EXPECT_FALSE(client_peer_->IsClosedStream(id));
499 stream->SetDelegate(client_peer_->stream_delegate()); 501 stream->SetDelegate(client_peer_->stream_delegate());
500 stream->Close(); 502 stream->Close();
501 RunLoopWithTimeout(); 503 RunLoopWithTimeout();
502 EXPECT_TRUE(client_peer_->IsClosedStream(id)); 504 EXPECT_TRUE(client_peer_->IsClosedStream(id));
503 } 505 }
504 506
505 } // namespace 507 } // namespace
506 } // namespace test 508 } // namespace test
507 } // namespace net 509 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quartc/quartc_session.cc ('k') | net/quic/test_tools/crypto_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698