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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 send_algorithm_ = new MockSendAlgorithm(); | 169 send_algorithm_ = new MockSendAlgorithm(); |
170 receive_algorithm_ = new TestReceiveAlgorithm(NULL); | 170 receive_algorithm_ = new TestReceiveAlgorithm(NULL); |
171 EXPECT_CALL(*send_algorithm_, TimeUntilSend(_, _)). | 171 EXPECT_CALL(*send_algorithm_, TimeUntilSend(_, _)). |
172 WillRepeatedly(testing::Return(QuicTime::Delta::Zero())); | 172 WillRepeatedly(testing::Return(QuicTime::Delta::Zero())); |
173 helper_ = new QuicConnectionHelper(runner_.get(), &clock_, | 173 helper_ = new QuicConnectionHelper(runner_.get(), &clock_, |
174 &random_generator_, socket); | 174 &random_generator_, socket); |
175 connection_ = new TestQuicConnection(guid_, peer_addr_, helper_); | 175 connection_ = new TestQuicConnection(guid_, peer_addr_, helper_); |
176 connection_->set_visitor(&visitor_); | 176 connection_->set_visitor(&visitor_); |
177 connection_->SetSendAlgorithm(send_algorithm_); | 177 connection_->SetSendAlgorithm(send_algorithm_); |
178 connection_->SetReceiveAlgorithm(receive_algorithm_); | 178 connection_->SetReceiveAlgorithm(receive_algorithm_); |
179 session_.reset(new QuicClientSession(connection_, helper_, NULL, | 179 session_.reset(new QuicClientSession(connection_, socket, NULL, |
180 "www.google.com", NULL)); | 180 "www.google.com", NULL)); |
181 CryptoHandshakeMessage message = | 181 CryptoHandshakeMessage message = |
182 CreateShloMessage(&clock_, &random_generator_, "www.google.com"); | 182 CreateShloMessage(&clock_, &random_generator_, "www.google.com"); |
183 session_->GetCryptoStream()->CryptoConnect(); | 183 session_->GetCryptoStream()->CryptoConnect(); |
184 session_->GetCryptoStream()->OnHandshakeMessage(message); | 184 session_->GetCryptoStream()->OnHandshakeMessage(message); |
185 EXPECT_TRUE(session_->IsCryptoHandshakeComplete()); | 185 EXPECT_TRUE(session_->IsCryptoHandshakeComplete()); |
186 QuicReliableClientStream* stream = | 186 QuicReliableClientStream* stream = |
187 session_->CreateOutgoingReliableStream(); | 187 session_->CreateOutgoingReliableStream(); |
188 stream_.reset(use_closing_stream_ ? | 188 stream_.reset(use_closing_stream_ ? |
189 new AutoClosingStream(stream) : | 189 new AutoClosingStream(stream) : |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 | 572 |
573 // In the course of processing this packet, the QuicHttpStream close itself. | 573 // In the course of processing this packet, the QuicHttpStream close itself. |
574 ProcessPacket(*resp); | 574 ProcessPacket(*resp); |
575 | 575 |
576 EXPECT_TRUE(AtEof()); | 576 EXPECT_TRUE(AtEof()); |
577 } | 577 } |
578 | 578 |
579 } // namespace test | 579 } // namespace test |
580 | 580 |
581 } // namespace net | 581 } // namespace net |
OLD | NEW |