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

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

Issue 1535363003: Switch to standard integer types in net/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: stddef Created 5 years 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
« no previous file with comments | « net/quic/congestion_control/cubic_bytes.cc ('k') | net/quic/congestion_control/cubic_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/cubic_bytes.h" 5 #include "net/quic/congestion_control/cubic_bytes.h"
6 6
7 #include "base/basictypes.h"
8 #include "base/logging.h" 7 #include "base/logging.h"
9 #include "net/quic/quic_connection_stats.h" 8 #include "net/quic/quic_connection_stats.h"
10 #include "net/quic/test_tools/mock_clock.h" 9 #include "net/quic/test_tools/mock_clock.h"
11 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
12 11
13 namespace net { 12 namespace net {
14 namespace test { 13 namespace test {
15 14
16 const float kBeta = 0.7f; // Default Cubic backoff factor. 15 const float kBeta = 0.7f; // Default Cubic backoff factor.
17 const uint32 kNumConnections = 2; 16 const uint32_t kNumConnections = 2;
18 const float kNConnectionBeta = (kNumConnections - 1 + kBeta) / kNumConnections; 17 const float kNConnectionBeta = (kNumConnections - 1 + kBeta) / kNumConnections;
19 const float kNConnectionAlpha = 3 * kNumConnections * kNumConnections * 18 const float kNConnectionAlpha = 3 * kNumConnections * kNumConnections *
20 (1 - kNConnectionBeta) / (1 + kNConnectionBeta); 19 (1 - kNConnectionBeta) / (1 + kNConnectionBeta);
21 20
22 class CubicBytesTest : public ::testing::Test { 21 class CubicBytesTest : public ::testing::Test {
23 protected: 22 protected:
24 CubicBytesTest() 23 CubicBytesTest()
25 : one_ms_(QuicTime::Delta::FromMilliseconds(1)), 24 : one_ms_(QuicTime::Delta::FromMilliseconds(1)),
26 hundred_ms_(QuicTime::Delta::FromMilliseconds(100)), 25 hundred_ms_(QuicTime::Delta::FromMilliseconds(100)),
27 cubic_(&clock_) {} 26 cubic_(&clock_) {}
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 clock_.AdvanceTime(hundred_ms_); 147 clock_.AdvanceTime(hundred_ms_);
149 current_cwnd = 148 current_cwnd =
150 cubic_.CongestionWindowAfterAck(kDefaultTCPMSS, current_cwnd, rtt_min); 149 cubic_.CongestionWindowAfterAck(kDefaultTCPMSS, current_cwnd, rtt_min);
151 } 150 }
152 expected_cwnd = 422 * kDefaultTCPMSS; 151 expected_cwnd = 422 * kDefaultTCPMSS;
153 EXPECT_EQ(expected_cwnd, current_cwnd); 152 EXPECT_EQ(expected_cwnd, current_cwnd);
154 } 153 }
155 154
156 } // namespace test 155 } // namespace test
157 } // namespace net 156 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/cubic_bytes.cc ('k') | net/quic/congestion_control/cubic_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698