| 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/quic_bandwidth.h" | 5 #include "net/quic/quic_bandwidth.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
| 7 | 7 |
| 8 namespace net { | 8 namespace net { |
| 9 namespace test { | 9 namespace test { |
| 10 | 10 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 QuicTime::Delta::FromMilliseconds(1))); | 74 QuicTime::Delta::FromMilliseconds(1))); |
| 75 EXPECT_EQ(200000u, QuicBandwidth::FromKBytesPerSecond(2000).ToBytesPerPeriod( | 75 EXPECT_EQ(200000u, QuicBandwidth::FromKBytesPerSecond(2000).ToBytesPerPeriod( |
| 76 QuicTime::Delta::FromMilliseconds(100))); | 76 QuicTime::Delta::FromMilliseconds(100))); |
| 77 EXPECT_EQ(200u, QuicBandwidth::FromKBytesPerSecond(2000).ToKBytesPerPeriod( | 77 EXPECT_EQ(200u, QuicBandwidth::FromKBytesPerSecond(2000).ToKBytesPerPeriod( |
| 78 QuicTime::Delta::FromMilliseconds(100))); | 78 QuicTime::Delta::FromMilliseconds(100))); |
| 79 } | 79 } |
| 80 | 80 |
| 81 TEST_F(QuicBandwidthTest, TransferTime) { | 81 TEST_F(QuicBandwidthTest, TransferTime) { |
| 82 EXPECT_EQ(QuicTime::Delta::FromSeconds(1), | 82 EXPECT_EQ(QuicTime::Delta::FromSeconds(1), |
| 83 QuicBandwidth::FromKBytesPerSecond(1).TransferTime(1000)); | 83 QuicBandwidth::FromKBytesPerSecond(1).TransferTime(1000)); |
| 84 EXPECT_EQ(QuicTime::Delta::Zero(), QuicBandwidth::Zero().TransferTime(1000)); |
| 84 } | 85 } |
| 85 | 86 |
| 86 } // namespace test | 87 } // namespace test |
| 87 } // namespace net | 88 } // namespace net |
| OLD | NEW |