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