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

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

Issue 2316193002: Allow IP migration. (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 | « net/quic/core/quic_protocol.h ('k') | net/quic/core/quic_server_session_base.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 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after
1600 int64_t default_init_rtt = rtt_stats->initial_rtt_us(); 1600 int64_t default_init_rtt = rtt_stats->initial_rtt_us();
1601 rtt_stats->set_initial_rtt_us(default_init_rtt * 2); 1601 rtt_stats->set_initial_rtt_us(default_init_rtt * 2);
1602 EXPECT_EQ(2 * default_init_rtt, rtt_stats->initial_rtt_us()); 1602 EXPECT_EQ(2 * default_init_rtt, rtt_stats->initial_rtt_us());
1603 1603
1604 QuicSentPacketManagerPeer::SetConsecutiveRtoCount(&manager_, 1); 1604 QuicSentPacketManagerPeer::SetConsecutiveRtoCount(&manager_, 1);
1605 EXPECT_EQ(1u, manager_.GetConsecutiveRtoCount()); 1605 EXPECT_EQ(1u, manager_.GetConsecutiveRtoCount());
1606 QuicSentPacketManagerPeer::SetConsecutiveTlpCount(&manager_, 2); 1606 QuicSentPacketManagerPeer::SetConsecutiveTlpCount(&manager_, 2);
1607 EXPECT_EQ(2u, manager_.GetConsecutiveTlpCount()); 1607 EXPECT_EQ(2u, manager_.GetConsecutiveTlpCount());
1608 1608
1609 EXPECT_CALL(*send_algorithm_, OnConnectionMigration()); 1609 EXPECT_CALL(*send_algorithm_, OnConnectionMigration());
1610 manager_.OnConnectionMigration(kDefaultPathId, UNSPECIFIED_CHANGE); 1610 manager_.OnConnectionMigration(kDefaultPathId, IPV4_TO_IPV4_CHANGE);
1611 1611
1612 EXPECT_EQ(default_init_rtt, rtt_stats->initial_rtt_us()); 1612 EXPECT_EQ(default_init_rtt, rtt_stats->initial_rtt_us());
1613 EXPECT_EQ(0u, manager_.GetConsecutiveRtoCount()); 1613 EXPECT_EQ(0u, manager_.GetConsecutiveRtoCount());
1614 EXPECT_EQ(0u, manager_.GetConsecutiveTlpCount()); 1614 EXPECT_EQ(0u, manager_.GetConsecutiveTlpCount());
1615 } 1615 }
1616 1616
1617 TEST_P(QuicSentPacketManagerTest, ConnectionMigrationIPSubnetChange) { 1617 TEST_P(QuicSentPacketManagerTest, ConnectionMigrationIPSubnetChange) {
1618 RttStats* rtt_stats = const_cast<RttStats*>(manager_.GetRttStats()); 1618 RttStats* rtt_stats = const_cast<RttStats*>(manager_.GetRttStats());
1619 int64_t default_init_rtt = rtt_stats->initial_rtt_us(); 1619 int64_t default_init_rtt = rtt_stats->initial_rtt_us();
1620 rtt_stats->set_initial_rtt_us(default_init_rtt * 2); 1620 rtt_stats->set_initial_rtt_us(default_init_rtt * 2);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1663 ExpectAck(1); 1663 ExpectAck(1);
1664 EXPECT_CALL(*network_change_visitor_, 1664 EXPECT_CALL(*network_change_visitor_,
1665 OnPathMtuIncreased(kDefaultLength + 100)); 1665 OnPathMtuIncreased(kDefaultLength + 100));
1666 QuicAckFrame ack_frame = InitAckFrame(1); 1666 QuicAckFrame ack_frame = InitAckFrame(1);
1667 manager_.OnIncomingAck(ack_frame, clock_.Now()); 1667 manager_.OnIncomingAck(ack_frame, clock_.Now());
1668 } 1668 }
1669 1669
1670 } // namespace 1670 } // namespace
1671 } // namespace test 1671 } // namespace test
1672 } // namespace net 1672 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_protocol.h ('k') | net/quic/core/quic_server_session_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698