OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/logging.h" | 5 #include "base/logging.h" |
6 #include "net/quic/congestion_control/channel_estimator.h" | 6 #include "net/quic/congestion_control/channel_estimator.h" |
7 #include "net/quic/test_tools/mock_clock.h" | 7 #include "net/quic/test_tools/mock_clock.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace net { | 10 namespace net { |
11 namespace test { | 11 namespace test { |
12 | 12 |
13 class ChannelEstimatorTest : public ::testing::Test { | 13 class ChannelEstimatorTest : public ::testing::Test { |
14 protected: | 14 protected: |
15 void SetUp() { | 15 virtual void SetUp() { |
16 srand(1234); | 16 srand(1234); |
17 packet_size_ = 1200; | 17 packet_size_ = 1200; |
18 sequence_number_ = 1; | 18 sequence_number_ = 1; |
19 } | 19 } |
20 | 20 |
21 QuicPacketSequenceNumber sequence_number_; | 21 QuicPacketSequenceNumber sequence_number_; |
22 QuicByteCount packet_size_; | 22 QuicByteCount packet_size_; |
23 MockClock send_clock_; | 23 MockClock send_clock_; |
24 MockClock receive_clock_; | 24 MockClock receive_clock_; |
25 ChannelEstimator channel_estimator_; | 25 ChannelEstimator channel_estimator_; |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 QuicTime::Delta mean_received_delta = initial_received_delta.Add( | 215 QuicTime::Delta mean_received_delta = initial_received_delta.Add( |
216 QuicTime::Delta::FromMicroseconds( | 216 QuicTime::Delta::FromMicroseconds( |
217 increased_received_delta.ToMicroseconds() / 2)); | 217 increased_received_delta.ToMicroseconds() / 2)); |
218 | 218 |
219 EXPECT_EQ(QuicBandwidth::FromBytesAndTimeDelta(packet_size_, | 219 EXPECT_EQ(QuicBandwidth::FromBytesAndTimeDelta(packet_size_, |
220 mean_received_delta), estimate); | 220 mean_received_delta), estimate); |
221 } | 221 } |
222 | 222 |
223 } // namespace test | 223 } // namespace test |
224 } // namespace net | 224 } // namespace net |
OLD | NEW |