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

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

Issue 549433006: Fix the logic for computing the number of truncated QUIC ACK frames sent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test Created 6 years, 3 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
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
eroman 2014/09/09 00:08:01 welcome to 2014
Ryan Hamilton 2014/09/09 19:00:36 Get off my lawn! :>
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "net/quic/quic_connection_logger.h"
6
7 #include "net/quic/quic_protocol.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 namespace net {
11 namespace test {
12
13 class QuicConnectionLoggerPeer {
14 public:
15 static size_t num_truncated_acks_sent(const QuicConnectionLogger& logger) {
16 return logger.num_truncated_acks_sent_;
17 }
18 };
19
20 class QuicConnectionLoggerTest : public ::testing::Test {
21 protected:
22 QuicConnectionLoggerTest() : logger_(net_log_) {}
23
24 BoundNetLog net_log_;
25 QuicConnectionLogger logger_;
26 };
27
28 TEST_F(QuicConnectionLoggerTest, TruncatedAcksSent) {
29 QuicAckFrame frame;
30 logger_.OnFrameAddedToPacket(QuicFrame(&frame));
31 EXPECT_EQ(0u, QuicConnectionLoggerPeer::num_truncated_acks_sent(logger_));
32
33 for (QuicPacketSequenceNumber i = 0; i < 512; i += 2) {
34 frame.missing_packets.insert(i);
35 }
36
37 logger_.OnFrameAddedToPacket(QuicFrame(&frame));
38 EXPECT_EQ(1u, QuicConnectionLoggerPeer::num_truncated_acks_sent(logger_));
39 }
eroman 2014/09/09 00:08:01 can you add a test where truncation does not occur
Ryan Hamilton 2014/09/09 19:00:36 Done. (That happened implicitly when the empty fra
40
41
42 } // namespace test
43 } // namespace net
OLDNEW
« net/quic/quic_connection_logger.cc ('K') | « net/quic/quic_connection_logger.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698