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

Unified Diff: net/quic/quic_sent_packet_manager_test.cc

Issue 839143002: Roll Chrome into Mojo. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Rebase Created 5 years, 11 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/quic_server.cc » ('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 044beadc8c365729520a319b0b2d692b85365edc..92ce1dc3c8e4330275c3d122777368be8c730720 100644
--- a/net/quic/quic_sent_packet_manager_test.cc
+++ b/net/quic/quic_sent_packet_manager_test.cc
@@ -100,12 +100,14 @@ class QuicSentPacketManagerTest : public ::testing::TestWithParam<bool> {
EXPECT_CALL(*send_algorithm_, OnCongestionEvent(
true, _, ElementsAre(Pair(largest_observed, _)), IsEmpty()));
EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
+ EXPECT_CALL(*network_change_visitor_, OnRttChange());
}
void ExpectUpdatedRtt(QuicPacketSequenceNumber largest_observed) {
EXPECT_CALL(*send_algorithm_,
OnCongestionEvent(true, _, IsEmpty(), IsEmpty()));
EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
+ EXPECT_CALL(*network_change_visitor_, OnRttChange());
}
void ExpectAckAndLoss(bool rtt_updated,
@@ -115,6 +117,7 @@ class QuicSentPacketManagerTest : public ::testing::TestWithParam<bool> {
rtt_updated, _, ElementsAre(Pair(largest_observed, _)),
ElementsAre(Pair(lost_packet, _))));
EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
+ EXPECT_CALL(*network_change_visitor_, OnRttChange());
}
// |packets_acked| and |packets_lost| should be in sequence number order.
@@ -137,6 +140,7 @@ class QuicSentPacketManagerTest : public ::testing::TestWithParam<bool> {
Pointwise(KeyEq(), lost_vector)));
EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange()).
Times(AnyNumber());
+ EXPECT_CALL(*network_change_visitor_, OnRttChange()).Times(AnyNumber());
}
void RetransmitAndSendPacket(QuicPacketSequenceNumber old_sequence_number,
@@ -1277,6 +1281,7 @@ TEST_F(QuicSentPacketManagerTest, NegotiateTimeLossDetectionFromOptions) {
QuicConfigPeer::SetReceivedConnectionOptions(&config, options);
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _, _));
EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
+ EXPECT_CALL(*network_change_visitor_, OnRttChange());
manager_.SetFromConfig(config);
EXPECT_EQ(kTime,
@@ -1292,6 +1297,7 @@ TEST_F(QuicSentPacketManagerTest, NegotiateCongestionControlFromOptions) {
options.push_back(kRENO);
QuicConfigPeer::SetReceivedConnectionOptions(&config, options);
EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
+ EXPECT_CALL(*network_change_visitor_, OnRttChange());
manager_.SetFromConfig(config);
EXPECT_EQ(kReno, QuicSentPacketManagerPeer::GetSendAlgorithm(
manager_)->GetCongestionControlType());
@@ -1302,6 +1308,7 @@ TEST_F(QuicSentPacketManagerTest, NegotiateCongestionControlFromOptions) {
options.push_back(kTBBR);
QuicConfigPeer::SetReceivedConnectionOptions(&config, options);
EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
+ EXPECT_CALL(*network_change_visitor_, OnRttChange());
manager_.SetFromConfig(config);
EXPECT_EQ(kBBR, QuicSentPacketManagerPeer::GetSendAlgorithm(
manager_)->GetCongestionControlType());
@@ -1315,6 +1322,7 @@ TEST_F(QuicSentPacketManagerTest, NegotiateNumConnectionsFromOptions) {
options.push_back(k1CON);
QuicConfigPeer::SetReceivedConnectionOptions(&config, options);
EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
+ EXPECT_CALL(*network_change_visitor_, OnRttChange());
EXPECT_CALL(*send_algorithm_, SetNumEmulatedConnections(1));
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _, _));
manager_.SetFromConfig(config);
@@ -1323,6 +1331,7 @@ TEST_F(QuicSentPacketManagerTest, NegotiateNumConnectionsFromOptions) {
QuicConfig client_config;
client_config.SetConnectionOptionsToSend(options);
EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
+ EXPECT_CALL(*network_change_visitor_, OnRttChange());
EXPECT_CALL(*send_algorithm_, SetNumEmulatedConnections(1));
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _, _));
manager_.SetFromConfig(client_config);
@@ -1338,6 +1347,7 @@ TEST_F(QuicSentPacketManagerTest, NegotiateNConnectionFromOptions) {
options.push_back(kNCON);
QuicConfigPeer::SetReceivedConnectionOptions(&config, options);
EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
+ EXPECT_CALL(*network_change_visitor_, OnRttChange());
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _, _));
manager_.SetFromConfig(config);
@@ -1352,6 +1362,7 @@ TEST_F(QuicSentPacketManagerTest, NegotiateNoTLPFromOptionsAtServer) {
options.push_back(kNTLP);
QuicConfigPeer::SetReceivedConnectionOptions(&config, options);
EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
+ EXPECT_CALL(*network_change_visitor_, OnRttChange());
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _, _));
manager_.SetFromConfig(config);
EXPECT_EQ(0u, QuicSentPacketManagerPeer::GetMaxTailLossProbes(&manager_));
@@ -1365,6 +1376,7 @@ TEST_F(QuicSentPacketManagerTest, NegotiateNoTLPFromOptionsAtClient) {
QuicSentPacketManagerPeer::SetIsServer(&manager_, false);
client_config.SetConnectionOptionsToSend(options);
EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
+ EXPECT_CALL(*network_change_visitor_, OnRttChange());
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _, _));
manager_.SetFromConfig(client_config);
EXPECT_EQ(0u, QuicSentPacketManagerPeer::GetMaxTailLossProbes(&manager_));
@@ -1378,7 +1390,8 @@ TEST_F(QuicSentPacketManagerTest, NegotiatePacingFromOptions) {
options.push_back(kPACE);
QuicConfigPeer::SetReceivedConnectionOptions(&config, options);
EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _, /* using_pacing= */ true));
+ EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _, /*using_pacing=*/true));
manager_.SetFromConfig(config);
EXPECT_TRUE(manager_.using_pacing());
@@ -1392,7 +1405,8 @@ TEST_F(QuicSentPacketManagerTest, EnablePacingViaFlag) {
ValueRestore<bool> old_flag(&FLAGS_quic_enable_pacing, true);
QuicConfig config;
EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
- EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _, /* using_pacing= */ true));
+ EXPECT_CALL(*network_change_visitor_, OnRttChange());
+ EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _, /*using_pacing=*/true));
manager_.SetFromConfig(config);
EXPECT_TRUE(manager_.using_pacing());
@@ -1407,6 +1421,7 @@ TEST_F(QuicSentPacketManagerTest, NegotiateReceiveWindowFromOptions) {
QuicConfigPeer::SetReceivedSocketReceiveBuffer(&client_config, 1024);
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _, _));
EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
+ EXPECT_CALL(*network_change_visitor_, OnRttChange());
manager_.SetFromConfig(client_config);
EXPECT_EQ(kMinSocketReceiveBuffer,
@@ -1459,6 +1474,7 @@ TEST_F(QuicSentPacketManagerTest, UseInitialRoundTripTimeToSend) {
config.SetInitialRoundTripTimeUsToSend(initial_rtt_us);
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _, _));
EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange());
+ EXPECT_CALL(*network_change_visitor_, OnRttChange());
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/quic_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698