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

Side by Side Diff: net/quic/congestion_control/cubic_test.cc

Issue 157803007: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win_x64 compiler error fix Created 6 years, 10 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "net/quic/congestion_control/cubic.h" 7 #include "net/quic/congestion_control/cubic.h"
8 #include "net/quic/test_tools/mock_clock.h" 8 #include "net/quic/test_tools/mock_clock.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace net { 11 namespace net {
12 namespace test { 12 namespace test {
13 13
14 const float kBeta = static_cast<float>(0.7); // Default Cubic backoff factor. 14 const float kBeta = 0.7f; // Default Cubic backoff factor.
15 const uint32 kNumConnections = 2; 15 const uint32 kNumConnections = 2;
16 const float kNConnectionBeta = (kNumConnections - 1 + kBeta) / kNumConnections; 16 const float kNConnectionBeta = (kNumConnections - 1 + kBeta) / kNumConnections;
17 const float kNConnectionAlpha = 3 * kNumConnections * kNumConnections * 17 const float kNConnectionAlpha = 3 * kNumConnections * kNumConnections *
18 (1 - kNConnectionBeta) / (1 + kNConnectionBeta); 18 (1 - kNConnectionBeta) / (1 + kNConnectionBeta);
19 19
20 class CubicTest : public ::testing::Test { 20 class CubicTest : public ::testing::Test {
21 protected: 21 protected:
22 CubicTest() 22 CubicTest()
23 : one_ms_(QuicTime::Delta::FromMilliseconds(1)), 23 : one_ms_(QuicTime::Delta::FromMilliseconds(1)),
24 hundred_ms_(QuicTime::Delta::FromMilliseconds(100)), 24 hundred_ms_(QuicTime::Delta::FromMilliseconds(100)),
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 for (int i = 0; i < 40 ; ++i) { 103 for (int i = 0; i < 40 ; ++i) {
104 clock_.AdvanceTime(hundred_ms_); 104 clock_.AdvanceTime(hundred_ms_);
105 current_cwnd = cubic_.CongestionWindowAfterAck(current_cwnd, rtt_min); 105 current_cwnd = cubic_.CongestionWindowAfterAck(current_cwnd, rtt_min);
106 } 106 }
107 expected_cwnd = 422; 107 expected_cwnd = 422;
108 EXPECT_EQ(expected_cwnd, current_cwnd); 108 EXPECT_EQ(expected_cwnd, current_cwnd);
109 } 109 }
110 110
111 } // namespace test 111 } // namespace test
112 } // namespace net 112 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/cubic.cc ('k') | net/quic/congestion_control/inter_arrival_overuse_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698