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 "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "net/quic/congestion_control/available_channel_estimator.h" | 7 #include "net/quic/congestion_control/available_channel_estimator.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 class AvailableChannelEstimatorTest : public ::testing::Test { | 14 class AvailableChannelEstimatorTest : public ::testing::Test { |
15 protected: | 15 protected: |
16 void SetUp() { | 16 virtual void SetUp() { |
17 srand(1234); | 17 srand(1234); |
18 packet_size_ = 1200; | 18 packet_size_ = 1200; |
19 sequence_number_ = 1; | 19 sequence_number_ = 1; |
20 QuicTime receive_time = receive_clock_.Now(); | 20 QuicTime receive_time = receive_clock_.Now(); |
21 QuicTime sent_time = send_clock_.Now(); | 21 QuicTime sent_time = send_clock_.Now(); |
22 estimator_.reset(new AvailableChannelEstimator(sequence_number_, | 22 estimator_.reset(new AvailableChannelEstimator(sequence_number_, |
23 sent_time, | 23 sent_time, |
24 receive_time)); | 24 receive_time)); |
25 } | 25 } |
26 | 26 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 } | 100 } |
101 QuicBandwidth bandwidth = QuicBandwidth::Zero(); | 101 QuicBandwidth bandwidth = QuicBandwidth::Zero(); |
102 EXPECT_EQ(kAvailableChannelEstimateGood, | 102 EXPECT_EQ(kAvailableChannelEstimateGood, |
103 estimator_->GetAvailableChannelEstimate(&bandwidth)); | 103 estimator_->GetAvailableChannelEstimate(&bandwidth)); |
104 EXPECT_EQ(QuicBandwidth::FromBytesAndTimeDelta(packet_size_, received_delta), | 104 EXPECT_EQ(QuicBandwidth::FromBytesAndTimeDelta(packet_size_, received_delta), |
105 bandwidth); | 105 bandwidth); |
106 } | 106 } |
107 | 107 |
108 } // namespace test | 108 } // namespace test |
109 } // namespace net | 109 } // namespace net |
OLD | NEW |