Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(973)

Unified Diff: net/quic/chromium/quic_connection_logger_unittest.cc

Issue 2217483003: Remove untracked histograms: Net.QuicSession.TruncatedAcksReceived/TruncatedAcksSent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fully remove the truncated acks counting Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/chromium/quic_connection_logger.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/chromium/quic_connection_logger_unittest.cc
diff --git a/net/quic/chromium/quic_connection_logger_unittest.cc b/net/quic/chromium/quic_connection_logger_unittest.cc
deleted file mode 100644
index 8e8b82c88291dcc4fea6154af35eb33df77e83e5..0000000000000000000000000000000000000000
--- a/net/quic/chromium/quic_connection_logger_unittest.cc
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/quic/chromium/quic_connection_logger.h"
-
-#include "net/cert/x509_certificate.h"
-#include "net/quic/test_tools/quic_connection_peer.h"
-#include "net/quic/test_tools/quic_test_utils.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace net {
-namespace test {
-
-class QuicConnectionLoggerPeer {
- public:
- static size_t num_truncated_acks_sent(const QuicConnectionLogger& logger) {
- return logger.num_truncated_acks_sent_;
- }
-
- static void set_num_packets_received(QuicConnectionLogger* logger,
- int value) {
- logger->num_packets_received_ = value;
- }
-
- static void set_largest_received_packet_number(QuicConnectionLogger* logger,
- int value) {
- logger->largest_received_packet_number_ = value;
- }
-};
-
-class QuicConnectionLoggerTest : public ::testing::Test {
- protected:
- QuicConnectionLoggerTest()
- : session_(new MockQuicConnection(&helper_,
- &alarm_factory_,
- Perspective::IS_CLIENT)),
- logger_(&session_,
- "CONNECTION_UNKNOWN",
- /*socket_performance_watcher=*/nullptr,
- net_log_) {
- QuicConnectionPeer::GetFramer(session_.connection())
- ->set_version(QUIC_VERSION_33);
- }
-
- BoundNetLog net_log_;
- MockQuicConnectionHelper helper_;
- MockAlarmFactory alarm_factory_;
- MockQuicSpdySession session_;
- QuicConnectionLogger logger_;
-};
-
-TEST_F(QuicConnectionLoggerTest, TruncatedAcksSentNotChanged) {
- QuicAckFrame frame;
- logger_.OnFrameAddedToPacket(QuicFrame(&frame));
- EXPECT_EQ(0u, QuicConnectionLoggerPeer::num_truncated_acks_sent(logger_));
-
- for (QuicPacketNumber i = 0; i < 256; ++i) {
- frame.packets.Add(i);
- }
- logger_.OnFrameAddedToPacket(QuicFrame(&frame));
- EXPECT_EQ(0u, QuicConnectionLoggerPeer::num_truncated_acks_sent(logger_));
-}
-
-TEST_F(QuicConnectionLoggerTest, TruncatedAcksSent) {
- QuicAckFrame frame;
- for (QuicPacketNumber i = 0; i < 512; i += 2) {
- frame.packets.Add(i);
- }
- logger_.OnFrameAddedToPacket(QuicFrame(&frame));
- EXPECT_EQ(1u, QuicConnectionLoggerPeer::num_truncated_acks_sent(logger_));
-}
-
-TEST_F(QuicConnectionLoggerTest, ReceivedPacketLossRate) {
- QuicConnectionLoggerPeer::set_num_packets_received(&logger_, 1);
- QuicConnectionLoggerPeer::set_largest_received_packet_number(&logger_, 2);
- EXPECT_EQ(0.5f, logger_.ReceivedPacketLossRate());
-}
-
-} // namespace test
-} // namespace net
« no previous file with comments | « net/quic/chromium/quic_connection_logger.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698