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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 connection_id_, peer_addr_, | 201 connection_id_, peer_addr_, |
202 helper_.get(), writer_.get()); | 202 helper_.get(), writer_.get()); |
203 connection_->set_visitor(&visitor_); | 203 connection_->set_visitor(&visitor_); |
204 connection_->SetSendAlgorithm(send_algorithm_); | 204 connection_->SetSendAlgorithm(send_algorithm_); |
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_, | |
212 make_scoped_ptr((QuicServerInfo*)NULL), | 211 make_scoped_ptr((QuicServerInfo*)NULL), |
213 QuicServerId(kServerHostname, kServerPort, | 212 DefaultQuicConfig(), |
214 false, PRIVACY_MODE_DISABLED), | |
215 DefaultQuicConfig(), &crypto_config_, | |
216 base::MessageLoop::current()-> | 213 base::MessageLoop::current()-> |
217 message_loop_proxy().get(), | 214 message_loop_proxy().get(), |
218 NULL)); | 215 NULL)); |
| 216 session_->InitializeSession(QuicServerId(kServerHostname, kServerPort, |
| 217 false, PRIVACY_MODE_DISABLED), |
| 218 &crypto_config_, |
| 219 &crypto_client_stream_factory_); |
219 session_->GetCryptoStream()->CryptoConnect(); | 220 session_->GetCryptoStream()->CryptoConnect(); |
220 EXPECT_TRUE(session_->IsCryptoHandshakeConfirmed()); | 221 EXPECT_TRUE(session_->IsCryptoHandshakeConfirmed()); |
221 stream_.reset(use_closing_stream_ ? | 222 stream_.reset(use_closing_stream_ ? |
222 new AutoClosingStream(session_->GetWeakPtr()) : | 223 new AutoClosingStream(session_->GetWeakPtr()) : |
223 new QuicHttpStream(session_->GetWeakPtr())); | 224 new QuicHttpStream(session_->GetWeakPtr())); |
224 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(20)); | 225 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(20)); |
225 } | 226 } |
226 | 227 |
227 void SetRequest(const std::string& method, | 228 void SetRequest(const std::string& method, |
228 const std::string& path, | 229 const std::string& path, |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 // Set Delegate to NULL and make sure EffectivePriority returns highest | 613 // Set Delegate to NULL and make sure EffectivePriority returns highest |
613 // priority. | 614 // priority. |
614 reliable_stream->SetDelegate(NULL); | 615 reliable_stream->SetDelegate(NULL); |
615 DCHECK_EQ(QuicWriteBlockedList::kHighestPriority, | 616 DCHECK_EQ(QuicWriteBlockedList::kHighestPriority, |
616 reliable_stream->EffectivePriority()); | 617 reliable_stream->EffectivePriority()); |
617 reliable_stream->SetDelegate(delegate); | 618 reliable_stream->SetDelegate(delegate); |
618 } | 619 } |
619 | 620 |
620 } // namespace test | 621 } // namespace test |
621 } // namespace net | 622 } // namespace net |
OLD | NEW |