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

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

Issue 1660593004: Landing Recent QUIC changes until 01/28/2016 18:41 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0202
Patch Set: Created 4 years, 10 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_unacked_packet_map.cc ('k') | net/quic/quic_utils.h » ('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_unacked_packet_map.h" 5 #include "net/quic/quic_unacked_packet_map.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "net/quic/quic_flags.h" 8 #include "net/quic/quic_flags.h"
9 #include "net/quic/quic_utils.h" 9 #include "net/quic/quic_utils.h"
10 #include "net/quic/test_tools/quic_test_utils.h" 10 #include "net/quic/test_tools/quic_test_utils.h"
(...skipping 20 matching lines...) Expand all
31 31
32 SerializedPacket CreateRetransmittablePacket(QuicPacketNumber packet_number) { 32 SerializedPacket CreateRetransmittablePacket(QuicPacketNumber packet_number) {
33 return CreateRetransmittablePacketForStream(packet_number, 33 return CreateRetransmittablePacketForStream(packet_number,
34 kHeadersStreamId); 34 kHeadersStreamId);
35 } 35 }
36 36
37 SerializedPacket CreateRetransmittablePacketForStream( 37 SerializedPacket CreateRetransmittablePacketForStream(
38 QuicPacketNumber packet_number, 38 QuicPacketNumber packet_number,
39 QuicStreamId stream_id) { 39 QuicStreamId stream_id) {
40 packets_.push_back(new QuicEncryptedPacket(nullptr, kDefaultLength)); 40 packets_.push_back(new QuicEncryptedPacket(nullptr, kDefaultLength));
41 QuicFrames* frames = new QuicFrames(); 41 SerializedPacket packet(kDefaultPathId, packet_number,
42 PACKET_1BYTE_PACKET_NUMBER, packets_.back(), 0,
43 false, false);
42 QuicStreamFrame* frame = new QuicStreamFrame(); 44 QuicStreamFrame* frame = new QuicStreamFrame();
43 frame->stream_id = stream_id; 45 frame->stream_id = stream_id;
44 frames->push_back(QuicFrame(frame)); 46 packet.retransmittable_frames.push_back(QuicFrame(frame));
45 return SerializedPacket(kDefaultPathId, packet_number, 47 return packet;
46 PACKET_1BYTE_PACKET_NUMBER, packets_.back(), 0,
47 frames, false, false);
48 } 48 }
49 49
50 SerializedPacket CreateNonRetransmittablePacket( 50 SerializedPacket CreateNonRetransmittablePacket(
51 QuicPacketNumber packet_number) { 51 QuicPacketNumber packet_number) {
52 packets_.push_back(new QuicEncryptedPacket(nullptr, kDefaultLength)); 52 packets_.push_back(new QuicEncryptedPacket(nullptr, kDefaultLength));
53 return SerializedPacket(kDefaultPathId, packet_number, 53 return SerializedPacket(kDefaultPathId, packet_number,
54 PACKET_1BYTE_PACKET_NUMBER, packets_.back(), 0, 54 PACKET_1BYTE_PACKET_NUMBER, packets_.back(), 0,
55 nullptr, false, false); 55 false, false);
56 } 56 }
57 57
58 void VerifyInFlightPackets(QuicPacketNumber* packets, size_t num_packets) { 58 void VerifyInFlightPackets(QuicPacketNumber* packets, size_t num_packets) {
59 unacked_packets_.RemoveObsoletePackets(); 59 unacked_packets_.RemoveObsoletePackets();
60 if (num_packets == 0) { 60 if (num_packets == 0) {
61 EXPECT_FALSE(unacked_packets_.HasInFlightPackets()); 61 EXPECT_FALSE(unacked_packets_.HasInFlightPackets());
62 EXPECT_FALSE(unacked_packets_.HasMultipleInFlightPackets()); 62 EXPECT_FALSE(unacked_packets_.HasMultipleInFlightPackets());
63 return; 63 return;
64 } 64 }
65 if (num_packets == 1) { 65 if (num_packets == 1) {
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 EXPECT_FALSE(unacked_packets_.IsUnacked(2)); 413 EXPECT_FALSE(unacked_packets_.IsUnacked(2));
414 EXPECT_TRUE(unacked_packets_.IsUnacked(3)); 414 EXPECT_TRUE(unacked_packets_.IsUnacked(3));
415 EXPECT_FALSE(unacked_packets_.IsUnacked(4)); 415 EXPECT_FALSE(unacked_packets_.IsUnacked(4));
416 EXPECT_TRUE(unacked_packets_.IsUnacked(5)); 416 EXPECT_TRUE(unacked_packets_.IsUnacked(5));
417 EXPECT_EQ(5u, unacked_packets_.largest_sent_packet()); 417 EXPECT_EQ(5u, unacked_packets_.largest_sent_packet());
418 } 418 }
419 419
420 } // namespace 420 } // namespace
421 } // namespace test 421 } // namespace test
422 } // namespace net 422 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_unacked_packet_map.cc ('k') | net/quic/quic_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698