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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 receive_algorithm_ = new TestReceiveAlgorithm(NULL); | 167 receive_algorithm_ = new TestReceiveAlgorithm(NULL); |
168 EXPECT_CALL(*send_algorithm_, TimeUntilSend(_)). | 168 EXPECT_CALL(*send_algorithm_, TimeUntilSend(_)). |
169 WillRepeatedly(testing::Return(QuicTime::Delta::Zero())); | 169 WillRepeatedly(testing::Return(QuicTime::Delta::Zero())); |
170 helper_ = new QuicConnectionHelper(runner_.get(), &clock_, | 170 helper_ = new QuicConnectionHelper(runner_.get(), &clock_, |
171 &random_generator_, socket); | 171 &random_generator_, socket); |
172 connection_ = new TestQuicConnection(guid_, peer_addr_, helper_); | 172 connection_ = new TestQuicConnection(guid_, peer_addr_, helper_); |
173 connection_->set_visitor(&visitor_); | 173 connection_->set_visitor(&visitor_); |
174 connection_->SetSendAlgorithm(send_algorithm_); | 174 connection_->SetSendAlgorithm(send_algorithm_); |
175 connection_->SetReceiveAlgorithm(receive_algorithm_); | 175 connection_->SetReceiveAlgorithm(receive_algorithm_); |
176 session_.reset(new QuicClientSession(connection_, helper_, NULL, | 176 session_.reset(new QuicClientSession(connection_, helper_, NULL, |
177 "www.google.com")); | 177 "www.google.com", NULL)); |
178 CryptoHandshakeMessage message; | 178 CryptoHandshakeMessage message; |
179 message.tag = kSHLO; | 179 message.tag = kSHLO; |
180 session_->GetCryptoStream()->OnHandshakeMessage(message); | 180 session_->GetCryptoStream()->OnHandshakeMessage(message); |
181 EXPECT_TRUE(session_->IsCryptoHandshakeComplete()); | 181 EXPECT_TRUE(session_->IsCryptoHandshakeComplete()); |
182 QuicReliableClientStream* stream = | 182 QuicReliableClientStream* stream = |
183 session_->CreateOutgoingReliableStream(); | 183 session_->CreateOutgoingReliableStream(); |
184 stream_.reset(use_closing_stream_ ? | 184 stream_.reset(use_closing_stream_ ? |
185 new AutoClosingStream(stream, GetParam()) : | 185 new AutoClosingStream(stream, GetParam()) : |
186 new QuicHttpStream(stream, GetParam())); | 186 new QuicHttpStream(stream, GetParam())); |
187 } | 187 } |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 | 496 |
497 // In the course of processing this packet, the QuicHttpStream close itself. | 497 // In the course of processing this packet, the QuicHttpStream close itself. |
498 ProcessPacket(*resp); | 498 ProcessPacket(*resp); |
499 | 499 |
500 EXPECT_TRUE(AtEof()); | 500 EXPECT_TRUE(AtEof()); |
501 } | 501 } |
502 | 502 |
503 } // namespace test | 503 } // namespace test |
504 | 504 |
505 } // namespace net | 505 } // namespace net |
OLD | NEW |