OLD | NEW |
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/quic_http_stream.h" | 5 #include "net/quic/quic_http_stream.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "net/base/chunked_upload_data_stream.h" | 9 #include "net/base/chunked_upload_data_stream.h" |
10 #include "net/base/elements_upload_data_stream.h" | 10 #include "net/base/elements_upload_data_stream.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 public: | 58 public: |
59 TestQuicConnection(const QuicVersionVector& versions, | 59 TestQuicConnection(const QuicVersionVector& versions, |
60 QuicConnectionId connection_id, | 60 QuicConnectionId connection_id, |
61 IPEndPoint address, | 61 IPEndPoint address, |
62 QuicConnectionHelper* helper, | 62 QuicConnectionHelper* helper, |
63 const QuicConnection::PacketWriterFactory& writer_factory) | 63 const QuicConnection::PacketWriterFactory& writer_factory) |
64 : QuicConnection(connection_id, | 64 : QuicConnection(connection_id, |
65 address, | 65 address, |
66 helper, | 66 helper, |
67 writer_factory, | 67 writer_factory, |
68 true /* owns_writer */, | 68 true /* owns_writer */, |
69 false /* is_server */, | 69 false /* is_server */, |
| 70 false /* is_secure */, |
70 versions) { | 71 versions) { |
71 } | 72 } |
72 | 73 |
73 void SetSendAlgorithm(SendAlgorithmInterface* send_algorithm) { | 74 void SetSendAlgorithm(SendAlgorithmInterface* send_algorithm) { |
74 QuicConnectionPeer::SetSendAlgorithm(this, send_algorithm); | 75 QuicConnectionPeer::SetSendAlgorithm(this, send_algorithm); |
75 } | 76 } |
76 | 77 |
77 void SetReceiveAlgorithm(ReceiveAlgorithmInterface* receive_algorithm) { | 78 void SetReceiveAlgorithm(ReceiveAlgorithmInterface* receive_algorithm) { |
78 QuicConnectionPeer::SetReceiveAlgorithm(this, receive_algorithm); | 79 QuicConnectionPeer::SetReceiveAlgorithm(this, receive_algorithm); |
79 } | 80 } |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 EXPECT_CALL(*send_algorithm_, | 209 EXPECT_CALL(*send_algorithm_, |
209 OnPacketSent(_, _, _, _, _)).WillRepeatedly(Return(true)); | 210 OnPacketSent(_, _, _, _, _)).WillRepeatedly(Return(true)); |
210 EXPECT_CALL(*send_algorithm_, RetransmissionDelay()).WillRepeatedly( | 211 EXPECT_CALL(*send_algorithm_, RetransmissionDelay()).WillRepeatedly( |
211 Return(QuicTime::Delta::Zero())); | 212 Return(QuicTime::Delta::Zero())); |
212 EXPECT_CALL(*send_algorithm_, GetCongestionWindow()).WillRepeatedly( | 213 EXPECT_CALL(*send_algorithm_, GetCongestionWindow()).WillRepeatedly( |
213 Return(kMaxPacketSize)); | 214 Return(kMaxPacketSize)); |
214 EXPECT_CALL(*send_algorithm_, TimeUntilSend(_, _, _)). | 215 EXPECT_CALL(*send_algorithm_, TimeUntilSend(_, _, _)). |
215 WillRepeatedly(Return(QuicTime::Delta::Zero())); | 216 WillRepeatedly(Return(QuicTime::Delta::Zero())); |
216 EXPECT_CALL(*send_algorithm_, BandwidthEstimate()).WillRepeatedly( | 217 EXPECT_CALL(*send_algorithm_, BandwidthEstimate()).WillRepeatedly( |
217 Return(QuicBandwidth::Zero())); | 218 Return(QuicBandwidth::Zero())); |
218 EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _)).Times(AnyNumber()); | 219 EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _, _)).Times(AnyNumber()); |
219 helper_.reset(new QuicConnectionHelper(runner_.get(), &clock_, | 220 helper_.reset(new QuicConnectionHelper(runner_.get(), &clock_, |
220 &random_generator_)); | 221 &random_generator_)); |
221 TestPacketWriterFactory writer_factory(socket); | 222 TestPacketWriterFactory writer_factory(socket); |
222 connection_ = new TestQuicConnection(SupportedVersions(GetParam()), | 223 connection_ = new TestQuicConnection(SupportedVersions(GetParam()), |
223 connection_id_, peer_addr_, | 224 connection_id_, peer_addr_, |
224 helper_.get(), writer_factory); | 225 helper_.get(), writer_factory); |
225 connection_->set_visitor(&visitor_); | 226 connection_->set_visitor(&visitor_); |
226 connection_->SetSendAlgorithm(send_algorithm_); | 227 connection_->SetSendAlgorithm(send_algorithm_); |
227 connection_->SetReceiveAlgorithm(receive_algorithm_); | 228 connection_->SetReceiveAlgorithm(receive_algorithm_); |
228 session_.reset( | 229 session_.reset( |
229 new QuicClientSession(connection_, | 230 new QuicClientSession(connection_, |
230 scoped_ptr<DatagramClientSocket>(socket), | 231 scoped_ptr<DatagramClientSocket>(socket), |
231 nullptr, | 232 nullptr, |
232 &transport_security_state_, | 233 &transport_security_state_, |
233 make_scoped_ptr((QuicServerInfo*)nullptr), | 234 make_scoped_ptr((QuicServerInfo*)nullptr), |
234 DefaultQuicConfig(), | 235 DefaultQuicConfig(), |
235 /*is_secure=*/false, | |
236 base::MessageLoop::current()-> | 236 base::MessageLoop::current()-> |
237 message_loop_proxy().get(), | 237 message_loop_proxy().get(), |
238 nullptr)); | 238 nullptr)); |
239 session_->InitializeSession(QuicServerId(kServerHostname, kServerPort, | 239 session_->InitializeSession(QuicServerId(kServerHostname, kServerPort, |
240 /*is_secure=*/false, | 240 /*is_secure=*/false, |
241 PRIVACY_MODE_DISABLED), | 241 PRIVACY_MODE_DISABLED), |
242 &crypto_config_, | 242 &crypto_config_, |
243 &crypto_client_stream_factory_); | 243 &crypto_client_stream_factory_); |
244 session_->GetCryptoStream()->CryptoConnect(); | 244 session_->GetCryptoStream()->CryptoConnect(); |
245 EXPECT_TRUE(session_->IsCryptoHandshakeConfirmed()); | 245 EXPECT_TRUE(session_->IsCryptoHandshakeConfirmed()); |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 // Set Delegate to nullptr and make sure EffectivePriority returns highest | 774 // Set Delegate to nullptr and make sure EffectivePriority returns highest |
775 // priority. | 775 // priority. |
776 reliable_stream->SetDelegate(nullptr); | 776 reliable_stream->SetDelegate(nullptr); |
777 DCHECK_EQ(QuicWriteBlockedList::kHighestPriority, | 777 DCHECK_EQ(QuicWriteBlockedList::kHighestPriority, |
778 reliable_stream->EffectivePriority()); | 778 reliable_stream->EffectivePriority()); |
779 reliable_stream->SetDelegate(delegate); | 779 reliable_stream->SetDelegate(delegate); |
780 } | 780 } |
781 | 781 |
782 } // namespace test | 782 } // namespace test |
783 } // namespace net | 783 } // namespace net |
OLD | NEW |