| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/core/congestion_control/cubic.h" | 5 #include "net/quic/core/congestion_control/cubic.h" |
| 6 | 6 |
| 7 #include <cstdint> |
| 8 |
| 7 #include "base/logging.h" | 9 #include "base/logging.h" |
| 8 #include "net/quic/core/quic_flags.h" | |
| 9 #include "net/quic/test_tools/mock_clock.h" | 10 #include "net/quic/test_tools/mock_clock.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 12 |
| 12 namespace net { | 13 namespace net { |
| 13 namespace test { | 14 namespace test { |
| 14 | 15 |
| 15 const float kBeta = 0.7f; // Default Cubic backoff factor. | 16 const float kBeta = 0.7f; // Default Cubic backoff factor. |
| 16 const uint32_t kNumConnections = 2; | 17 const uint32_t kNumConnections = 2; |
| 17 const float kNConnectionBeta = (kNumConnections - 1 + kBeta) / kNumConnections; | 18 const float kNConnectionBeta = (kNumConnections - 1 + kBeta) / kNumConnections; |
| 18 const float kNConnectionAlpha = 3 * kNumConnections * kNumConnections * | 19 const float kNConnectionAlpha = 3 * kNumConnections * kNumConnections * |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 for (int i = 0; i < 40; ++i) { | 144 for (int i = 0; i < 40; ++i) { |
| 144 clock_.AdvanceTime(hundred_ms_); | 145 clock_.AdvanceTime(hundred_ms_); |
| 145 current_cwnd = cubic_.CongestionWindowAfterAck(current_cwnd, rtt_min); | 146 current_cwnd = cubic_.CongestionWindowAfterAck(current_cwnd, rtt_min); |
| 146 } | 147 } |
| 147 expected_cwnd = 399; | 148 expected_cwnd = 399; |
| 148 EXPECT_EQ(expected_cwnd, current_cwnd); | 149 EXPECT_EQ(expected_cwnd, current_cwnd); |
| 149 } | 150 } |
| 150 | 151 |
| 151 } // namespace test | 152 } // namespace test |
| 152 } // namespace net | 153 } // namespace net |
| OLD | NEW |