OLD | NEW |
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/tools/quic/quic_server_session_base.h" | 5 #include "net/tools/quic/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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 CryptoTestUtils::ProofSourceForTesting()), | 127 CryptoTestUtils::ProofSourceForTesting()), |
128 compressed_certs_cache_( | 128 compressed_certs_cache_( |
129 QuicCompressedCertsCache::kQuicCompressedCertsCacheSize) { | 129 QuicCompressedCertsCache::kQuicCompressedCertsCacheSize) { |
130 FLAGS_quic_always_log_bugs_for_tests = true; | 130 FLAGS_quic_always_log_bugs_for_tests = true; |
131 config_.SetMaxStreamsPerConnection(kMaxStreamsForTest, kMaxStreamsForTest); | 131 config_.SetMaxStreamsPerConnection(kMaxStreamsForTest, kMaxStreamsForTest); |
132 config_.SetInitialStreamFlowControlWindowToSend( | 132 config_.SetInitialStreamFlowControlWindowToSend( |
133 kInitialStreamFlowControlWindowForTest); | 133 kInitialStreamFlowControlWindowForTest); |
134 config_.SetInitialSessionFlowControlWindowToSend( | 134 config_.SetInitialSessionFlowControlWindowToSend( |
135 kInitialSessionFlowControlWindowForTest); | 135 kInitialSessionFlowControlWindowForTest); |
136 | 136 |
137 connection_ = new StrictMock<MockConnection>( | 137 connection_ = new StrictMock<MockConnection>(&helper_, &alarm_factory_, |
138 &helper_, Perspective::IS_SERVER, SupportedVersions(GetParam())); | 138 Perspective::IS_SERVER, |
| 139 SupportedVersions(GetParam())); |
139 session_.reset(new TestServerSession(config_, connection_, &owner_, | 140 session_.reset(new TestServerSession(config_, connection_, &owner_, |
140 &crypto_config_, | 141 &crypto_config_, |
141 &compressed_certs_cache_)); | 142 &compressed_certs_cache_)); |
142 MockClock clock; | 143 MockClock clock; |
143 handshake_message_.reset(crypto_config_.AddDefaultConfig( | 144 handshake_message_.reset(crypto_config_.AddDefaultConfig( |
144 QuicRandom::GetInstance(), &clock, | 145 QuicRandom::GetInstance(), &clock, |
145 QuicCryptoServerConfig::ConfigOptions())); | 146 QuicCryptoServerConfig::ConfigOptions())); |
146 session_->Initialize(); | 147 session_->Initialize(); |
147 visitor_ = QuicConnectionPeer::GetVisitor(connection_); | 148 visitor_ = QuicConnectionPeer::GetVisitor(connection_); |
148 } | 149 } |
149 | 150 |
150 StrictMock<MockQuicServerSessionVisitor> owner_; | 151 StrictMock<MockQuicServerSessionVisitor> owner_; |
151 MockConnectionHelper helper_; | 152 MockConnectionHelper helper_; |
| 153 MockAlarmFactory alarm_factory_; |
152 StrictMock<MockConnection>* connection_; | 154 StrictMock<MockConnection>* connection_; |
153 QuicConfig config_; | 155 QuicConfig config_; |
154 QuicCryptoServerConfig crypto_config_; | 156 QuicCryptoServerConfig crypto_config_; |
155 QuicCompressedCertsCache compressed_certs_cache_; | 157 QuicCompressedCertsCache compressed_certs_cache_; |
156 std::unique_ptr<TestServerSession> session_; | 158 std::unique_ptr<TestServerSession> session_; |
157 std::unique_ptr<CryptoHandshakeMessage> handshake_message_; | 159 std::unique_ptr<CryptoHandshakeMessage> handshake_message_; |
158 QuicConnectionVisitorInterface* visitor_; | 160 QuicConnectionVisitorInterface* visitor_; |
159 }; | 161 }; |
160 | 162 |
161 // Compares CachedNetworkParameters. | 163 // Compares CachedNetworkParameters. |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 EXPECT_FALSE( | 549 EXPECT_FALSE( |
548 QuicServerSessionBasePeer::IsBandwidthResumptionEnabled(session_.get())); | 550 QuicServerSessionBasePeer::IsBandwidthResumptionEnabled(session_.get())); |
549 session_->OnConfigNegotiated(); | 551 session_->OnConfigNegotiated(); |
550 EXPECT_FALSE( | 552 EXPECT_FALSE( |
551 QuicServerSessionBasePeer::IsBandwidthResumptionEnabled(session_.get())); | 553 QuicServerSessionBasePeer::IsBandwidthResumptionEnabled(session_.get())); |
552 } | 554 } |
553 | 555 |
554 } // namespace | 556 } // namespace |
555 } // namespace test | 557 } // namespace test |
556 } // namespace net | 558 } // namespace net |
OLD | NEW |