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

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

Issue 1908103002: Landing Recent QUIC changes until 4/15/2016 17:20 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 8 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) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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/tcp_cubic_sender_bytes.h" 5 #include "net/quic/congestion_control/tcp_cubic_sender_bytes.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cstdint>
8 #include <memory> 9 #include <memory>
9 10
10 #include "base/logging.h" 11 #include "base/logging.h"
11 #include "net/quic/congestion_control/rtt_stats.h" 12 #include "net/quic/congestion_control/rtt_stats.h"
12 #include "net/quic/crypto/crypto_protocol.h" 13 #include "net/quic/crypto/crypto_protocol.h"
13 #include "net/quic/proto/cached_network_parameters.pb.h" 14 #include "net/quic/proto/cached_network_parameters.pb.h"
14 #include "net/quic/quic_flags.h" 15 #include "net/quic/quic_flags.h"
15 #include "net/quic/quic_protocol.h" 16 #include "net/quic/quic_protocol.h"
16 #include "net/quic/quic_utils.h" 17 #include "net/quic/quic_utils.h"
17 #include "net/quic/test_tools/mock_clock.h" 18 #include "net/quic/test_tools/mock_clock.h"
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 expected_send_window += kDefaultTCPMSS; 281 expected_send_window += kDefaultTCPMSS;
281 EXPECT_EQ(expected_send_window, sender_->GetCongestionWindow()); 282 EXPECT_EQ(expected_send_window, sender_->GetCongestionWindow());
282 283
283 // Now RTO and ensure slow start gets reset. 284 // Now RTO and ensure slow start gets reset.
284 EXPECT_TRUE(sender_->hybrid_slow_start().started()); 285 EXPECT_TRUE(sender_->hybrid_slow_start().started());
285 sender_->OnRetransmissionTimeout(true); 286 sender_->OnRetransmissionTimeout(true);
286 EXPECT_FALSE(sender_->hybrid_slow_start().started()); 287 EXPECT_FALSE(sender_->hybrid_slow_start().started());
287 } 288 }
288 289
289 TEST_F(TcpCubicSenderBytesTest, SlowStartHalfPacketLossWithLargeReduction) { 290 TEST_F(TcpCubicSenderBytesTest, SlowStartHalfPacketLossWithLargeReduction) {
290 FLAGS_quic_sslr_byte_conservation = true;
291 QuicConfig config; 291 QuicConfig config;
292 QuicTagVector options; 292 QuicTagVector options;
293 options.push_back(kSSLR); 293 options.push_back(kSSLR);
294 QuicConfigPeer::SetReceivedConnectionOptions(&config, options); 294 QuicConfigPeer::SetReceivedConnectionOptions(&config, options);
295 sender_->SetFromConfig(config, Perspective::IS_SERVER); 295 sender_->SetFromConfig(config, Perspective::IS_SERVER);
296 296
297 sender_->SetNumEmulatedConnections(1); 297 sender_->SetNumEmulatedConnections(1);
298 const int kNumberOfAcks = 10; 298 const int kNumberOfAcks = 10;
299 for (int i = 0; i < kNumberOfAcks; ++i) { 299 for (int i = 0; i < kNumberOfAcks; ++i) {
300 // Send our full send window in half sized packets. 300 // Send our full send window in half sized packets.
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 // Resets cwnd and slow start threshold on connection migrations. 757 // Resets cwnd and slow start threshold on connection migrations.
758 sender_->OnConnectionMigration(); 758 sender_->OnConnectionMigration();
759 EXPECT_EQ(kDefaultWindowTCP, sender_->GetCongestionWindow()); 759 EXPECT_EQ(kDefaultWindowTCP, sender_->GetCongestionWindow());
760 EXPECT_EQ(kMaxCongestionWindow * kDefaultTCPMSS, 760 EXPECT_EQ(kMaxCongestionWindow * kDefaultTCPMSS,
761 sender_->GetSlowStartThreshold()); 761 sender_->GetSlowStartThreshold());
762 EXPECT_FALSE(sender_->hybrid_slow_start().started()); 762 EXPECT_FALSE(sender_->hybrid_slow_start().started());
763 } 763 }
764 764
765 } // namespace test 765 } // namespace test
766 } // namespace net 766 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/bidirectional_stream_quic_impl_unittest.cc ('k') | net/quic/congestion_control/tcp_cubic_sender_packets.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698