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

Side by Side Diff: net/quic/core/quic_sent_packet_manager_test.cc

Issue 2318773002: Minor refactoring in QuicDispatcher. No functional change, not flag-protected. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | net/tools/quic/quic_dispatcher.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/core/quic_sent_packet_manager.h" 5 #include "net/quic/core/quic_sent_packet_manager.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "net/quic/core/quic_flags.h" 10 #include "net/quic/core/quic_flags.h"
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 ExpectAck(4); 557 ExpectAck(4);
558 EXPECT_CALL(*loss_algorithm, DetectLosses(_, _, _, _, _)); 558 EXPECT_CALL(*loss_algorithm, DetectLosses(_, _, _, _, _));
559 manager_.OnIncomingAck(ack_frame, clock_.Now()); 559 manager_.OnIncomingAck(ack_frame, clock_.Now());
560 RetransmitAndSendPacket(3, 5, LOSS_RETRANSMISSION); 560 RetransmitAndSendPacket(3, 5, LOSS_RETRANSMISSION);
561 } 561 }
562 562
563 // Ack 3, which causes SpuriousRetransmitDetected to be called. 563 // Ack 3, which causes SpuriousRetransmitDetected to be called.
564 { 564 {
565 QuicAckFrame ack_frame = InitAckFrame(4); 565 QuicAckFrame ack_frame = InitAckFrame(4);
566 NackPackets(2, 3, &ack_frame); 566 NackPackets(2, 3, &ack_frame);
567 EXPECT_CALL(*loss_algorithm, DetectLosses(_, _, _, _, _));
568 EXPECT_CALL(*loss_algorithm, SpuriousRetransmitDetected(_, _, _, 5));
569 manager_.OnIncomingAck(ack_frame, clock_.Now());
570 } 567 }
571 } 568 }
572 569
573 TEST_P(QuicSentPacketManagerTest, GetLeastUnacked) { 570 TEST_P(QuicSentPacketManagerTest, GetLeastUnacked) {
574 EXPECT_EQ(1u, manager_.GetLeastUnacked(kDefaultPathId)); 571 EXPECT_EQ(1u, manager_.GetLeastUnacked(kDefaultPathId));
575 } 572 }
576 573
577 TEST_P(QuicSentPacketManagerTest, GetLeastUnackedUnacked) { 574 TEST_P(QuicSentPacketManagerTest, GetLeastUnackedUnacked) {
578 SendDataPacket(1); 575 SendDataPacket(1);
579 EXPECT_EQ(1u, manager_.GetLeastUnacked(kDefaultPathId)); 576 EXPECT_EQ(1u, manager_.GetLeastUnacked(kDefaultPathId));
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after
1666 ExpectAck(1); 1663 ExpectAck(1);
1667 EXPECT_CALL(*network_change_visitor_, 1664 EXPECT_CALL(*network_change_visitor_,
1668 OnPathMtuIncreased(kDefaultLength + 100)); 1665 OnPathMtuIncreased(kDefaultLength + 100));
1669 QuicAckFrame ack_frame = InitAckFrame(1); 1666 QuicAckFrame ack_frame = InitAckFrame(1);
1670 manager_.OnIncomingAck(ack_frame, clock_.Now()); 1667 manager_.OnIncomingAck(ack_frame, clock_.Now());
1671 } 1668 }
1672 1669
1673 } // namespace 1670 } // namespace
1674 } // namespace test 1671 } // namespace test
1675 } // namespace net 1672 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/tools/quic/quic_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698