OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/quic/congestion_control/tcp_cubic_sender_bytes.h" | 5 #include "net/quic/congestion_control/tcp_cubic_sender_bytes.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cstdint> | 8 #include <cstdint> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 expected_send_window += kDefaultTCPMSS; | 281 expected_send_window += kDefaultTCPMSS; |
282 EXPECT_EQ(expected_send_window, sender_->GetCongestionWindow()); | 282 EXPECT_EQ(expected_send_window, sender_->GetCongestionWindow()); |
283 | 283 |
284 // Now RTO and ensure slow start gets reset. | 284 // Now RTO and ensure slow start gets reset. |
285 EXPECT_TRUE(sender_->hybrid_slow_start().started()); | 285 EXPECT_TRUE(sender_->hybrid_slow_start().started()); |
286 sender_->OnRetransmissionTimeout(true); | 286 sender_->OnRetransmissionTimeout(true); |
287 EXPECT_FALSE(sender_->hybrid_slow_start().started()); | 287 EXPECT_FALSE(sender_->hybrid_slow_start().started()); |
288 } | 288 } |
289 | 289 |
290 TEST_F(TcpCubicSenderBytesTest, SlowStartHalfPacketLossWithLargeReduction) { | 290 TEST_F(TcpCubicSenderBytesTest, SlowStartHalfPacketLossWithLargeReduction) { |
291 FLAGS_quic_sslr_byte_conservation = true; | |
292 QuicConfig config; | 291 QuicConfig config; |
293 QuicTagVector options; | 292 QuicTagVector options; |
294 options.push_back(kSSLR); | 293 options.push_back(kSSLR); |
295 QuicConfigPeer::SetReceivedConnectionOptions(&config, options); | 294 QuicConfigPeer::SetReceivedConnectionOptions(&config, options); |
296 sender_->SetFromConfig(config, Perspective::IS_SERVER); | 295 sender_->SetFromConfig(config, Perspective::IS_SERVER); |
297 | 296 |
298 sender_->SetNumEmulatedConnections(1); | 297 sender_->SetNumEmulatedConnections(1); |
299 const int kNumberOfAcks = 10; | 298 const int kNumberOfAcks = 10; |
300 for (int i = 0; i < kNumberOfAcks; ++i) { | 299 for (int i = 0; i < kNumberOfAcks; ++i) { |
301 // Send our full send window in half sized packets. | 300 // Send our full send window in half sized packets. |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 // Resets cwnd and slow start threshold on connection migrations. | 757 // Resets cwnd and slow start threshold on connection migrations. |
759 sender_->OnConnectionMigration(); | 758 sender_->OnConnectionMigration(); |
760 EXPECT_EQ(kDefaultWindowTCP, sender_->GetCongestionWindow()); | 759 EXPECT_EQ(kDefaultWindowTCP, sender_->GetCongestionWindow()); |
761 EXPECT_EQ(kMaxCongestionWindow * kDefaultTCPMSS, | 760 EXPECT_EQ(kMaxCongestionWindow * kDefaultTCPMSS, |
762 sender_->GetSlowStartThreshold()); | 761 sender_->GetSlowStartThreshold()); |
763 EXPECT_FALSE(sender_->hybrid_slow_start().started()); | 762 EXPECT_FALSE(sender_->hybrid_slow_start().started()); |
764 } | 763 } |
765 | 764 |
766 } // namespace test | 765 } // namespace test |
767 } // namespace net | 766 } // namespace net |
OLD | NEW |