| 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" |
| 11 #include "net/base/upload_bytes_element_reader.h" | 11 #include "net/base/upload_bytes_element_reader.h" |
| 12 #include "net/base/upload_data_stream.h" | 12 #include "net/base/upload_data_stream.h" |
| 13 #include "net/http/http_response_headers.h" | 13 #include "net/http/http_response_headers.h" |
| 14 #include "net/http/transport_security_state.h" |
| 14 #include "net/quic/congestion_control/receive_algorithm_interface.h" | 15 #include "net/quic/congestion_control/receive_algorithm_interface.h" |
| 15 #include "net/quic/congestion_control/send_algorithm_interface.h" | 16 #include "net/quic/congestion_control/send_algorithm_interface.h" |
| 16 #include "net/quic/crypto/crypto_protocol.h" | 17 #include "net/quic/crypto/crypto_protocol.h" |
| 17 #include "net/quic/crypto/quic_decrypter.h" | 18 #include "net/quic/crypto/quic_decrypter.h" |
| 18 #include "net/quic/crypto/quic_encrypter.h" | 19 #include "net/quic/crypto/quic_encrypter.h" |
| 19 #include "net/quic/crypto/quic_server_info.h" | 20 #include "net/quic/crypto/quic_server_info.h" |
| 20 #include "net/quic/quic_client_session.h" | 21 #include "net/quic/quic_client_session.h" |
| 21 #include "net/quic/quic_connection.h" | 22 #include "net/quic/quic_connection.h" |
| 22 #include "net/quic/quic_connection_helper.h" | 23 #include "net/quic/quic_connection_helper.h" |
| 23 #include "net/quic/quic_default_packet_writer.h" | 24 #include "net/quic/quic_default_packet_writer.h" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 helper_.get(), writer_.get()); | 208 helper_.get(), writer_.get()); |
| 208 connection_->set_visitor(&visitor_); | 209 connection_->set_visitor(&visitor_); |
| 209 connection_->SetSendAlgorithm(send_algorithm_); | 210 connection_->SetSendAlgorithm(send_algorithm_); |
| 210 connection_->SetReceiveAlgorithm(receive_algorithm_); | 211 connection_->SetReceiveAlgorithm(receive_algorithm_); |
| 211 crypto_config_.SetDefaults(); | 212 crypto_config_.SetDefaults(); |
| 212 session_.reset( | 213 session_.reset( |
| 213 new QuicClientSession(connection_, | 214 new QuicClientSession(connection_, |
| 214 scoped_ptr<DatagramClientSocket>(socket), | 215 scoped_ptr<DatagramClientSocket>(socket), |
| 215 writer_.Pass(), NULL, | 216 writer_.Pass(), NULL, |
| 216 &crypto_client_stream_factory_, | 217 &crypto_client_stream_factory_, |
| 218 &transport_security_state_, |
| 217 make_scoped_ptr((QuicServerInfo*)NULL), | 219 make_scoped_ptr((QuicServerInfo*)NULL), |
| 218 QuicServerId(kServerHostname, kServerPort, | 220 QuicServerId(kServerHostname, kServerPort, |
| 219 false, PRIVACY_MODE_DISABLED), | 221 false, PRIVACY_MODE_DISABLED), |
| 220 DefaultQuicConfig(), &crypto_config_, | 222 DefaultQuicConfig(), &crypto_config_, |
| 221 base::MessageLoop::current()-> | 223 base::MessageLoop::current()-> |
| 222 message_loop_proxy().get(), | 224 message_loop_proxy().get(), |
| 223 NULL)); | 225 NULL)); |
| 224 session_->InitializeSession(); | 226 session_->InitializeSession(); |
| 225 session_->GetCryptoStream()->CryptoConnect(); | 227 session_->GetCryptoStream()->CryptoConnect(); |
| 226 EXPECT_TRUE(session_->IsCryptoHandshakeConfirmed()); | 228 EXPECT_TRUE(session_->IsCryptoHandshakeConfirmed()); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 MockSendAlgorithm* send_algorithm_; | 294 MockSendAlgorithm* send_algorithm_; |
| 293 TestReceiveAlgorithm* receive_algorithm_; | 295 TestReceiveAlgorithm* receive_algorithm_; |
| 294 scoped_refptr<TestTaskRunner> runner_; | 296 scoped_refptr<TestTaskRunner> runner_; |
| 295 scoped_ptr<MockWrite[]> mock_writes_; | 297 scoped_ptr<MockWrite[]> mock_writes_; |
| 296 MockClock clock_; | 298 MockClock clock_; |
| 297 TestQuicConnection* connection_; | 299 TestQuicConnection* connection_; |
| 298 scoped_ptr<QuicConnectionHelper> helper_; | 300 scoped_ptr<QuicConnectionHelper> helper_; |
| 299 testing::StrictMock<MockConnectionVisitor> visitor_; | 301 testing::StrictMock<MockConnectionVisitor> visitor_; |
| 300 scoped_ptr<QuicHttpStream> stream_; | 302 scoped_ptr<QuicHttpStream> stream_; |
| 301 scoped_ptr<QuicDefaultPacketWriter> writer_; | 303 scoped_ptr<QuicDefaultPacketWriter> writer_; |
| 304 TransportSecurityState transport_security_state_; |
| 302 scoped_ptr<QuicClientSession> session_; | 305 scoped_ptr<QuicClientSession> session_; |
| 303 QuicCryptoClientConfig crypto_config_; | 306 QuicCryptoClientConfig crypto_config_; |
| 304 TestCompletionCallback callback_; | 307 TestCompletionCallback callback_; |
| 305 HttpRequestInfo request_; | 308 HttpRequestInfo request_; |
| 306 HttpRequestHeaders headers_; | 309 HttpRequestHeaders headers_; |
| 307 HttpResponseInfo response_; | 310 HttpResponseInfo response_; |
| 308 scoped_refptr<IOBufferWithSize> read_buffer_; | 311 scoped_refptr<IOBufferWithSize> read_buffer_; |
| 309 SpdyHeaderBlock request_headers_; | 312 SpdyHeaderBlock request_headers_; |
| 310 SpdyHeaderBlock response_headers_; | 313 SpdyHeaderBlock response_headers_; |
| 311 std::string request_data_; | 314 std::string request_data_; |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 // Set Delegate to NULL and make sure EffectivePriority returns highest | 621 // Set Delegate to NULL and make sure EffectivePriority returns highest |
| 619 // priority. | 622 // priority. |
| 620 reliable_stream->SetDelegate(NULL); | 623 reliable_stream->SetDelegate(NULL); |
| 621 DCHECK_EQ(QuicWriteBlockedList::kHighestPriority, | 624 DCHECK_EQ(QuicWriteBlockedList::kHighestPriority, |
| 622 reliable_stream->EffectivePriority()); | 625 reliable_stream->EffectivePriority()); |
| 623 reliable_stream->SetDelegate(delegate); | 626 reliable_stream->SetDelegate(delegate); |
| 624 } | 627 } |
| 625 | 628 |
| 626 } // namespace test | 629 } // namespace test |
| 627 } // namespace net | 630 } // namespace net |
| OLD | NEW |