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

Unified Diff: net/quic/quic_session_test.cc

Issue 1680643002: Refactor gmock_mutant.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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_chromium_client_stream_test.cc ('k') | net/quic/quic_stream_sequencer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_session_test.cc
diff --git a/net/quic/quic_session_test.cc b/net/quic/quic_session_test.cc
index 07b1fc7b8e60298a8ea7068aa11b5b97432dd045..dc85ba102f1bf05451e13e88e434257e53848f2f 100644
--- a/net/quic/quic_session_test.cc
+++ b/net/quic/quic_session_test.cc
@@ -441,13 +441,15 @@ TEST_P(QuicSessionTestServer, TestBatchedWrites) {
InSequence s;
EXPECT_CALL(*stream2, OnCanWrite())
.WillOnce(DoAll(testing::IgnoreResult(Invoke(CreateFunctor(
- &session_, &TestSession::SendLargeFakeData,
+ &TestSession::SendLargeFakeData,
+ base::Unretained(&session_),
stream2->id(), 6000))),
Invoke(&stream2_blocker,
&StreamBlocker::MarkConnectionLevelWriteBlocked)));
EXPECT_CALL(*stream2, OnCanWrite())
.WillOnce(DoAll(testing::IgnoreResult(Invoke(CreateFunctor(
- &session_, &TestSession::SendLargeFakeData,
+ &TestSession::SendLargeFakeData,
+ base::Unretained(&session_),
stream2->id(), 6000))),
Invoke(&stream2_blocker,
&StreamBlocker::MarkConnectionLevelWriteBlocked)));
@@ -457,13 +459,15 @@ TEST_P(QuicSessionTestServer, TestBatchedWrites) {
// write quota and we move over to stream 4.
EXPECT_CALL(*stream2, OnCanWrite())
.WillOnce(DoAll(testing::IgnoreResult(Invoke(CreateFunctor(
- &session_, &TestSession::SendLargeFakeData,
+ &TestSession::SendLargeFakeData,
+ base::Unretained(&session_),
stream2->id(), 6000))),
Invoke(&stream2_blocker,
&StreamBlocker::MarkConnectionLevelWriteBlocked)));
EXPECT_CALL(*stream4, OnCanWrite())
.WillOnce(DoAll(testing::IgnoreResult(Invoke(CreateFunctor(
- &session_, &TestSession::SendLargeFakeData,
+ &TestSession::SendLargeFakeData,
+ base::Unretained(&session_),
stream4->id(), 6000))),
Invoke(&stream4_blocker,
&StreamBlocker::MarkConnectionLevelWriteBlocked)));
@@ -475,7 +479,8 @@ TEST_P(QuicSessionTestServer, TestBatchedWrites) {
stream6->SetPriority(kHighestPriority);
EXPECT_CALL(*stream4, OnCanWrite())
.WillOnce(DoAll(testing::IgnoreResult(Invoke(CreateFunctor(
- &session_, &TestSession::SendLargeFakeData,
+ &TestSession::SendLargeFakeData,
+ base::Unretained(&session_),
stream4->id(), 6000))),
Invoke(&stream4_blocker,
&StreamBlocker::MarkConnectionLevelWriteBlocked),
@@ -483,20 +488,23 @@ TEST_P(QuicSessionTestServer, TestBatchedWrites) {
&StreamBlocker::MarkHighPriorityWriteBlocked)));
EXPECT_CALL(*stream6, OnCanWrite())
.WillOnce(testing::IgnoreResult(Invoke(CreateFunctor(
- &session_, &TestSession::SendLargeFakeData, stream4->id(), 6000))));
+ &TestSession::SendLargeFakeData,
+ base::Unretained(&session_), stream4->id(), 6000))));
session_.OnCanWrite();
// Stream4 alread did 6k worth of writes, so after doing another 12k it should
// cede and 2 should resume.
EXPECT_CALL(*stream4, OnCanWrite())
.WillOnce(DoAll(testing::IgnoreResult(Invoke(CreateFunctor(
- &session_, &TestSession::SendLargeFakeData,
+ &TestSession::SendLargeFakeData,
+ base::Unretained(&session_),
stream4->id(), 12000))),
Invoke(&stream4_blocker,
&StreamBlocker::MarkConnectionLevelWriteBlocked)));
EXPECT_CALL(*stream2, OnCanWrite())
.WillOnce(DoAll(testing::IgnoreResult(Invoke(CreateFunctor(
- &session_, &TestSession::SendLargeFakeData,
+ &TestSession::SendLargeFakeData,
+ base::Unretained(&session_),
stream2->id(), 6000))),
Invoke(&stream2_blocker,
&StreamBlocker::MarkConnectionLevelWriteBlocked)));
@@ -526,13 +534,18 @@ TEST_P(QuicSessionTestServer, OnCanWriteBundlesStreams) {
.WillRepeatedly(Return(kMaxPacketSize * 10));
EXPECT_CALL(*stream2, OnCanWrite())
.WillOnce(testing::IgnoreResult(Invoke(CreateFunctor(
- &session_, &TestSession::SendStreamData, stream2->id()))));
+ &TestSession::SendStreamData,
+ base::Unretained(&session_), stream2->id()))));
EXPECT_CALL(*stream4, OnCanWrite())
.WillOnce(testing::IgnoreResult(Invoke(CreateFunctor(
- &session_, &TestSession::SendStreamData, stream4->id()))));
+ &TestSession::SendStreamData,
+ base::Unretained(&session_),
+ stream4->id()))));
EXPECT_CALL(*stream6, OnCanWrite())
.WillOnce(testing::IgnoreResult(Invoke(CreateFunctor(
- &session_, &TestSession::SendStreamData, stream6->id()))));
+ &TestSession::SendStreamData,
+ base::Unretained(&session_),
+ stream6->id()))));
// Expect that we only send one packet, the writes from different streams
// should be bundled together.
« no previous file with comments | « net/quic/quic_chromium_client_stream_test.cc ('k') | net/quic/quic_stream_sequencer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698