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

Unified Diff: net/quic/core/congestion_control/bbr_sender_test.cc

Issue 2487613002: Landing Recent QUIC changes until 12:43 PM, Nov 5, 2016 UTC+8 (Closed)
Patch Set: Created 4 years, 1 month 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
Index: net/quic/core/congestion_control/bbr_sender_test.cc
diff --git a/net/quic/core/congestion_control/bbr_sender_test.cc b/net/quic/core/congestion_control/bbr_sender_test.cc
index 0274d3dbe2fd858de4ede432b5002c8c3ed75a61..c50c8cd8be0d34b5fdfadeecbad9f841404c04de 100644
--- a/net/quic/core/congestion_control/bbr_sender_test.cc
+++ b/net/quic/core/congestion_control/bbr_sender_test.cc
@@ -224,6 +224,58 @@ TEST_F(BbrSenderTest, SimpleTransferSmallBuffer) {
EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited);
}
+// Test the number of losses incurred by the startup phase in a situation when
+// the buffer is less than BDP.
+TEST_F(BbrSenderTest, PacketLossOnSmallBufferStartup) {
+ CreateSmallBufferSetup();
+
+ DriveOutOfStartup();
+ float loss_rate =
+ static_cast<float>(bbr_sender_.connection()->GetStats().packets_lost) /
+ bbr_sender_.connection()->GetStats().packets_sent;
+ EXPECT_LE(loss_rate, 0.20);
+}
+
+// Ensures the code transitions loss recovery states correctly (NOT_IN_RECOVERY
+// -> CONSERVATION -> GROWTH -> NOT_IN_RECOVERY).
+TEST_F(BbrSenderTest, RecoveryStates) {
+ const QuicTime::Delta timeout = QuicTime::Delta::FromSeconds(10);
+ bool simulator_result;
+ CreateSmallBufferSetup();
+
+ bbr_sender_.AddBytesToTransfer(100 * 1024 * 1024);
+ ASSERT_EQ(BbrSender::NOT_IN_RECOVERY,
+ sender_->ExportDebugState().recovery_state);
+
+ simulator_result = simulator_.RunUntilOrTimeout(
+ [this]() {
+ return sender_->ExportDebugState().recovery_state !=
+ BbrSender::NOT_IN_RECOVERY;
+ },
+ timeout);
+ ASSERT_TRUE(simulator_result);
+ ASSERT_EQ(BbrSender::CONSERVATION,
+ sender_->ExportDebugState().recovery_state);
+
+ simulator_result = simulator_.RunUntilOrTimeout(
+ [this]() {
+ return sender_->ExportDebugState().recovery_state !=
+ BbrSender::CONSERVATION;
+ },
+ timeout);
+ ASSERT_TRUE(simulator_result);
+ ASSERT_EQ(BbrSender::GROWTH, sender_->ExportDebugState().recovery_state);
+
+ simulator_result = simulator_.RunUntilOrTimeout(
+ [this]() {
+ return sender_->ExportDebugState().recovery_state != BbrSender::GROWTH;
+ },
+ timeout);
+ ASSERT_TRUE(simulator_result);
+ ASSERT_EQ(BbrSender::NOT_IN_RECOVERY,
+ sender_->ExportDebugState().recovery_state);
+}
+
// Verify the behavior of the algorithm in the case when the connection sends
// small bursts of data after sending continuously for a while.
TEST_F(BbrSenderTest, ApplicationLimitedBursts) {
« no previous file with comments | « net/quic/core/congestion_control/bbr_sender.cc ('k') | net/quic/core/congestion_control/tcp_cubic_sender_bytes_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698