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

Unified Diff: net/quic/quic_packet_creator_test.cc

Issue 1525303003: Remove QuicPacketGenerator::OnSerializedPacket with functionality in QuicPacketCreator. No functio… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@110008813
Patch Set: get newly added files from upstream Created 5 years 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_packet_creator.cc ('k') | net/quic/quic_packet_generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_packet_creator_test.cc
diff --git a/net/quic/quic_packet_creator_test.cc b/net/quic/quic_packet_creator_test.cc
index 1480401686edf201b6cd1ca2f0edaa641cde5589..165b769168df44a23842c6439c45be21fd7f3e55 100644
--- a/net/quic/quic_packet_creator_test.cc
+++ b/net/quic/quic_packet_creator_test.cc
@@ -81,6 +81,7 @@ class MockDelegate : public QuicPacketCreator::DelegateInterface {
MOCK_METHOD1(OnSerializedPacket, void(SerializedPacket* packet));
MOCK_METHOD0(OnResetFecGroup, void());
+ MOCK_METHOD2(CloseConnection, void(QuicErrorCode, bool));
private:
DISALLOW_COPY_AND_ASSIGN(MockDelegate);
@@ -882,8 +883,17 @@ TEST_P(QuicPacketCreatorTest, StreamFrameConsumptionWithFec) {
EXPECT_EQ(0u, creator_.ExpansionOnNewFrame());
size_t expected_bytes_free = bytes_free > 0 ? bytes_free : 0;
EXPECT_EQ(expected_bytes_free, creator_.BytesFree()) << "delta: " << delta;
- EXPECT_CALL(delegate_, OnSerializedPacket(_))
- .WillOnce(Invoke(this, &QuicPacketCreatorTest::SaveSerializedPacket));
+ {
+ InSequence s;
+ EXPECT_CALL(delegate_, OnSerializedPacket(_))
+ .WillOnce(Invoke(this, &QuicPacketCreatorTest::SaveSerializedPacket));
+ // Every 6th packet will generate an extra FEC packet.
+ if (delta == -1 || delta == 5) {
+ EXPECT_CALL(delegate_, OnSerializedPacket(_))
+ .WillOnce(
+ Invoke(this, &QuicPacketCreatorTest::ClearSerializedPacket));
+ }
+ }
creator_.Flush();
ASSERT_TRUE(serialized_packet_.packet);
ClearSerializedPacket(&serialized_packet_);
« no previous file with comments | « net/quic/quic_packet_creator.cc ('k') | net/quic/quic_packet_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698