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

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

Issue 2132623002: Landing Recent QUIC changes until 2016-07-02 02:45 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing comment about RPCs Created 4 years, 5 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
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 "net/quic/congestion_control/hybrid_slow_start.h" 5 #include "net/quic/congestion_control/hybrid_slow_start.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // RTT of 60ms the detection will happen at 67.5 ms. 52 // RTT of 60ms the detection will happen at 67.5 ms.
53 const int kHybridStartMinSamples = 8; // Number of acks required to trigger. 53 const int kHybridStartMinSamples = 8; // Number of acks required to trigger.
54 54
55 QuicPacketNumber end_packet_number = 1; 55 QuicPacketNumber end_packet_number = 1;
56 slow_start_->StartReceiveRound(end_packet_number++); 56 slow_start_->StartReceiveRound(end_packet_number++);
57 57
58 // Will not trigger since our lowest RTT in our burst is the same as the long 58 // Will not trigger since our lowest RTT in our burst is the same as the long
59 // term RTT provided. 59 // term RTT provided.
60 for (int n = 0; n < kHybridStartMinSamples; ++n) { 60 for (int n = 0; n < kHybridStartMinSamples; ++n) {
61 EXPECT_FALSE(slow_start_->ShouldExitSlowStart( 61 EXPECT_FALSE(slow_start_->ShouldExitSlowStart(
62 rtt_.Add(QuicTime::Delta::FromMilliseconds(n)), rtt_, 100)); 62 rtt_ + QuicTime::Delta::FromMilliseconds(n), rtt_, 100));
63 } 63 }
64 slow_start_->StartReceiveRound(end_packet_number++); 64 slow_start_->StartReceiveRound(end_packet_number++);
65 for (int n = 1; n < kHybridStartMinSamples; ++n) { 65 for (int n = 1; n < kHybridStartMinSamples; ++n) {
66 EXPECT_FALSE(slow_start_->ShouldExitSlowStart( 66 EXPECT_FALSE(slow_start_->ShouldExitSlowStart(
67 rtt_.Add(QuicTime::Delta::FromMilliseconds(n + 10)), rtt_, 100)); 67 rtt_ + QuicTime::Delta::FromMilliseconds(n + 10), rtt_, 100));
68 } 68 }
69 // Expect to trigger since all packets in this burst was above the long term 69 // Expect to trigger since all packets in this burst was above the long term
70 // RTT provided. 70 // RTT provided.
71 EXPECT_TRUE(slow_start_->ShouldExitSlowStart( 71 EXPECT_TRUE(slow_start_->ShouldExitSlowStart(
72 rtt_.Add(QuicTime::Delta::FromMilliseconds(10)), rtt_, 100)); 72 rtt_ + QuicTime::Delta::FromMilliseconds(10), rtt_, 100));
73 } 73 }
74 74
75 } // namespace test 75 } // namespace test
76 } // namespace net 76 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/hybrid_slow_start.cc ('k') | net/quic/congestion_control/pacing_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698