| 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/net_errors.h" | 9 #include "net/base/net_errors.h" |
| 10 #include "net/base/test_completion_callback.h" | 10 #include "net/base/test_completion_callback.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 const uint16 kServerPort = 80; | 53 const uint16 kServerPort = 80; |
| 54 | 54 |
| 55 class TestQuicConnection : public QuicConnection { | 55 class TestQuicConnection : public QuicConnection { |
| 56 public: | 56 public: |
| 57 TestQuicConnection(const QuicVersionVector& versions, | 57 TestQuicConnection(const QuicVersionVector& versions, |
| 58 QuicConnectionId connection_id, | 58 QuicConnectionId connection_id, |
| 59 IPEndPoint address, | 59 IPEndPoint address, |
| 60 QuicConnectionHelper* helper, | 60 QuicConnectionHelper* helper, |
| 61 QuicPacketWriter* writer) | 61 QuicPacketWriter* writer) |
| 62 : QuicConnection(connection_id, address, helper, writer, false, | 62 : QuicConnection(connection_id, address, helper, writer, false, |
| 63 versions, kInitialFlowControlWindowForTest) { | 63 versions) { |
| 64 } | 64 } |
| 65 | 65 |
| 66 void SetSendAlgorithm(SendAlgorithmInterface* send_algorithm) { | 66 void SetSendAlgorithm(SendAlgorithmInterface* send_algorithm) { |
| 67 QuicConnectionPeer::SetSendAlgorithm(this, send_algorithm); | 67 QuicConnectionPeer::SetSendAlgorithm(this, send_algorithm); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void SetReceiveAlgorithm(ReceiveAlgorithmInterface* receive_algorithm) { | 70 void SetReceiveAlgorithm(ReceiveAlgorithmInterface* receive_algorithm) { |
| 71 QuicConnectionPeer::SetReceiveAlgorithm(this, receive_algorithm); | 71 QuicConnectionPeer::SetReceiveAlgorithm(this, receive_algorithm); |
| 72 } | 72 } |
| 73 }; | 73 }; |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 connection_->SetReceiveAlgorithm(receive_algorithm_); | 205 connection_->SetReceiveAlgorithm(receive_algorithm_); |
| 206 crypto_config_.SetDefaults(); | 206 crypto_config_.SetDefaults(); |
| 207 session_.reset( | 207 session_.reset( |
| 208 new QuicClientSession(connection_, | 208 new QuicClientSession(connection_, |
| 209 scoped_ptr<DatagramClientSocket>(socket), | 209 scoped_ptr<DatagramClientSocket>(socket), |
| 210 writer_.Pass(), NULL, | 210 writer_.Pass(), NULL, |
| 211 &crypto_client_stream_factory_, | 211 &crypto_client_stream_factory_, |
| 212 make_scoped_ptr((QuicServerInfo*)NULL), | 212 make_scoped_ptr((QuicServerInfo*)NULL), |
| 213 QuicServerId(kServerHostname, kServerPort, | 213 QuicServerId(kServerHostname, kServerPort, |
| 214 false, PRIVACY_MODE_DISABLED), | 214 false, PRIVACY_MODE_DISABLED), |
| 215 DefaultQuicConfig(), &crypto_config_, NULL)); | 215 DefaultQuicConfig(), |
| 216 kInitialFlowControlWindowForTest, &crypto_config_, |
| 217 NULL)); |
| 216 session_->GetCryptoStream()->CryptoConnect(); | 218 session_->GetCryptoStream()->CryptoConnect(); |
| 217 EXPECT_TRUE(session_->IsCryptoHandshakeConfirmed()); | 219 EXPECT_TRUE(session_->IsCryptoHandshakeConfirmed()); |
| 218 stream_.reset(use_closing_stream_ ? | 220 stream_.reset(use_closing_stream_ ? |
| 219 new AutoClosingStream(session_->GetWeakPtr()) : | 221 new AutoClosingStream(session_->GetWeakPtr()) : |
| 220 new QuicHttpStream(session_->GetWeakPtr())); | 222 new QuicHttpStream(session_->GetWeakPtr())); |
| 221 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(20)); | 223 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(20)); |
| 222 } | 224 } |
| 223 | 225 |
| 224 void SetRequest(const std::string& method, | 226 void SetRequest(const std::string& method, |
| 225 const std::string& path, | 227 const std::string& path, |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 // Set Delegate to NULL and make sure EffectivePriority returns highest | 615 // Set Delegate to NULL and make sure EffectivePriority returns highest |
| 614 // priority. | 616 // priority. |
| 615 reliable_stream->SetDelegate(NULL); | 617 reliable_stream->SetDelegate(NULL); |
| 616 DCHECK_EQ(QuicWriteBlockedList::kHighestPriority, | 618 DCHECK_EQ(QuicWriteBlockedList::kHighestPriority, |
| 617 reliable_stream->EffectivePriority()); | 619 reliable_stream->EffectivePriority()); |
| 618 reliable_stream->SetDelegate(delegate); | 620 reliable_stream->SetDelegate(delegate); |
| 619 } | 621 } |
| 620 | 622 |
| 621 } // namespace test | 623 } // namespace test |
| 622 } // namespace net | 624 } // namespace net |
| OLD | NEW |