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

Side by Side Diff: net/quic/congestion_control/tcp_cubic_sender_test.cc

Issue 680253005: Fixes reduction for n-connection emulation in TCP Reno. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Delay_use_of_FORWARD_SECURE_encrypter_78801773
Patch Set: Created 6 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/congestion_control/tcp_cubic_sender.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <algorithm> 5 #include <algorithm>
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "net/quic/congestion_control/rtt_stats.h" 9 #include "net/quic/congestion_control/rtt_stats.h"
10 #include "net/quic/congestion_control/tcp_cubic_sender.h" 10 #include "net/quic/congestion_control/tcp_cubic_sender.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } 42 }
43 43
44 QuicPacketCount slowstart_threshold() { 44 QuicPacketCount slowstart_threshold() {
45 return slowstart_threshold_; 45 return slowstart_threshold_;
46 } 46 }
47 47
48 const HybridSlowStart& hybrid_slow_start() const { 48 const HybridSlowStart& hybrid_slow_start() const {
49 return hybrid_slow_start_; 49 return hybrid_slow_start_;
50 } 50 }
51 51
52 float GetRenoBeta() const {
53 return RenoBeta();
54 }
55
52 RttStats rtt_stats_; 56 RttStats rtt_stats_;
53 QuicConnectionStats stats_; 57 QuicConnectionStats stats_;
54 }; 58 };
55 59
56 class TcpCubicSenderTest : public ::testing::Test { 60 class TcpCubicSenderTest : public ::testing::Test {
57 protected: 61 protected:
58 TcpCubicSenderTest() 62 TcpCubicSenderTest()
59 : one_ms_(QuicTime::Delta::FromMilliseconds(1)), 63 : one_ms_(QuicTime::Delta::FromMilliseconds(1)),
60 sender_(new TcpCubicSenderPeer(&clock_, true, 64 sender_(new TcpCubicSenderPeer(&clock_, true,
61 kDefaultMaxCongestionWindowTCP)), 65 kDefaultMaxCongestionWindowTCP)),
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 AckNPackets(2); 596 AckNPackets(2);
593 } 597 }
594 SendAvailableSendWindow(); 598 SendAvailableSendWindow();
595 QuicByteCount expected_send_window = kDefaultWindowTCP + 599 QuicByteCount expected_send_window = kDefaultWindowTCP +
596 (kDefaultTCPMSS * 2 * kNumberOfAcks); 600 (kDefaultTCPMSS * 2 * kNumberOfAcks);
597 EXPECT_EQ(expected_send_window, sender_->GetCongestionWindow()); 601 EXPECT_EQ(expected_send_window, sender_->GetCongestionWindow());
598 602
599 LoseNPackets(1); 603 LoseNPackets(1);
600 604
601 // We should now have fallen out of slow start with a reduced window. 605 // We should now have fallen out of slow start with a reduced window.
602 expected_send_window *= kRenoBeta; 606 expected_send_window = expected_send_window * sender_->GetRenoBeta();
603 EXPECT_EQ(expected_send_window, sender_->GetCongestionWindow()); 607 EXPECT_EQ(expected_send_window, sender_->GetCongestionWindow());
604 608
605 // No congestion window growth should occur in recovery phase, i.e., until the 609 // No congestion window growth should occur in recovery phase, i.e., until the
606 // currently outstanding 20 packets are acked. 610 // currently outstanding 20 packets are acked.
607 for (int i = 0; i < 10; ++i) { 611 for (int i = 0; i < 10; ++i) {
608 // Send our full send window. 612 // Send our full send window.
609 SendAvailableSendWindow(); 613 SendAvailableSendWindow();
610 EXPECT_TRUE(sender_->InRecovery()); 614 EXPECT_TRUE(sender_->InRecovery());
611 AckNPackets(2); 615 AckNPackets(2);
612 EXPECT_EQ(expected_send_window, sender_->GetCongestionWindow()); 616 EXPECT_EQ(expected_send_window, sender_->GetCongestionWindow());
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 683
680 // Next ack should cause congestion window to grow by 1MSS. 684 // Next ack should cause congestion window to grow by 1MSS.
681 SendAvailableSendWindow(); 685 SendAvailableSendWindow();
682 AckNPackets(2); 686 AckNPackets(2);
683 expected_send_window += kDefaultTCPMSS; 687 expected_send_window += kDefaultTCPMSS;
684 EXPECT_EQ(expected_send_window, sender_->GetCongestionWindow()); 688 EXPECT_EQ(expected_send_window, sender_->GetCongestionWindow());
685 } 689 }
686 690
687 } // namespace test 691 } // namespace test
688 } // namespace net 692 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/tcp_cubic_sender.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698