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

Unified Diff: net/quic/quic_connection_helper_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_connection_helper.cc ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_connection_helper_test.cc
diff --git a/net/quic/quic_connection_helper_test.cc b/net/quic/quic_connection_helper_test.cc
index 59ba5f7545a897e5c2b14e3882f2e1176fefe5f8..eeca0bf0647b42f1da1df1512ef5402b0da2c8d0 100644
--- a/net/quic/quic_connection_helper_test.cc
+++ b/net/quic/quic_connection_helper_test.cc
@@ -100,16 +100,16 @@ class QuicConnectionHelperTest : public ::testing::Test {
socket_data_.reset(new StaticSocketDataProvider(NULL, 0, mock_writes_.get(),
writes_.size()));
- MockUDPClientSocket* socket =
- new MockUDPClientSocket(socket_data_.get(), net_log_.net_log());
- socket->Connect(IPEndPoint());
+ socket_.reset(new MockUDPClientSocket(socket_data_.get(),
+ net_log_.net_log()));
+ socket_->Connect(IPEndPoint());
runner_ = new TestTaskRunner(&clock_);
- helper_.reset(new QuicConnectionHelper(runner_.get(), &clock_,
- &random_generator_, socket));
+ helper_ = new QuicConnectionHelper(runner_.get(), &clock_,
+ &random_generator_, socket_.get());
send_algorithm_ = new testing::StrictMock<MockSendAlgorithm>();
EXPECT_CALL(*send_algorithm_, TimeUntilSend(_, _, _)).
WillRepeatedly(testing::Return(QuicTime::Delta::Zero()));
- connection_.reset(new TestConnection(guid_, IPEndPoint(), helper_.get()));
+ connection_.reset(new TestConnection(guid_, IPEndPoint(), helper_));
connection_->set_visitor(&visitor_);
connection_->SetSendAlgorithm(send_algorithm_);
}
@@ -173,7 +173,8 @@ class QuicConnectionHelperTest : public ::testing::Test {
testing::StrictMock<MockSendAlgorithm>* send_algorithm_;
scoped_refptr<TestTaskRunner> runner_;
- scoped_ptr<QuicConnectionHelper> helper_;
+ QuicConnectionHelper* helper_;
+ scoped_ptr<MockUDPClientSocket> socket_;
scoped_array<MockWrite> mock_writes_;
MockClock clock_;
MockRandom random_generator_;
« no previous file with comments | « net/quic/quic_connection_helper.cc ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698