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