OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_connection_logger.h" | 5 #include "net/quic/quic_connection_logger.h" |
6 | 6 |
7 #include "net/base/socket_performance_watcher.h" | |
8 #include "net/quic/quic_protocol.h" | 7 #include "net/quic/quic_protocol.h" |
9 #include "net/quic/test_tools/quic_test_utils.h" | 8 #include "net/quic/test_tools/quic_test_utils.h" |
| 9 #include "net/socket/socket_performance_watcher.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 | 11 |
12 namespace net { | 12 namespace net { |
13 namespace test { | 13 namespace test { |
14 | 14 |
15 class QuicConnectionLoggerPeer { | 15 class QuicConnectionLoggerPeer { |
16 public: | 16 public: |
17 static size_t num_truncated_acks_sent(const QuicConnectionLogger& logger) { | 17 static size_t num_truncated_acks_sent(const QuicConnectionLogger& logger) { |
18 return logger.num_truncated_acks_sent_; | 18 return logger.num_truncated_acks_sent_; |
19 } | 19 } |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 } | 69 } |
70 | 70 |
71 TEST_F(QuicConnectionLoggerTest, ReceivedPacketLossRate) { | 71 TEST_F(QuicConnectionLoggerTest, ReceivedPacketLossRate) { |
72 QuicConnectionLoggerPeer::set_num_packets_received(logger_, 1); | 72 QuicConnectionLoggerPeer::set_num_packets_received(logger_, 1); |
73 QuicConnectionLoggerPeer::set_largest_received_packet_number(logger_, 2); | 73 QuicConnectionLoggerPeer::set_largest_received_packet_number(logger_, 2); |
74 EXPECT_EQ(0.5f, logger_.ReceivedPacketLossRate()); | 74 EXPECT_EQ(0.5f, logger_.ReceivedPacketLossRate()); |
75 } | 75 } |
76 | 76 |
77 } // namespace test | 77 } // namespace test |
78 } // namespace net | 78 } // namespace net |
OLD | NEW |