Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Side by Side Diff: net/quic/quic_http_stream_test.cc

Issue 12545035: Refactor QuicClientSession so that it owns the underlying socket (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test leak Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_connection_test.cc ('k') | net/quic/quic_stream_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/quic/quic_connection_test.cc ('k') | net/quic/quic_stream_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698