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

Side by Side Diff: net/quic/core/quic_crypto_server_stream_test.cc

Issue 2511643002: Refactoring output of ProofSource::GetProof (no functional changes). (Closed)
Patch Set: Refactoring output of ProofSource::GetProof (no functional changes). 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/core/quic_crypto_server_stream.cc ('k') | net/quic/quartc/quartc_session.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 (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 "net/quic/core/quic_crypto_server_stream.h" 5 #include "net/quic/core/quic_crypto_server_stream.h"
6 6
7 #include <map> 7 #include <map>
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 578
579 class FailingProofSource : public ProofSource { 579 class FailingProofSource : public ProofSource {
580 public: 580 public:
581 bool GetProof(const IPAddress& server_ip, 581 bool GetProof(const IPAddress& server_ip,
582 const string& hostname, 582 const string& hostname,
583 const string& server_config, 583 const string& server_config,
584 QuicVersion quic_version, 584 QuicVersion quic_version,
585 StringPiece chlo_hash, 585 StringPiece chlo_hash,
586 const QuicTagVector& connection_options, 586 const QuicTagVector& connection_options,
587 scoped_refptr<ProofSource::Chain>* out_chain, 587 scoped_refptr<ProofSource::Chain>* out_chain,
588 string* out_signature, 588 QuicCryptoProof* out_proof) override {
589 string* out_leaf_cert_sct) override {
590 return false; 589 return false;
591 } 590 }
592 591
593 void GetProof(const IPAddress& server_ip, 592 void GetProof(const IPAddress& server_ip,
594 const string& hostname, 593 const string& hostname,
595 const string& server_config, 594 const string& server_config,
596 QuicVersion quic_version, 595 QuicVersion quic_version,
597 StringPiece chlo_hash, 596 StringPiece chlo_hash,
598 const QuicTagVector& connection_options, 597 const QuicTagVector& connection_options,
599 std::unique_ptr<Callback> callback) override { 598 std::unique_ptr<Callback> callback) override {
600 callback->Run(false, nullptr, "", "", nullptr); 599 callback->Run(false, nullptr, QuicCryptoProof(), nullptr);
601 } 600 }
602 }; 601 };
603 602
604 class QuicCryptoServerStreamTestWithFailingProofSource 603 class QuicCryptoServerStreamTestWithFailingProofSource
605 : public QuicCryptoServerStreamTest { 604 : public QuicCryptoServerStreamTest {
606 public: 605 public:
607 QuicCryptoServerStreamTestWithFailingProofSource() 606 QuicCryptoServerStreamTestWithFailingProofSource()
608 : QuicCryptoServerStreamTest( 607 : QuicCryptoServerStreamTest(
609 std::unique_ptr<FailingProofSource>(new FailingProofSource)) {} 608 std::unique_ptr<FailingProofSource>(new FailingProofSource)) {}
610 }; 609 };
611 610
612 INSTANTIATE_TEST_CASE_P(MoreTests, 611 INSTANTIATE_TEST_CASE_P(MoreTests,
613 QuicCryptoServerStreamTestWithFailingProofSource, 612 QuicCryptoServerStreamTestWithFailingProofSource,
614 testing::Bool()); 613 testing::Bool());
615 614
616 TEST_P(QuicCryptoServerStreamTestWithFailingProofSource, Test) { 615 TEST_P(QuicCryptoServerStreamTestWithFailingProofSource, Test) {
617 Initialize(); 616 Initialize();
618 InitializeFakeClient(/* supports_stateless_rejects= */ false); 617 InitializeFakeClient(/* supports_stateless_rejects= */ false);
619 618
620 // Regression test for b/31521252, in which a crash would happen here. 619 // Regression test for b/31521252, in which a crash would happen here.
621 AdvanceHandshakeWithFakeClient(); 620 AdvanceHandshakeWithFakeClient();
622 EXPECT_FALSE(server_stream()->encryption_established()); 621 EXPECT_FALSE(server_stream()->encryption_established());
623 EXPECT_FALSE(server_stream()->handshake_confirmed()); 622 EXPECT_FALSE(server_stream()->handshake_confirmed());
624 } 623 }
625 624
626 } // namespace 625 } // namespace
627 626
628 } // namespace test 627 } // namespace test
629 } // namespace net 628 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_crypto_server_stream.cc ('k') | net/quic/quartc/quartc_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698