| 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 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 EXPECT_EQ(expected_send_window, sender_->GetSlowStartThreshold()); | 804 EXPECT_EQ(expected_send_window, sender_->GetSlowStartThreshold()); |
| 805 | 805 |
| 806 // Resets cwnd and slow start threshold on connection migrations. | 806 // Resets cwnd and slow start threshold on connection migrations. |
| 807 sender_->OnConnectionMigration(); | 807 sender_->OnConnectionMigration(); |
| 808 EXPECT_EQ(kDefaultWindowTCP, sender_->GetCongestionWindow()); | 808 EXPECT_EQ(kDefaultWindowTCP, sender_->GetCongestionWindow()); |
| 809 EXPECT_EQ(kMaxCongestionWindowPackets * kDefaultTCPMSS, | 809 EXPECT_EQ(kMaxCongestionWindowPackets * kDefaultTCPMSS, |
| 810 sender_->GetSlowStartThreshold()); | 810 sender_->GetSlowStartThreshold()); |
| 811 EXPECT_FALSE(sender_->hybrid_slow_start().started()); | 811 EXPECT_FALSE(sender_->hybrid_slow_start().started()); |
| 812 } | 812 } |
| 813 | 813 |
| 814 TEST_F(TcpCubicSenderBytesTest, DefaultMaxCwnd) { |
| 815 ValueRestore<bool> old_flag(&FLAGS_quic_ignore_srbf, true); |
| 816 RttStats rtt_stats; |
| 817 QuicConnectionStats stats; |
| 818 std::unique_ptr<SendAlgorithmInterface> sender(SendAlgorithmInterface::Create( |
| 819 &clock_, &rtt_stats, kCubicBytes, &stats, kInitialCongestionWindow)); |
| 820 |
| 821 SendAlgorithmInterface::CongestionVector acked_packets; |
| 822 SendAlgorithmInterface::CongestionVector missing_packets; |
| 823 for (uint64_t i = 1; i < kDefaultMaxCongestionWindowPackets; ++i) { |
| 824 acked_packets.clear(); |
| 825 acked_packets.push_back(std::make_pair(i, 1350)); |
| 826 sender->OnCongestionEvent(true, sender->GetCongestionWindow(), |
| 827 acked_packets, missing_packets); |
| 828 } |
| 829 EXPECT_EQ(kDefaultMaxCongestionWindowPackets, |
| 830 sender->GetCongestionWindow() / kDefaultTCPMSS); |
| 831 } |
| 832 |
| 814 } // namespace test | 833 } // namespace test |
| 815 } // namespace net | 834 } // namespace net |
| OLD | NEW |