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

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

Issue 2671333004: Convert class-full-of-statics CryptoTestUtils into a namespace (Closed)
Patch Set: Created 3 years, 10 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/quic/core/quic_crypto_stream_test.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_server_session_base.h" 5 #include "net/quic/core/quic_server_session_base.h"
6 6
7 #include <cstdint> 7 #include <cstdint>
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 113
114 private: 114 private:
115 QuicHttpResponseCache* response_cache_; // Owned by QuicServerSessionBaseTest 115 QuicHttpResponseCache* response_cache_; // Owned by QuicServerSessionBaseTest
116 }; 116 };
117 117
118 const size_t kMaxStreamsForTest = 10; 118 const size_t kMaxStreamsForTest = 10;
119 119
120 class QuicServerSessionBaseTest : public ::testing::TestWithParam<QuicVersion> { 120 class QuicServerSessionBaseTest : public ::testing::TestWithParam<QuicVersion> {
121 protected: 121 protected:
122 QuicServerSessionBaseTest() 122 QuicServerSessionBaseTest()
123 : QuicServerSessionBaseTest(CryptoTestUtils::ProofSourceForTesting()) {} 123 : QuicServerSessionBaseTest(crypto_test_utils::ProofSourceForTesting()) {}
124 124
125 explicit QuicServerSessionBaseTest(std::unique_ptr<ProofSource> proof_source) 125 explicit QuicServerSessionBaseTest(std::unique_ptr<ProofSource> proof_source)
126 : crypto_config_(QuicCryptoServerConfig::TESTING, 126 : crypto_config_(QuicCryptoServerConfig::TESTING,
127 QuicRandom::GetInstance(), 127 QuicRandom::GetInstance(),
128 std::move(proof_source)), 128 std::move(proof_source)),
129 compressed_certs_cache_( 129 compressed_certs_cache_(
130 QuicCompressedCertsCache::kQuicCompressedCertsCacheSize) { 130 QuicCompressedCertsCache::kQuicCompressedCertsCacheSize) {
131 config_.SetMaxStreamsPerConnection(kMaxStreamsForTest, kMaxStreamsForTest); 131 config_.SetMaxStreamsPerConnection(kMaxStreamsForTest, kMaxStreamsForTest);
132 config_.SetMaxIncomingDynamicStreamsToSend(kMaxStreamsForTest); 132 config_.SetMaxIncomingDynamicStreamsToSend(kMaxStreamsForTest);
133 QuicConfigPeer::SetReceivedMaxIncomingDynamicStreams(&config_, 133 QuicConfigPeer::SetReceivedMaxIncomingDynamicStreams(&config_,
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 // ProofSource::GetProof. Delay the completion of the operation until after the 602 // ProofSource::GetProof. Delay the completion of the operation until after the
603 // stream has been destroyed, and verify that there are no memory bugs. 603 // stream has been destroyed, and verify that there are no memory bugs.
604 TEST_P(StreamMemberLifetimeTest, Basic) { 604 TEST_P(StreamMemberLifetimeTest, Basic) {
605 FLAGS_quic_reloadable_flag_enable_async_get_proof = true; 605 FLAGS_quic_reloadable_flag_enable_async_get_proof = true;
606 FLAGS_quic_reloadable_flag_enable_quic_stateless_reject_support = true; 606 FLAGS_quic_reloadable_flag_enable_quic_stateless_reject_support = true;
607 FLAGS_quic_reloadable_flag_quic_use_cheap_stateless_rejects = true; 607 FLAGS_quic_reloadable_flag_quic_use_cheap_stateless_rejects = true;
608 FLAGS_quic_reloadable_flag_quic_create_session_after_insertion = true; 608 FLAGS_quic_reloadable_flag_quic_create_session_after_insertion = true;
609 609
610 const QuicClock* clock = helper_.GetClock(); 610 const QuicClock* clock = helper_.GetClock();
611 QuicVersion version = AllSupportedVersions().front(); 611 QuicVersion version = AllSupportedVersions().front();
612 CryptoHandshakeMessage chlo = CryptoTestUtils::GenerateDefaultInchoateCHLO( 612 CryptoHandshakeMessage chlo = crypto_test_utils::GenerateDefaultInchoateCHLO(
613 clock, version, &crypto_config_); 613 clock, version, &crypto_config_);
614 chlo.SetVector(kCOPT, QuicTagVector{kSREJ}); 614 chlo.SetVector(kCOPT, QuicTagVector{kSREJ});
615 std::vector<QuicVersion> packet_version_list = {version}; 615 std::vector<QuicVersion> packet_version_list = {version};
616 std::unique_ptr<QuicEncryptedPacket> packet(ConstructEncryptedPacket( 616 std::unique_ptr<QuicEncryptedPacket> packet(ConstructEncryptedPacket(
617 1, true, false, false, kDefaultPathId, 1, 617 1, true, false, false, kDefaultPathId, 1,
618 chlo.GetSerialized().AsStringPiece().as_string(), 618 chlo.GetSerialized().AsStringPiece().as_string(),
619 PACKET_8BYTE_CONNECTION_ID, PACKET_6BYTE_PACKET_NUMBER, 619 PACKET_8BYTE_CONNECTION_ID, PACKET_6BYTE_PACKET_NUMBER,
620 &packet_version_list)); 620 &packet_version_list));
621 621
622 EXPECT_CALL(stream_helper_, CanAcceptClientHello(_, _, _)) 622 EXPECT_CALL(stream_helper_, CanAcceptClientHello(_, _, _))
(...skipping 20 matching lines...) Expand all
643 643
644 // Allow the async ProofSource::GetProof call to complete. Verify (under 644 // Allow the async ProofSource::GetProof call to complete. Verify (under
645 // asan) that this does not result in accesses to any freed memory from the 645 // asan) that this does not result in accesses to any freed memory from the
646 // session or its subobjects. 646 // session or its subobjects.
647 GetFakeProofSource()->InvokePendingCallback(0); 647 GetFakeProofSource()->InvokePendingCallback(0);
648 } 648 }
649 649
650 } // namespace 650 } // namespace
651 } // namespace test 651 } // namespace test
652 } // namespace net 652 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_crypto_stream_test.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