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

Side by Side Diff: net/quic/quic_connection_logger_unittest.cc

Issue 1977153002: Rename various MockConnectionFoo classes to MockQuicConnectionFoo. No behavior change. This is cons… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@121576119
Patch Set: Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « net/quic/quic_client_push_promise_index_test.cc ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/quic/quic_protocol.h" 7 #include "net/quic/quic_protocol.h"
8 #include "net/quic/test_tools/quic_connection_peer.h" 8 #include "net/quic/test_tools/quic_connection_peer.h"
9 #include "net/quic/test_tools/quic_test_utils.h" 9 #include "net/quic/test_tools/quic_test_utils.h"
10 #include "net/socket/socket_performance_watcher.h" 10 #include "net/socket/socket_performance_watcher.h"
(...skipping 15 matching lines...) Expand all
26 26
27 static void set_largest_received_packet_number(QuicConnectionLogger& logger, 27 static void set_largest_received_packet_number(QuicConnectionLogger& logger,
28 int value) { 28 int value) {
29 logger.largest_received_packet_number_ = value; 29 logger.largest_received_packet_number_ = value;
30 } 30 }
31 }; 31 };
32 32
33 class QuicConnectionLoggerTest : public ::testing::Test { 33 class QuicConnectionLoggerTest : public ::testing::Test {
34 protected: 34 protected:
35 QuicConnectionLoggerTest() 35 QuicConnectionLoggerTest()
36 : session_(new MockConnection(&helper_, 36 : session_(new MockQuicConnection(&helper_,
37 &alarm_factory_, 37 &alarm_factory_,
38 Perspective::IS_CLIENT)), 38 Perspective::IS_CLIENT)),
39 logger_(&session_, 39 logger_(&session_,
40 "CONNECTION_UNKNOWN", 40 "CONNECTION_UNKNOWN",
41 /*socket_performance_watcher=*/nullptr, 41 /*socket_performance_watcher=*/nullptr,
42 net_log_) { 42 net_log_) {
43 QuicConnectionPeer::GetFramer(session_.connection()) 43 QuicConnectionPeer::GetFramer(session_.connection())
44 ->set_version(QUIC_VERSION_33); 44 ->set_version(QUIC_VERSION_33);
45 } 45 }
46 46
47 BoundNetLog net_log_; 47 BoundNetLog net_log_;
48 MockConnectionHelper helper_; 48 MockQuicConnectionHelper helper_;
49 MockAlarmFactory alarm_factory_; 49 MockAlarmFactory alarm_factory_;
50 MockQuicSpdySession session_; 50 MockQuicSpdySession session_;
51 QuicConnectionLogger logger_; 51 QuicConnectionLogger logger_;
52 }; 52 };
53 53
54 TEST_F(QuicConnectionLoggerTest, TruncatedAcksSentNotChanged) { 54 TEST_F(QuicConnectionLoggerTest, TruncatedAcksSentNotChanged) {
55 QuicAckFrame frame; 55 QuicAckFrame frame;
56 logger_.OnFrameAddedToPacket(QuicFrame(&frame)); 56 logger_.OnFrameAddedToPacket(QuicFrame(&frame));
57 EXPECT_EQ(0u, QuicConnectionLoggerPeer::num_truncated_acks_sent(logger_)); 57 EXPECT_EQ(0u, QuicConnectionLoggerPeer::num_truncated_acks_sent(logger_));
58 58
(...skipping 14 matching lines...) Expand all
73 } 73 }
74 74
75 TEST_F(QuicConnectionLoggerTest, ReceivedPacketLossRate) { 75 TEST_F(QuicConnectionLoggerTest, ReceivedPacketLossRate) {
76 QuicConnectionLoggerPeer::set_num_packets_received(logger_, 1); 76 QuicConnectionLoggerPeer::set_num_packets_received(logger_, 1);
77 QuicConnectionLoggerPeer::set_largest_received_packet_number(logger_, 2); 77 QuicConnectionLoggerPeer::set_largest_received_packet_number(logger_, 2);
78 EXPECT_EQ(0.5f, logger_.ReceivedPacketLossRate()); 78 EXPECT_EQ(0.5f, logger_.ReceivedPacketLossRate());
79 } 79 }
80 80
81 } // namespace test 81 } // namespace test
82 } // namespace net 82 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_client_push_promise_index_test.cc ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698