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

Unified Diff: net/quic/quic_sent_packet_manager_test.cc

Issue 1023203004: Limit QUIC's send algorithm max CWND by the peer's receive buffer and (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Improve_tests_88744988
Patch Set: Created 5 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_sent_packet_manager.cc ('k') | net/quic/test_tools/quic_test_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_sent_packet_manager_test.cc
diff --git a/net/quic/quic_sent_packet_manager_test.cc b/net/quic/quic_sent_packet_manager_test.cc
index dad154b60ead8d49e753b4604a5ce0806708b0a5..70d9578b7cc0524e96f61fea2eabe4daf3f95074 100644
--- a/net/quic/quic_sent_packet_manager_test.cc
+++ b/net/quic/quic_sent_packet_manager_test.cc
@@ -1637,6 +1637,10 @@ TEST_F(QuicSentPacketManagerTest, NegotiateReceiveWindowFromOptions) {
QuicConfig client_config;
QuicConfigPeer::SetReceivedSocketReceiveBuffer(&client_config, 1024);
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _, _));
+ if (FLAGS_quic_limit_max_cwnd_to_receive_buffer) {
+ EXPECT_CALL(*send_algorithm_,
+ SetMaxCongestionWindow(kMinSocketReceiveBuffer * 0.95));
+ }
EXPECT_CALL(*send_algorithm_, PacingRate())
.WillRepeatedly(Return(QuicBandwidth::Zero()));
EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
@@ -1659,6 +1663,10 @@ TEST_F(QuicSentPacketManagerTest, NegotiateReceiveWindowFromOptions) {
manager_.OnPacketSent(&packet, 0, clock_.Now(), 1024,
NOT_RETRANSMISSION, HAS_RETRANSMITTABLE_DATA);
}
+ if (FLAGS_quic_limit_max_cwnd_to_receive_buffer) {
+ EXPECT_CALL(*send_algorithm_, TimeUntilSend(_, _, _))
+ .WillOnce(Return(QuicTime::Delta::Infinite()));
+ }
EXPECT_EQ(QuicTime::Delta::Infinite(),
manager_.TimeUntilSend(clock_.Now(), HAS_RETRANSMITTABLE_DATA));
}
@@ -1680,6 +1688,10 @@ TEST_F(QuicSentPacketManagerTest, ReceiveWindowLimited) {
manager_.OnPacketSent(&packet, 0, clock_.Now(), 1024,
NOT_RETRANSMISSION, HAS_RETRANSMITTABLE_DATA);
}
+ if (FLAGS_quic_limit_max_cwnd_to_receive_buffer) {
+ EXPECT_CALL(*send_algorithm_, TimeUntilSend(_, _, _))
+ .WillOnce(Return(QuicTime::Delta::Infinite()));
+ }
EXPECT_EQ(QuicTime::Delta::Infinite(),
manager_.TimeUntilSend(clock_.Now(), HAS_RETRANSMITTABLE_DATA));
}
« no previous file with comments | « net/quic/quic_sent_packet_manager.cc ('k') | net/quic/test_tools/quic_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698