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

Unified Diff: net/tools/quic/end_to_end_test.cc

Issue 734063004: Update from https://crrev.com/304418 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 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
« no previous file with comments | « net/socket/tcp_socket_win.cc ('k') | net/tools/quic/quic_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/end_to_end_test.cc
diff --git a/net/tools/quic/end_to_end_test.cc b/net/tools/quic/end_to_end_test.cc
index 1fb3e79aa995971406b4a75eb84d6d8ffcf3b839..33f30fca3007e3f5f1b074a539fd978f08588bf0 100644
--- a/net/tools/quic/end_to_end_test.cc
+++ b/net/tools/quic/end_to_end_test.cc
@@ -920,11 +920,10 @@ TEST_P(EndToEndTest, LimitMaxOpenStreams) {
EXPECT_EQ(2u, client_negotiated_config->MaxStreamsPerConnection());
}
-TEST_P(EndToEndTest, LimitCongestionWindowAndRTT) {
- // Client tries to request twice the server's max initial window, and the
- // server limits it to the max.
- client_config_.SetInitialCongestionWindowToSend(2 * kMaxInitialWindow);
- client_config_.SetInitialRoundTripTimeUsToSend(20000);
+TEST_P(EndToEndTest, ClientSuggestsRTT) {
+ // Client suggests initial RTT, verify it is used.
+ const uint32 kInitialRTT = 20000;
+ client_config_.SetInitialRoundTripTimeUsToSend(kInitialRTT);
ASSERT_TRUE(Initialize());
client_->client()->WaitForCryptoHandshakeConfirmed();
@@ -940,33 +939,21 @@ TEST_P(EndToEndTest, LimitCongestionWindowAndRTT) {
const QuicSentPacketManager& server_sent_packet_manager =
*GetSentPacketManagerFromFirstServerSession();
- // The client shouldn't set its initial window based on the negotiated value.
- EXPECT_EQ(kDefaultInitialWindow,
- client_sent_packet_manager.GetCongestionWindowInTcpMss());
- EXPECT_EQ(kMaxInitialWindow,
- server_sent_packet_manager.GetCongestionWindowInTcpMss());
-
- EXPECT_EQ(GetParam().use_pacing, server_sent_packet_manager.using_pacing());
- EXPECT_EQ(GetParam().use_pacing, client_sent_packet_manager.using_pacing());
-
- // The client *should* set the intitial RTT, but it's increased to 10ms.
- EXPECT_EQ(20000u, client_sent_packet_manager.GetRttStats()->initial_rtt_us());
- EXPECT_EQ(20000u, server_sent_packet_manager.GetRttStats()->initial_rtt_us());
-
- // Now use the negotiated limits with packet loss.
- SetPacketLossPercentage(30);
-
- // 10 KB body.
- string body;
- GenerateBody(&body, 1024 * 10);
-
- HTTPMessage request(HttpConstants::HTTP_1_1,
- HttpConstants::POST, "/foo");
- request.AddBody(body, true);
-
+ // BBR automatically enables pacing.
+ EXPECT_EQ(GetParam().use_pacing ||
+ (FLAGS_quic_allow_bbr &&
+ GetParam().congestion_control_tag == kTBBR),
+ server_sent_packet_manager.using_pacing());
+ EXPECT_EQ(GetParam().use_pacing ||
+ (FLAGS_quic_allow_bbr &&
+ GetParam().congestion_control_tag == kTBBR),
+ client_sent_packet_manager.using_pacing());
+
+ EXPECT_EQ(kInitialRTT,
+ client_sent_packet_manager.GetRttStats()->initial_rtt_us());
+ EXPECT_EQ(kInitialRTT,
+ server_sent_packet_manager.GetRttStats()->initial_rtt_us());
server_thread_->Resume();
-
- EXPECT_EQ(kFooResponseBody, client_->SendCustomSynchronousRequest(request));
}
TEST_P(EndToEndTest, MaxInitialRTT) {
@@ -1025,7 +1012,7 @@ TEST_P(EndToEndTest, MinInitialRTT) {
EXPECT_FALSE(
client_sent_packet_manager.GetRttStats()->smoothed_rtt().IsInfinite());
// Expect the default rtt of 100ms.
- EXPECT_EQ(static_cast<int64>(100 * base::Time::kMicrosecondsPerMillisecond),
+ EXPECT_EQ(static_cast<int64>(100 * kNumMicrosPerMilli),
server_sent_packet_manager.GetRttStats()->initial_rtt_us());
// Ensure the bandwidth is valid.
client_sent_packet_manager.BandwidthEstimate();
« no previous file with comments | « net/socket/tcp_socket_win.cc ('k') | net/tools/quic/quic_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698