| 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 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 | 867 |
| 868 // Resets cwnd and slow start threshold on connection migrations. | 868 // Resets cwnd and slow start threshold on connection migrations. |
| 869 sender_->OnConnectionMigration(); | 869 sender_->OnConnectionMigration(); |
| 870 EXPECT_EQ(kDefaultWindowTCP, sender_->GetCongestionWindow()); | 870 EXPECT_EQ(kDefaultWindowTCP, sender_->GetCongestionWindow()); |
| 871 EXPECT_EQ(kMaxCongestionWindowPackets * kDefaultTCPMSS, | 871 EXPECT_EQ(kMaxCongestionWindowPackets * kDefaultTCPMSS, |
| 872 sender_->GetSlowStartThreshold()); | 872 sender_->GetSlowStartThreshold()); |
| 873 EXPECT_FALSE(sender_->hybrid_slow_start().started()); | 873 EXPECT_FALSE(sender_->hybrid_slow_start().started()); |
| 874 } | 874 } |
| 875 | 875 |
| 876 TEST_F(TcpCubicSenderBytesTest, DefaultMaxCwnd) { | 876 TEST_F(TcpCubicSenderBytesTest, DefaultMaxCwnd) { |
| 877 ValueRestore<bool> old_flag(&FLAGS_quic_ignore_srbf, true); | |
| 878 RttStats rtt_stats; | 877 RttStats rtt_stats; |
| 879 QuicConnectionStats stats; | 878 QuicConnectionStats stats; |
| 880 std::unique_ptr<SendAlgorithmInterface> sender(SendAlgorithmInterface::Create( | 879 std::unique_ptr<SendAlgorithmInterface> sender(SendAlgorithmInterface::Create( |
| 881 &clock_, &rtt_stats, kCubicBytes, &stats, kInitialCongestionWindow)); | 880 &clock_, &rtt_stats, kCubicBytes, &stats, kInitialCongestionWindow)); |
| 882 | 881 |
| 883 SendAlgorithmInterface::CongestionVector acked_packets; | 882 SendAlgorithmInterface::CongestionVector acked_packets; |
| 884 SendAlgorithmInterface::CongestionVector missing_packets; | 883 SendAlgorithmInterface::CongestionVector missing_packets; |
| 885 for (uint64_t i = 1; i < kDefaultMaxCongestionWindowPackets; ++i) { | 884 for (uint64_t i = 1; i < kDefaultMaxCongestionWindowPackets; ++i) { |
| 886 acked_packets.clear(); | 885 acked_packets.clear(); |
| 887 acked_packets.push_back(std::make_pair(i, 1350)); | 886 acked_packets.push_back(std::make_pair(i, 1350)); |
| 888 sender->OnCongestionEvent(true, sender->GetCongestionWindow(), | 887 sender->OnCongestionEvent(true, sender->GetCongestionWindow(), |
| 889 acked_packets, missing_packets); | 888 acked_packets, missing_packets); |
| 890 } | 889 } |
| 891 EXPECT_EQ(kDefaultMaxCongestionWindowPackets, | 890 EXPECT_EQ(kDefaultMaxCongestionWindowPackets, |
| 892 sender->GetCongestionWindow() / kDefaultTCPMSS); | 891 sender->GetCongestionWindow() / kDefaultTCPMSS); |
| 893 } | 892 } |
| 894 | 893 |
| 895 } // namespace test | 894 } // namespace test |
| 896 } // namespace net | 895 } // namespace net |
| OLD | NEW |