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

Unified Diff: net/quic/quic_sent_packet_manager_test.cc

Issue 1981643002: Combine OnCongestionWindowChange and OnRttChange to OnCongestionChange in QuicSentPacketManager::Ne… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@121732198
Patch Set: Created 4 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 | « 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 68b5bbcb532f7acf9f1c4ea47ab892e7f4ac2096..ffc11e5739377f2d5aedcc51b040be10230f5ce3 100644
--- a/net/quic/quic_sent_packet_manager_test.cc
+++ b/net/quic/quic_sent_packet_manager_test.cc
@@ -146,15 +146,13 @@ class QuicSentPacketManagerTest : public ::testing::TestWithParam<TestParams> {
*send_algorithm_,
OnCongestionEvent(true, _, ElementsAre(Pair(largest_observed, _)),
IsEmpty()));
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
}
void ExpectUpdatedRtt(QuicPacketNumber largest_observed) {
EXPECT_CALL(*send_algorithm_,
OnCongestionEvent(true, _, IsEmpty(), IsEmpty()));
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
}
void ExpectAckAndLoss(bool rtt_updated,
@@ -164,8 +162,7 @@ class QuicSentPacketManagerTest : public ::testing::TestWithParam<TestParams> {
OnCongestionEvent(rtt_updated, _,
ElementsAre(Pair(largest_observed, _)),
ElementsAre(Pair(lost_packet, _))));
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
}
// |packets_acked| and |packets_lost| should be in packet number order.
@@ -186,9 +183,8 @@ class QuicSentPacketManagerTest : public ::testing::TestWithParam<TestParams> {
*send_algorithm_,
OnCongestionEvent(rtt_updated, _, Pointwise(KeyEq(), ack_vector),
Pointwise(KeyEq(), lost_vector)));
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange())
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange())
.Times(AnyNumber());
- EXPECT_CALL(*network_change_visitor_, OnRttChange()).Times(AnyNumber());
}
void RetransmitAndSendPacket(QuicPacketNumber old_packet_number,
@@ -466,7 +462,7 @@ TEST_P(QuicSentPacketManagerTest,
// Fire the RTO, which will mark 2 for retransmission (but will not send it).
EXPECT_CALL(*send_algorithm_, OnRetransmissionTimeout(true));
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
manager_.OnRetransmissionTimeout();
EXPECT_TRUE(manager_.HasPendingRetransmissions());
@@ -828,8 +824,7 @@ TEST_P(QuicSentPacketManagerTest, TailLossProbeThenRTO) {
EXPECT_CALL(*send_algorithm_, OnRetransmissionTimeout(true));
EXPECT_CALL(*send_algorithm_,
OnCongestionEvent(true, _, ElementsAre(Pair(103, _)), _));
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
manager_.OnIncomingAck(ack_frame, clock_.ApproximateNow());
// All packets before 103 should be lost.
EXPECT_EQ(0u, QuicSentPacketManagerPeer::GetBytesInFlight(&manager_));
@@ -1052,8 +1047,7 @@ TEST_P(QuicSentPacketManagerTest, RetransmissionTimeout) {
EXPECT_CALL(*send_algorithm_,
OnCongestionEvent(true, _, ElementsAre(Pair(102, _)),
/*lost_packets=*/IsEmpty()));
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
EXPECT_CALL(*send_algorithm_, OnRetransmissionTimeout(true));
// RTO's use loss detection instead of immediately declaring retransmitted
// packets lost.
@@ -1069,8 +1063,7 @@ TEST_P(QuicSentPacketManagerTest, NewRetransmissionTimeout) {
options.push_back(kNRTO);
QuicSentPacketManagerPeer::SetPerspective(&manager_, Perspective::IS_CLIENT);
client_config.SetConnectionOptionsToSend(options);
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
EXPECT_CALL(*send_algorithm_, PacingRate())
.WillRepeatedly(Return(QuicBandwidth::Zero()));
@@ -1102,8 +1095,7 @@ TEST_P(QuicSentPacketManagerTest, NewRetransmissionTimeout) {
EXPECT_CALL(*send_algorithm_,
OnCongestionEvent(true, _, ElementsAre(Pair(102, _)),
/*lost_packets=*/Not(IsEmpty())));
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
manager_.OnIncomingAck(ack_frame, clock_.Now());
}
@@ -1392,8 +1384,7 @@ TEST_P(QuicSentPacketManagerTest, NegotiateTimeLossDetectionFromOptions) {
options.push_back(kTIME);
QuicConfigPeer::SetReceivedConnectionOptions(&config, options);
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
manager_.SetFromConfig(config);
EXPECT_EQ(kTime, QuicSentPacketManagerPeer::GetLossAlgorithm(&manager_)
@@ -1407,8 +1398,7 @@ TEST_P(QuicSentPacketManagerTest, NegotiateCongestionControlFromOptions) {
options.push_back(kRENO);
QuicConfigPeer::SetReceivedConnectionOptions(&config, options);
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
manager_.SetFromConfig(config);
EXPECT_EQ(kReno, QuicSentPacketManagerPeer::GetSendAlgorithm(manager_)
->GetCongestionControlType());
@@ -1418,8 +1408,7 @@ TEST_P(QuicSentPacketManagerTest, NegotiateCongestionControlFromOptions) {
options.clear();
options.push_back(kTBBR);
QuicConfigPeer::SetReceivedConnectionOptions(&config, options);
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
manager_.SetFromConfig(config);
EXPECT_EQ(kBBR, QuicSentPacketManagerPeer::GetSendAlgorithm(
manager_)->GetCongestionControlType());
@@ -1428,8 +1417,7 @@ TEST_P(QuicSentPacketManagerTest, NegotiateCongestionControlFromOptions) {
options.clear();
options.push_back(kBYTE);
QuicConfigPeer::SetReceivedConnectionOptions(&config, options);
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
manager_.SetFromConfig(config);
EXPECT_EQ(kCubicBytes, QuicSentPacketManagerPeer::GetSendAlgorithm(manager_)
->GetCongestionControlType());
@@ -1438,8 +1426,7 @@ TEST_P(QuicSentPacketManagerTest, NegotiateCongestionControlFromOptions) {
options.push_back(kRENO);
options.push_back(kBYTE);
QuicConfigPeer::SetReceivedConnectionOptions(&config, options);
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
manager_.SetFromConfig(config);
EXPECT_EQ(kRenoBytes, QuicSentPacketManagerPeer::GetSendAlgorithm(manager_)
->GetCongestionControlType());
@@ -1451,8 +1438,7 @@ TEST_P(QuicSentPacketManagerTest, NegotiateNumConnectionsFromOptions) {
options.push_back(k1CON);
QuicConfigPeer::SetReceivedConnectionOptions(&config, options);
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
EXPECT_CALL(*send_algorithm_, SetNumEmulatedConnections(1));
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
manager_.SetFromConfig(config);
@@ -1460,8 +1446,7 @@ TEST_P(QuicSentPacketManagerTest, NegotiateNumConnectionsFromOptions) {
QuicSentPacketManagerPeer::SetPerspective(&manager_, Perspective::IS_CLIENT);
QuicConfig client_config;
client_config.SetConnectionOptionsToSend(options);
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
EXPECT_CALL(*send_algorithm_, SetNumEmulatedConnections(1));
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
manager_.SetFromConfig(client_config);
@@ -1476,8 +1461,7 @@ TEST_P(QuicSentPacketManagerTest, NegotiateNConnectionFromOptions) {
options.push_back(kNCON);
QuicConfigPeer::SetReceivedConnectionOptions(&config, options);
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
manager_.SetFromConfig(config);
@@ -1491,8 +1475,7 @@ TEST_P(QuicSentPacketManagerTest, NegotiateNoTLPFromOptionsAtServer) {
options.push_back(kNTLP);
QuicConfigPeer::SetReceivedConnectionOptions(&config, options);
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
manager_.SetFromConfig(config);
EXPECT_EQ(0u, QuicSentPacketManagerPeer::GetMaxTailLossProbes(&manager_));
@@ -1505,8 +1488,7 @@ TEST_P(QuicSentPacketManagerTest, NegotiateNoTLPFromOptionsAtClient) {
options.push_back(kNTLP);
QuicSentPacketManagerPeer::SetPerspective(&manager_, Perspective::IS_CLIENT);
client_config.SetConnectionOptionsToSend(options);
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
manager_.SetFromConfig(client_config);
EXPECT_EQ(0u, QuicSentPacketManagerPeer::GetMaxTailLossProbes(&manager_));
@@ -1518,8 +1500,7 @@ TEST_P(QuicSentPacketManagerTest, NegotiateTLPRttFromOptionsAtServer) {
options.push_back(kTLPR);
QuicConfigPeer::SetReceivedConnectionOptions(&config, options);
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
manager_.SetFromConfig(config);
EXPECT_TRUE(
@@ -1533,8 +1514,7 @@ TEST_P(QuicSentPacketManagerTest, NegotiateTLPRttFromOptionsAtClient) {
options.push_back(kTLPR);
QuicSentPacketManagerPeer::SetPerspective(&manager_, Perspective::IS_CLIENT);
client_config.SetConnectionOptionsToSend(options);
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
manager_.SetFromConfig(client_config);
EXPECT_TRUE(
@@ -1548,8 +1528,7 @@ TEST_P(QuicSentPacketManagerTest, NegotiateNewRTOFromOptionsAtServer) {
options.push_back(kNRTO);
QuicConfigPeer::SetReceivedConnectionOptions(&config, options);
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
manager_.SetFromConfig(config);
EXPECT_TRUE(QuicSentPacketManagerPeer::GetUseNewRto(&manager_));
@@ -1563,8 +1542,7 @@ TEST_P(QuicSentPacketManagerTest, NegotiateNewRTOFromOptionsAtClient) {
options.push_back(kNRTO);
QuicSentPacketManagerPeer::SetPerspective(&manager_, Perspective::IS_CLIENT);
client_config.SetConnectionOptionsToSend(options);
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
manager_.SetFromConfig(client_config);
EXPECT_TRUE(QuicSentPacketManagerPeer::GetUseNewRto(&manager_));
@@ -1585,8 +1563,7 @@ TEST_P(QuicSentPacketManagerTest,
.WillRepeatedly(Return(QuicBandwidth::Zero()));
EXPECT_CALL(*send_algorithm_, GetCongestionWindow())
.WillOnce(Return(10 * kDefaultTCPMSS));
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
manager_.SetFromConfig(client_config);
EXPECT_EQ(kMinSocketReceiveBuffer,
@@ -1644,8 +1621,7 @@ TEST_P(QuicSentPacketManagerTest, UseInitialRoundTripTimeToSend) {
QuicConfig config;
config.SetInitialRoundTripTimeUsToSend(initial_rtt_us);
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
- EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
manager_.SetFromConfig(config);
EXPECT_EQ(0, manager_.GetRttStats()->smoothed_rtt().ToMicroseconds());
« 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