| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 } | 66 } |
| 67 | 67 |
| 68 TEST_F(QuicConnectionLoggerTest, ReceivedPacketLossRate) { | 68 TEST_F(QuicConnectionLoggerTest, ReceivedPacketLossRate) { |
| 69 QuicConnectionLoggerPeer::set_num_packets_received(logger_, 1); | 69 QuicConnectionLoggerPeer::set_num_packets_received(logger_, 1); |
| 70 QuicConnectionLoggerPeer::set_largest_received_packet_number(logger_, 2); | 70 QuicConnectionLoggerPeer::set_largest_received_packet_number(logger_, 2); |
| 71 EXPECT_EQ(0.5f, logger_.ReceivedPacketLossRate()); | 71 EXPECT_EQ(0.5f, logger_.ReceivedPacketLossRate()); |
| 72 } | 72 } |
| 73 | 73 |
| 74 } // namespace test | 74 } // namespace test |
| 75 } // namespace net | 75 } // namespace net |
| OLD | NEW |