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

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

Issue 515303003: Landing Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bug fix for 409191 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
« no previous file with comments | « net/quic/quic_sent_packet_manager.cc ('k') | net/quic/quic_unacked_packet_map.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/quic_sent_packet_manager.h" 5 #include "net/quic/quic_sent_packet_manager.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/test_tools/quic_config_peer.h" 9 #include "net/quic/test_tools/quic_config_peer.h"
10 #include "net/quic/test_tools/quic_sent_packet_manager_peer.h" 10 #include "net/quic/test_tools/quic_sent_packet_manager_peer.h"
(...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 const size_t kNumSentCryptoPackets = 2; 1018 const size_t kNumSentCryptoPackets = 2;
1019 for (size_t i = 1; i <= kNumSentCryptoPackets; ++i) { 1019 for (size_t i = 1; i <= kNumSentCryptoPackets; ++i) {
1020 SendCryptoPacket(i); 1020 SendCryptoPacket(i);
1021 } 1021 }
1022 SerializedPacket packet(CreateDataPacket(3)); 1022 SerializedPacket packet(CreateDataPacket(3));
1023 manager_.OnSerializedPacket(packet); 1023 manager_.OnSerializedPacket(packet);
1024 EXPECT_TRUE(QuicSentPacketManagerPeer::HasUnackedCryptoPackets(&manager_)); 1024 EXPECT_TRUE(QuicSentPacketManagerPeer::HasUnackedCryptoPackets(&manager_));
1025 1025
1026 // Retransmit 2 crypto packets, but not the serialized packet. 1026 // Retransmit 2 crypto packets, but not the serialized packet.
1027 manager_.OnRetransmissionTimeout(); 1027 manager_.OnRetransmissionTimeout();
1028 RetransmitNextPacket(6); 1028 RetransmitNextPacket(4);
1029 RetransmitNextPacket(7); 1029 RetransmitNextPacket(5);
1030 EXPECT_FALSE(manager_.HasPendingRetransmissions()); 1030 EXPECT_FALSE(manager_.HasPendingRetransmissions());
1031 EXPECT_TRUE(QuicSentPacketManagerPeer::HasUnackedCryptoPackets(&manager_)); 1031 EXPECT_TRUE(QuicSentPacketManagerPeer::HasUnackedCryptoPackets(&manager_));
1032 } 1032 }
1033 1033
1034 TEST_F(QuicSentPacketManagerTest, 1034 TEST_F(QuicSentPacketManagerTest,
1035 CryptoHandshakeRetransmissionThenRetransmitAll) { 1035 CryptoHandshakeRetransmissionThenRetransmitAll) {
1036 // Send 1 crypto packet. 1036 // Send 1 crypto packet.
1037 SendCryptoPacket(1); 1037 SendCryptoPacket(1);
1038 EXPECT_TRUE(QuicSentPacketManagerPeer::HasUnackedCryptoPackets(&manager_)); 1038 EXPECT_TRUE(QuicSentPacketManagerPeer::HasUnackedCryptoPackets(&manager_));
1039 1039
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
1439 .WillOnce(Return(100 * kDefaultTCPMSS)); 1439 .WillOnce(Return(100 * kDefaultTCPMSS));
1440 EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _)); 1440 EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
1441 manager_.SetFromConfig(config); 1441 manager_.SetFromConfig(config);
1442 1442
1443 EXPECT_TRUE(manager_.using_pacing()); 1443 EXPECT_TRUE(manager_.using_pacing());
1444 } 1444 }
1445 1445
1446 } // namespace 1446 } // namespace
1447 } // namespace test 1447 } // namespace test
1448 } // namespace net 1448 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_sent_packet_manager.cc ('k') | net/quic/quic_unacked_packet_map.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698