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

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

Issue 2445983003: Default enable QUIC's Cubic in bytes congestion control implementation. Protected by ENABLED FLAGS… (Closed)
Patch Set: Updated patchset dependency Created 4 years, 1 month 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_sent_packet_manager.cc ('k') | net/tools/quic/end_to_end_test.cc » ('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 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "net/quic/core/quic_flags.h" 10 #include "net/quic/core/quic_flags.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 return params; 76 return params;
77 } 77 }
78 78
79 class QuicSentPacketManagerTest : public ::testing::TestWithParam<TestParams> { 79 class QuicSentPacketManagerTest : public ::testing::TestWithParam<TestParams> {
80 protected: 80 protected:
81 QuicSentPacketManagerTest() 81 QuicSentPacketManagerTest()
82 : manager_(Perspective::IS_SERVER, 82 : manager_(Perspective::IS_SERVER,
83 kDefaultPathId, 83 kDefaultPathId,
84 &clock_, 84 &clock_,
85 &stats_, 85 &stats_,
86 kCubic, 86 FLAGS_quic_default_enable_cubic_bytes ? kCubicBytes : kCubic,
87 kNack, 87 kNack,
88 /*delegate=*/nullptr), 88 /*delegate=*/nullptr),
89 send_algorithm_(new StrictMock<MockSendAlgorithm>), 89 send_algorithm_(new StrictMock<MockSendAlgorithm>),
90 network_change_visitor_(new StrictMock<MockNetworkChangeVisitor>) { 90 network_change_visitor_(new StrictMock<MockNetworkChangeVisitor>) {
91 QuicSentPacketManagerPeer::SetSendAlgorithm(&manager_, send_algorithm_); 91 QuicSentPacketManagerPeer::SetSendAlgorithm(&manager_, send_algorithm_);
92 // Disable tail loss probes for most tests. 92 // Disable tail loss probes for most tests.
93 QuicSentPacketManagerPeer::SetMaxTailLossProbes(&manager_, 0); 93 QuicSentPacketManagerPeer::SetMaxTailLossProbes(&manager_, 0);
94 // Advance the time 1s so the send times are never QuicTime::Zero. 94 // Advance the time 1s so the send times are never QuicTime::Zero.
95 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1000)); 95 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1000));
96 manager_.SetNetworkChangeVisitor(network_change_visitor_.get()); 96 manager_.SetNetworkChangeVisitor(network_change_visitor_.get());
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after
1436 EXPECT_CALL(*network_change_visitor_, OnCongestionChange()); 1436 EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
1437 manager_.SetFromConfig(config); 1437 manager_.SetFromConfig(config);
1438 EXPECT_EQ(kBBR, QuicSentPacketManagerPeer::GetSendAlgorithm(manager_) 1438 EXPECT_EQ(kBBR, QuicSentPacketManagerPeer::GetSendAlgorithm(manager_)
1439 ->GetCongestionControlType()); 1439 ->GetCongestionControlType());
1440 1440
1441 options.clear(); 1441 options.clear();
1442 options.push_back(kBYTE); 1442 options.push_back(kBYTE);
1443 QuicConfigPeer::SetReceivedConnectionOptions(&config, options); 1443 QuicConfigPeer::SetReceivedConnectionOptions(&config, options);
1444 EXPECT_CALL(*network_change_visitor_, OnCongestionChange()); 1444 EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
1445 manager_.SetFromConfig(config); 1445 manager_.SetFromConfig(config);
1446 EXPECT_EQ(kCubicBytes, QuicSentPacketManagerPeer::GetSendAlgorithm(manager_) 1446 if (FLAGS_quic_default_enable_cubic_bytes) {
1447 ->GetCongestionControlType()); 1447 EXPECT_EQ(kCubic, QuicSentPacketManagerPeer::GetSendAlgorithm(manager_)
1448 ->GetCongestionControlType());
1449 } else {
1450 EXPECT_EQ(kCubicBytes, QuicSentPacketManagerPeer::GetSendAlgorithm(manager_)
1451 ->GetCongestionControlType());
1452 }
1448 1453
1449 options.clear(); 1454 options.clear();
1450 options.push_back(kRENO); 1455 options.push_back(kRENO);
1451 options.push_back(kBYTE); 1456 options.push_back(kBYTE);
1452 QuicConfigPeer::SetReceivedConnectionOptions(&config, options); 1457 QuicConfigPeer::SetReceivedConnectionOptions(&config, options);
1453 EXPECT_CALL(*network_change_visitor_, OnCongestionChange()); 1458 EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
1454 manager_.SetFromConfig(config); 1459 manager_.SetFromConfig(config);
1455 EXPECT_EQ(kRenoBytes, QuicSentPacketManagerPeer::GetSendAlgorithm(manager_) 1460 EXPECT_EQ(kRenoBytes, QuicSentPacketManagerPeer::GetSendAlgorithm(manager_)
1456 ->GetCongestionControlType()); 1461 ->GetCongestionControlType());
1457 } 1462 }
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1733 ExpectAck(1); 1738 ExpectAck(1);
1734 EXPECT_CALL(*network_change_visitor_, 1739 EXPECT_CALL(*network_change_visitor_,
1735 OnPathMtuIncreased(kDefaultLength + 100)); 1740 OnPathMtuIncreased(kDefaultLength + 100));
1736 QuicAckFrame ack_frame = InitAckFrame(1); 1741 QuicAckFrame ack_frame = InitAckFrame(1);
1737 manager_.OnIncomingAck(ack_frame, clock_.Now()); 1742 manager_.OnIncomingAck(ack_frame, clock_.Now());
1738 } 1743 }
1739 1744
1740 } // namespace 1745 } // namespace
1741 } // namespace test 1746 } // namespace test
1742 } // namespace net 1747 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_sent_packet_manager.cc ('k') | net/tools/quic/end_to_end_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698