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

Unified Diff: net/quic/quic_connection_test.cc

Issue 23691073: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Compiler/unittests fix Created 7 years, 3 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_test.cc ('k') | net/quic/quic_framer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_connection_test.cc
diff --git a/net/quic/quic_connection_test.cc b/net/quic/quic_connection_test.cc
index 147d8bc7cd100b441aebadeae17637fd884e7b9c..afe8a7663b8d67a8f9c036dc95253b4bfbd084e0 100644
--- a/net/quic/quic_connection_test.cc
+++ b/net/quic/quic_connection_test.cc
@@ -389,6 +389,19 @@ class TestConnection : public QuicConnection {
QuicConnectionPeer::SetSendAlgorithm(this, send_algorithm);
}
+ bool SendOrQueuePacket(EncryptionLevel level,
+ QuicPacketSequenceNumber sequence_number,
+ QuicPacket* packet,
+ QuicPacketEntropyHash entropy_hash,
+ HasRetransmittableData retransmittable) {
+ return SendOrQueuePacket(level,
+ sequence_number,
+ packet,
+ entropy_hash,
+ retransmittable,
+ NO_FORCE);
+ }
+
QuicConsumedData SendStreamData(QuicStreamId id,
StringPiece data,
QuicStreamOffset offset,
@@ -398,6 +411,18 @@ class TestConnection : public QuicConnection {
return SendvStreamData(id, &iov, 1, offset, fin);
}
+ QuicConsumedData SendStreamDataAndNotifyWhenAcked(
+ QuicStreamId id,
+ StringPiece data,
+ QuicStreamOffset offset,
+ bool fin,
+ QuicAckNotifier::DelegateInterface* delegate) {
+ struct iovec iov = {const_cast<char*>(data.data()),
+ static_cast<size_t>(data.size())};
+ return SendvStreamDataAndNotifyWhenAcked(id, &iov, 1, offset, fin,
+ delegate);
+ }
+
QuicConsumedData SendStreamData3() {
return SendStreamData(kStreamId3, "food", 0, !kFin);
}
@@ -491,6 +516,7 @@ class QuicConnectionTest : public ::testing::Test {
.WillByDefault(Return(true));
// TODO(rch): remove this.
QuicConnection::g_acks_do_not_instigate_acks = true;
+ EXPECT_CALL(visitor_, HasPendingHandshake()).Times(AnyNumber());
}
~QuicConnectionTest() {
@@ -528,8 +554,7 @@ class QuicConnectionTest : public ::testing::Test {
}
void ProcessPacket(QuicPacketSequenceNumber number) {
- EXPECT_CALL(visitor_, OnPacket(_, _, _, _))
- .WillOnce(Return(accept_packet_));
+ EXPECT_CALL(visitor_, OnStreamFrames(_)).WillOnce(Return(accept_packet_));
ProcessDataPacket(number, 0, !kEntropyFlag);
}
@@ -577,10 +602,9 @@ class QuicConnectionTest : public ::testing::Test {
size_t ProcessFecProtectedPacket(QuicPacketSequenceNumber number,
bool expect_revival, bool entropy_flag) {
if (expect_revival) {
- EXPECT_CALL(visitor_, OnPacket(_, _, _, _)).WillOnce(DoAll(
- SaveArg<2>(&revived_header_), Return(accept_packet_)));
+ EXPECT_CALL(visitor_, OnStreamFrames(_)).WillOnce(Return(accept_packet_));
}
- EXPECT_CALL(visitor_, OnPacket(_, _, _, _)).WillOnce(Return(accept_packet_))
+ EXPECT_CALL(visitor_, OnStreamFrames(_)).WillOnce(Return(accept_packet_))
.RetiresOnSaturation();
return ProcessDataPacket(number, 1, entropy_flag);
}
@@ -593,8 +617,7 @@ class QuicConnectionTest : public ::testing::Test {
bool entropy_flag,
QuicPacket* packet) {
if (expect_revival) {
- EXPECT_CALL(visitor_, OnPacket(_, _, _, _)).WillOnce(DoAll(
- SaveArg<2>(&revived_header_), Return(accept_packet_)));
+ EXPECT_CALL(visitor_, OnStreamFrames(_)).WillOnce(Return(accept_packet_));
}
// Construct the decrypted data packet so we can compute the correct
@@ -745,7 +768,6 @@ class QuicConnectionTest : public ::testing::Test {
StrictMock<MockConnectionVisitor> visitor_;
QuicPacketHeader header_;
- QuicPacketHeader revived_header_;
QuicStreamFrame frame1_;
QuicStreamFrame frame2_;
scoped_ptr<QuicAckFrame> outgoing_ack_;
@@ -813,7 +835,7 @@ TEST_F(QuicConnectionTest, DuplicatePacket) {
EXPECT_TRUE(IsMissing(1));
// Send packet 3 again, but do not set the expectation that
- // the visitor OnPacket() will be called.
+ // the visitor OnStreamFrames() will be called.
ProcessDataPacket(3, 0, !kEntropyFlag);
EXPECT_EQ(3u, outgoing_ack()->received_info.largest_observed);
EXPECT_TRUE(IsMissing(2));
@@ -859,7 +881,6 @@ TEST_F(QuicConnectionTest, RejectPacketTooFarOut) {
TEST_F(QuicConnectionTest, TruncatedAck) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
- EXPECT_CALL(visitor_, OnAck(_)).Times(testing::AnyNumber());
EXPECT_CALL(*send_algorithm_, OnIncomingAck(_, _, _)).Times(2);
EXPECT_CALL(*send_algorithm_, OnIncomingLoss(_)).Times(1);
for (int i = 0; i < 200; ++i) {
@@ -979,7 +1000,6 @@ TEST_F(QuicConnectionTest, LargestObservedLower) {
QuicAckFrame frame(2, QuicTime::Zero(), 0);
frame.received_info.entropy_hash = QuicConnectionPeer::GetSentEntropyHash(
&connection_, 2);
- EXPECT_CALL(visitor_, OnAck(_));
ProcessAckPacket(&frame, true);
// Now change it to 1, and it should cause a connection error.
@@ -1149,11 +1169,7 @@ TEST_F(QuicConnectionTest, BasicSending) {
SendAckPacketToPeer(); // Packet 5
EXPECT_EQ(1u, last_ack()->sent_info.least_unacked);
- SequenceNumberSet expected_acks;
- expected_acks.insert(1);
-
// Peer acks up to packet 3.
- EXPECT_CALL(visitor_, OnAck(ContainerEq(expected_acks)));
QuicAckFrame frame(3, QuicTime::Zero(), 0);
frame.received_info.entropy_hash =
QuicConnectionPeer::GetSentEntropyHash(&connection_, 3);
@@ -1164,11 +1180,7 @@ TEST_F(QuicConnectionTest, BasicSending) {
// ack for 4.
EXPECT_EQ(4u, last_ack()->sent_info.least_unacked);
- expected_acks.clear();
- expected_acks.insert(4);
-
// Peer acks up to packet 4, the last packet.
- EXPECT_CALL(visitor_, OnAck(ContainerEq(expected_acks)));
QuicAckFrame frame2(6, QuicTime::Zero(), 0);
frame2.received_info.entropy_hash =
QuicConnectionPeer::GetSentEntropyHash(&connection_, 6);
@@ -1265,7 +1277,6 @@ TEST_F(QuicConnectionTest, DontAbandonAckedFEC) {
QuicConnectionPeer::GetSentEntropyHash(&connection_, 2) ^
QuicConnectionPeer::GetSentEntropyHash(&connection_, 1);
- EXPECT_CALL(visitor_, OnAck(_)).Times(1);
EXPECT_CALL(*send_algorithm_, OnIncomingAck(_, _, _)).Times(1);
EXPECT_CALL(*send_algorithm_, OnIncomingLoss(_)).Times(1);
@@ -1507,9 +1518,6 @@ TEST_F(QuicConnectionTest, RetransmitOnNack) {
SendStreamDataToPeer(1, "foos", 3, !kFin, &last_packet); // Packet 2
SendStreamDataToPeer(1, "fooos", 7, !kFin, &last_packet); // Packet 3
- SequenceNumberSet expected_acks;
- expected_acks.insert(1);
- EXPECT_CALL(visitor_, OnAck(ContainerEq(expected_acks)));
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
// Peer acks one but not two or three. Right now we only retransmit on
@@ -1521,10 +1529,6 @@ TEST_F(QuicConnectionTest, RetransmitOnNack) {
ProcessAckPacket(&ack_one, true);
ProcessAckPacket(&ack_one, true);
- expected_acks.clear();
- expected_acks.insert(3);
- EXPECT_CALL(visitor_, OnAck(ContainerEq(expected_acks)));
-
// Peer acks up to 3 with two explicitly missing. Two nacks should cause no
// change.
QuicAckFrame nack_two(3, QuicTime::Zero(), 0);
@@ -1581,7 +1585,6 @@ TEST_F(QuicConnectionTest, RetransmitNackedPacketsOnTruncatedAck) {
EXPECT_CALL(*send_algorithm_, OnIncomingAck(_, _, _)).Times(1);
EXPECT_CALL(*send_algorithm_, OnIncomingLoss(_)).Times(1);
- EXPECT_CALL(visitor_, OnAck(_)).Times(1);
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
ProcessAckPacket(&frame, true);
EXPECT_TRUE(QuicConnectionPeer::GetReceivedTruncatedAck(&connection_));
@@ -1623,9 +1626,6 @@ TEST_F(QuicConnectionTest, LimitPacketsPerNack) {
nack.received_info.entropy_hash =
QuicConnectionPeer::GetSentEntropyHash(&connection_, 12) ^
QuicConnectionPeer::GetSentEntropyHash(&connection_, 11);
- SequenceNumberSet expected_acks;
- expected_acks.insert(12);
- EXPECT_CALL(visitor_, OnAck(ContainerEq(expected_acks)));
// Nack three times.
ProcessAckPacket(&nack, true);
@@ -1664,14 +1664,6 @@ TEST_F(QuicConnectionTest, MultipleAcks) {
QuicConnectionPeer::GetSentEntropyHash(&connection_, 2) ^
QuicConnectionPeer::GetSentEntropyHash(&connection_, 1);
- // The connection should pass up acks for 1, 4, 5. 2 is not acked, and 3 was
- // an ackframe so should not be passed up.
- SequenceNumberSet expected_acks;
- expected_acks.insert(1);
- expected_acks.insert(4);
- expected_acks.insert(5);
-
- EXPECT_CALL(visitor_, OnAck(ContainerEq(expected_acks)));
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
ProcessAckPacket(&frame1, true);
@@ -1680,12 +1672,7 @@ TEST_F(QuicConnectionTest, MultipleAcks) {
QuicAckFrame frame2(6, QuicTime::Zero(), 0);
frame2.received_info.entropy_hash =
QuicConnectionPeer::GetSentEntropyHash(&connection_, 6);
- expected_acks.clear();
- // Both acks should be passed up.
- expected_acks.insert(2);
- expected_acks.insert(6);
- EXPECT_CALL(visitor_, OnAck(ContainerEq(expected_acks)));
ProcessAckPacket(&frame2, true);
}
@@ -1694,12 +1681,6 @@ TEST_F(QuicConnectionTest, DontLatchUnackedPacket) {
SendStreamDataToPeer(1, "foo", 0, !kFin, NULL); // Packet 1;
SendAckPacketToPeer(); // Packet 2
- // This sets least unacked to 3 (unsent packet), since we don't need
- // an ack for Packet 2 (ack packet).
- SequenceNumberSet expected_acks;
- expected_acks.insert(1);
- // Peer acks packet 1.
- EXPECT_CALL(visitor_, OnAck(ContainerEq(expected_acks)));
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
QuicAckFrame frame(1, QuicTime::Zero(), 0);
frame.received_info.entropy_hash = QuicConnectionPeer::GetSentEntropyHash(
@@ -1729,7 +1710,8 @@ TEST_F(QuicConnectionTest, ReviveMissingPacketAfterFecPacket) {
// Don't send missing packet 1.
ProcessFecPacket(2, 1, true, !kEntropyFlag, NULL);
- EXPECT_FALSE(revived_header_.entropy_flag);
+ // Entropy flag should be false, so entropy should be 0.
+ EXPECT_EQ(0u, QuicConnectionPeer::ReceivedEntropyHash(&connection_, 2));
}
TEST_F(QuicConnectionTest, ReviveMissingPacketAfterDataPacketThenFecPacket) {
@@ -1738,7 +1720,8 @@ TEST_F(QuicConnectionTest, ReviveMissingPacketAfterDataPacketThenFecPacket) {
ProcessFecProtectedPacket(1, false, kEntropyFlag);
// Don't send missing packet 2.
ProcessFecPacket(3, 1, true, !kEntropyFlag, NULL);
- EXPECT_TRUE(revived_header_.entropy_flag);
+ // Entropy flag should be true, so entropy should not be 0.
+ EXPECT_NE(0u, QuicConnectionPeer::ReceivedEntropyHash(&connection_, 2));
}
TEST_F(QuicConnectionTest, ReviveMissingPacketAfterDataPacketsThenFecPacket) {
@@ -1748,7 +1731,8 @@ TEST_F(QuicConnectionTest, ReviveMissingPacketAfterDataPacketsThenFecPacket) {
// Don't send missing packet 2.
ProcessFecProtectedPacket(3, false, !kEntropyFlag);
ProcessFecPacket(4, 1, true, kEntropyFlag, NULL);
- EXPECT_TRUE(revived_header_.entropy_flag);
+ // Entropy flag should be true, so entropy should not be 0.
+ EXPECT_NE(0u, QuicConnectionPeer::ReceivedEntropyHash(&connection_, 2));
}
TEST_F(QuicConnectionTest, ReviveMissingPacketAfterDataPacket) {
@@ -1758,7 +1742,8 @@ TEST_F(QuicConnectionTest, ReviveMissingPacketAfterDataPacket) {
ProcessFecPacket(3, 1, false, !kEntropyFlag, NULL);
// out of order
ProcessFecProtectedPacket(2, true, !kEntropyFlag);
- EXPECT_FALSE(revived_header_.entropy_flag);
+ // Entropy flag should be false, so entropy should be 0.
+ EXPECT_EQ(0u, QuicConnectionPeer::ReceivedEntropyHash(&connection_, 2));
}
TEST_F(QuicConnectionTest, ReviveMissingPacketAfterDataPackets) {
@@ -1770,7 +1755,8 @@ TEST_F(QuicConnectionTest, ReviveMissingPacketAfterDataPackets) {
ProcessFecProtectedPacket(3, false, kEntropyFlag);
ProcessFecProtectedPacket(4, false, kEntropyFlag);
ProcessFecProtectedPacket(5, true, !kEntropyFlag);
- EXPECT_TRUE(revived_header_.entropy_flag);
+ // Entropy flag should be true, so entropy should be 0.
+ EXPECT_NE(0u, QuicConnectionPeer::ReceivedEntropyHash(&connection_, 2));
}
TEST_F(QuicConnectionTest, TestRetransmit) {
@@ -1883,13 +1869,13 @@ TEST_F(QuicConnectionTest, BufferNonDecryptablePackets) {
connection_.SetDecrypter(new StrictTaggingDecrypter(tag));
connection_.SetDefaultEncryptionLevel(ENCRYPTION_INITIAL);
connection_.SetEncrypter(ENCRYPTION_INITIAL, new TaggingEncrypter(tag));
- EXPECT_CALL(visitor_, OnPacket(_, _, _, _)).Times(2).WillRepeatedly(
+ EXPECT_CALL(visitor_, OnStreamFrames(_)).Times(2).WillRepeatedly(
Return(true));
ProcessDataPacketAtLevel(2, false, kEntropyFlag, ENCRYPTION_INITIAL);
// Finally, process a third packet and note that we do not
// reprocess the buffered packet.
- EXPECT_CALL(visitor_, OnPacket(_, _, _, _)).WillOnce(Return(true));
+ EXPECT_CALL(visitor_, OnStreamFrames(_)).WillOnce(Return(true));
ProcessDataPacketAtLevel(3, false, kEntropyFlag, ENCRYPTION_INITIAL);
}
@@ -1978,6 +1964,45 @@ TEST_F(QuicConnectionTest, SetRTOAfterWritingToSocket) {
EXPECT_EQ(1u, QuicConnectionPeer::GetNumRetransmissionTimeouts(&connection_));
}
+TEST_F(QuicConnectionTest, DelayRTOWithAckReceipt) {
+ EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
+ EXPECT_CALL(*send_algorithm_, SentPacket(_, _, _, NOT_RETRANSMISSION, _))
+ .Times(2);
+ connection_.SendStreamData(1, "foo", 0, !kFin);
+ connection_.SendStreamData(2, "bar", 0, !kFin);
+ EXPECT_EQ(2u, QuicConnectionPeer::GetNumRetransmissionTimeouts(&connection_));
+
+ // Advance the time right before the RTO, then receive an ack for the first
+ // packet to delay the RTO.
+ clock_.AdvanceTime(DefaultRetransmissionTime());
+ EXPECT_EQ(2u, QuicConnectionPeer::GetNumRetransmissionTimeouts(&connection_));
+ EXPECT_CALL(*send_algorithm_, OnIncomingAck(_, _, _)).Times(1);
+ QuicAckFrame ack(1, QuicTime::Zero(), 0);
+ ProcessAckPacket(&ack, true);
+ EXPECT_EQ(1u, QuicConnectionPeer::GetNumRetransmissionTimeouts(&connection_));
+
+ // Move forward past the original RTO and ensure the RTO is still pending.
+ clock_.AdvanceTime(DefaultRetransmissionTime());
+ EXPECT_EQ(1u, QuicConnectionPeer::GetNumRetransmissionTimeouts(&connection_));
+
+ // Ensure the second packet gets retransmitted when it finally fires.
+ EXPECT_TRUE(
+ QuicConnectionPeer::GetRetransmissionAlarm(&connection_)->IsSet());
+ EXPECT_GE(
+ QuicConnectionPeer::GetRetransmissionAlarm(&connection_)->deadline(),
+ clock_.ApproximateNow());
+ clock_.AdvanceTime(DefaultRetransmissionTime());
+ EXPECT_LT(
+ QuicConnectionPeer::GetRetransmissionAlarm(&connection_)->deadline(),
+ clock_.ApproximateNow());
+ EXPECT_CALL(*send_algorithm_, SentPacket(_, _, _, IS_RETRANSMISSION, _));
+ EXPECT_CALL(*send_algorithm_, AbandoningPacket(_, _));
+ connection_.OnRetransmissionTimeout();
+
+ // The new retransmitted sequence number should now be in the timeout queue.
+ EXPECT_EQ(1u, QuicConnectionPeer::GetNumRetransmissionTimeouts(&connection_));
+}
+
TEST_F(QuicConnectionTest, TestQueued) {
EXPECT_EQ(0u, connection_.NumQueuedPackets());
helper_->set_blocked(true);
@@ -2362,7 +2387,7 @@ TEST_F(QuicConnectionTest, MissingPacketsBeforeLeastUnacked) {
}
TEST_F(QuicConnectionTest, ReceivedEntropyHashCalculation) {
- EXPECT_CALL(visitor_, OnPacket(_, _, _, _)).WillRepeatedly(Return(true));
+ EXPECT_CALL(visitor_, OnStreamFrames(_)).WillRepeatedly(Return(true));
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
ProcessDataPacket(1, 1, kEntropyFlag);
ProcessDataPacket(4, 1, kEntropyFlag);
@@ -2372,7 +2397,7 @@ TEST_F(QuicConnectionTest, ReceivedEntropyHashCalculation) {
}
TEST_F(QuicConnectionTest, UpdateEntropyForReceivedPackets) {
- EXPECT_CALL(visitor_, OnPacket(_, _, _, _)).WillRepeatedly(Return(true));
+ EXPECT_CALL(visitor_, OnStreamFrames(_)).WillRepeatedly(Return(true));
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
ProcessDataPacket(1, 1, kEntropyFlag);
ProcessDataPacket(5, 1, kEntropyFlag);
@@ -2393,7 +2418,7 @@ TEST_F(QuicConnectionTest, UpdateEntropyForReceivedPackets) {
}
TEST_F(QuicConnectionTest, UpdateEntropyHashUptoCurrentPacket) {
- EXPECT_CALL(visitor_, OnPacket(_, _, _, _)).WillRepeatedly(Return(true));
+ EXPECT_CALL(visitor_, OnStreamFrames(_)).WillRepeatedly(Return(true));
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
ProcessDataPacket(1, 1, kEntropyFlag);
ProcessDataPacket(5, 1, !kEntropyFlag);
@@ -2413,7 +2438,7 @@ TEST_F(QuicConnectionTest, UpdateEntropyHashUptoCurrentPacket) {
}
TEST_F(QuicConnectionTest, EntropyCalculationForTruncatedAck) {
- EXPECT_CALL(visitor_, OnPacket(_, _, _, _)).WillRepeatedly(Return(true));
+ EXPECT_CALL(visitor_, OnStreamFrames(_)).WillRepeatedly(Return(true));
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
QuicPacketEntropyHash entropy[51];
entropy[0] = 0;
@@ -2538,7 +2563,7 @@ TEST_F(QuicConnectionTest, ClientHandlesVersionNegotiation) {
scoped_ptr<QuicPacket> packet(
framer_.BuildUnsizedDataPacket(header, frames).packet);
encrypted.reset(framer_.EncryptPacket(ENCRYPTION_NONE, 12, *packet));
- EXPECT_CALL(visitor_, OnPacket(_, _, _, _)).Times(1);
+ EXPECT_CALL(visitor_, OnStreamFrames(_)).Times(1);
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
connection_.ProcessUdpPacket(IPEndPoint(), IPEndPoint(), *encrypted);
@@ -2599,7 +2624,6 @@ TEST_F(QuicConnectionTest, CheckSendStats) {
QuicConnectionPeer::GetSentEntropyHash(&connection_, 3) ^
QuicConnectionPeer::GetSentEntropyHash(&connection_, 2);
QuicFrame frame(&nack_three);
- EXPECT_CALL(visitor_, OnAck(_));
EXPECT_CALL(*send_algorithm_, OnIncomingAck(_, _, _)).Times(1);
EXPECT_CALL(*send_algorithm_, OnIncomingLoss(_)).Times(1);
EXPECT_CALL(visitor_, OnCanWrite()).Times(3).WillRepeatedly(Return(true));
@@ -2695,7 +2719,7 @@ TEST_F(QuicConnectionTest, DontProcessFramesIfPacketClosedConnection) {
ENCRYPTION_NONE, 1, *packet));
EXPECT_CALL(visitor_, ConnectionClose(QUIC_PEER_GOING_AWAY, true));
- EXPECT_CALL(visitor_, OnPacket(_, _, _, _)).Times(0);
+ EXPECT_CALL(visitor_, OnStreamFrames(_)).Times(0);
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
connection_.ProcessUdpPacket(IPEndPoint(), IPEndPoint(), *encrypted);
@@ -2779,7 +2803,6 @@ TEST_F(QuicConnectionTest, AckNotifierTriggerCallback) {
connection_.SendStreamDataAndNotifyWhenAcked(1, "foo", 0, !kFin, &delegate);
// Process an ACK from the server which should trigger the callback.
- EXPECT_CALL(visitor_, OnAck(_)).Times(1);
EXPECT_CALL(*send_algorithm_, OnIncomingAck(_, _, _)).Times(1);
QuicAckFrame frame(1, QuicTime::Zero(), 0);
ProcessAckPacket(&frame, true);
@@ -2792,7 +2815,6 @@ TEST_F(QuicConnectionTest, AckNotifierFailToTriggerCallback) {
MockAckNotifierDelegate delegate;
EXPECT_CALL(delegate, OnAckNotification()).Times(0);;
- EXPECT_CALL(visitor_, OnAck(_)).Times(1);
EXPECT_CALL(*send_algorithm_, OnIncomingAck(_, _, _)).Times(2);
EXPECT_CALL(*send_algorithm_, OnIncomingLoss(_)).Times(1);
@@ -2818,9 +2840,6 @@ TEST_F(QuicConnectionTest, AckNotifierCallbackAfterRetransmission) {
MockAckNotifierDelegate delegate;
EXPECT_CALL(delegate, OnAckNotification()).Times(1);;
- // OnAck called twice: once with missing packet, once after retransmit.
- EXPECT_CALL(visitor_, OnAck(_)).Times(2);
-
// In total expect ACKs for all 4 packets.
EXPECT_CALL(*send_algorithm_, OnIncomingAck(_, _, _)).Times(4);
@@ -2863,7 +2882,6 @@ TEST_F(QuicConnectionTest, AckNotifierCallbackAfterFECRecovery) {
EXPECT_CALL(delegate, OnAckNotification()).Times(1);;
// Expect ACKs for 1 packet.
- EXPECT_CALL(visitor_, OnAck(_)).Times(1);
EXPECT_CALL(*send_algorithm_, OnIncomingAck(_, _, _)).Times(1);
// Send one packet, and register to be notified on ACK.
« no previous file with comments | « net/quic/quic_connection_helper_test.cc ('k') | net/quic/quic_framer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698