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

Unified Diff: net/quic/quic_connection_test.cc

Issue 286153003: Adds dynamic FEC on/off switch in packet creator. Tightens use of (Closed) Base URL: https://chromium.googlesource.com/chromium/src
Patch Set: Created 6 years, 7 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 | « no previous file | net/quic/quic_packet_creator.h » ('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 aed07e5f05183be9d8f655257116b2cbe2a652ce..48cb2db1665d3a768f9d446f002e4cb381d0359b 100644
--- a/net/quic/quic_connection_test.cc
+++ b/net/quic/quic_connection_test.cc
@@ -1441,7 +1441,8 @@ TEST_P(QuicConnectionTest, FECSending) {
connection_.version(), kIncludeVersion, PACKET_1BYTE_SEQUENCE_NUMBER,
IN_FEC_GROUP, &payload_length);
// And send FEC every two packets.
- connection_.options()->max_packets_per_fec_group = 2;
+ EXPECT_TRUE(QuicPacketCreatorPeer::SwitchFecProtectionOn(
+ QuicConnectionPeer::GetPacketCreator(&connection_), 2));
// Send 4 data packets and 2 FEC packets.
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(6);
@@ -1460,7 +1461,8 @@ TEST_P(QuicConnectionTest, FECQueueing) {
connection_.version(), kIncludeVersion, PACKET_1BYTE_SEQUENCE_NUMBER,
IN_FEC_GROUP, &payload_length);
// And send FEC every two packets.
- connection_.options()->max_packets_per_fec_group = 2;
+ EXPECT_TRUE(QuicPacketCreatorPeer::SwitchFecProtectionOn(
+ QuicConnectionPeer::GetPacketCreator(&connection_), 2));
EXPECT_EQ(0u, connection_.NumQueuedPackets());
BlockOnNextWrite();
@@ -1472,7 +1474,9 @@ TEST_P(QuicConnectionTest, FECQueueing) {
}
TEST_P(QuicConnectionTest, AbandonFECFromCongestionWindow) {
- connection_.options()->max_packets_per_fec_group = 1;
+ EXPECT_TRUE(QuicPacketCreatorPeer::SwitchFecProtectionOn(
+ QuicConnectionPeer::GetPacketCreator(&connection_), 1));
+
// 1 Data and 1 FEC packet.
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(2);
connection_.SendStreamDataWithString(3, "foo", 0, !kFin, NULL);
@@ -1490,7 +1494,8 @@ TEST_P(QuicConnectionTest, AbandonFECFromCongestionWindow) {
TEST_P(QuicConnectionTest, DontAbandonAckedFEC) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
- connection_.options()->max_packets_per_fec_group = 1;
+ EXPECT_TRUE(QuicPacketCreatorPeer::SwitchFecProtectionOn(
+ QuicConnectionPeer::GetPacketCreator(&connection_), 1));
// 1 Data and 1 FEC packet.
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(6);
@@ -1517,7 +1522,8 @@ TEST_P(QuicConnectionTest, DontAbandonAckedFEC) {
TEST_P(QuicConnectionTest, AbandonAllFEC) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
- connection_.options()->max_packets_per_fec_group = 1;
+ EXPECT_TRUE(QuicPacketCreatorPeer::SwitchFecProtectionOn(
+ QuicConnectionPeer::GetPacketCreator(&connection_), 1));
// 1 Data and 1 FEC packet.
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(6);
@@ -1642,7 +1648,9 @@ TEST_P(QuicConnectionTest, FramePackingFEC) {
return;
}
// Enable fec.
- connection_.options()->max_packets_per_fec_group = 6;
+ EXPECT_TRUE(QuicPacketCreatorPeer::SwitchFecProtectionOn(
+ QuicConnectionPeer::GetPacketCreator(&connection_), 6));
+
// Block the connection.
connection_.GetSendAlarm()->Set(
clock_.ApproximateNow().Add(QuicTime::Delta::FromSeconds(1)));
« no previous file with comments | « no previous file | net/quic/quic_packet_creator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698