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

Side by Side Diff: net/quic/quic_connection_test.cc

Issue 2064543002: Add a new rate based sending connection option which uses the pacing rate to keep the bytes_in_flig… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@124273380
Patch Set: Rebase. Created 4 years, 6 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/crypto/crypto_protocol.h ('k') | net/quic/quic_flags.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 (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/quic_connection.h" 5 #include "net/quic/quic_connection.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <memory> 8 #include <memory>
9 #include <ostream> 9 #include <ostream>
10 #include <utility> 10 #include <utility>
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 QuicConfig config; 558 QuicConfig config;
559 QuicTagVector connection_options; 559 QuicTagVector connection_options;
560 connection_options.push_back(kMTUH); 560 connection_options.push_back(kMTUH);
561 config.SetConnectionOptionsToSend(connection_options); 561 config.SetConnectionOptionsToSend(connection_options);
562 EXPECT_CALL(*send_algorithm, SetFromConfig(_, _)); 562 EXPECT_CALL(*send_algorithm, SetFromConfig(_, _));
563 SetFromConfig(config); 563 SetFromConfig(config);
564 564
565 // Normally, the pacing would be disabled in the test, but calling 565 // Normally, the pacing would be disabled in the test, but calling
566 // SetFromConfig enables it. Set nearly-infinite bandwidth to make the 566 // SetFromConfig enables it. Set nearly-infinite bandwidth to make the
567 // pacing algorithm work. 567 // pacing algorithm work.
568 EXPECT_CALL(*send_algorithm, PacingRate()) 568 EXPECT_CALL(*send_algorithm, PacingRate(_))
569 .WillRepeatedly(Return(QuicBandwidth::FromKBytesPerSecond(10000))); 569 .WillRepeatedly(Return(QuicBandwidth::FromKBytesPerSecond(10000)));
570 } 570 }
571 571
572 TestAlarmFactory::TestAlarm* GetAckAlarm() { 572 TestAlarmFactory::TestAlarm* GetAckAlarm() {
573 return reinterpret_cast<TestAlarmFactory::TestAlarm*>( 573 return reinterpret_cast<TestAlarmFactory::TestAlarm*>(
574 QuicConnectionPeer::GetAckAlarm(this)); 574 QuicConnectionPeer::GetAckAlarm(this));
575 } 575 }
576 576
577 TestAlarmFactory::TestAlarm* GetPingAlarm() { 577 TestAlarmFactory::TestAlarm* GetPingAlarm() {
578 return reinterpret_cast<TestAlarmFactory::TestAlarm*>( 578 return reinterpret_cast<TestAlarmFactory::TestAlarm*>(
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 framer_.set_received_entropy_calculator(&entropy_calculator_); 695 framer_.set_received_entropy_calculator(&entropy_calculator_);
696 peer_framer_.set_received_entropy_calculator(&peer_entropy_calculator_); 696 peer_framer_.set_received_entropy_calculator(&peer_entropy_calculator_);
697 EXPECT_CALL(*send_algorithm_, TimeUntilSend(_, _)) 697 EXPECT_CALL(*send_algorithm_, TimeUntilSend(_, _))
698 .WillRepeatedly(Return(QuicTime::Delta::Zero())); 698 .WillRepeatedly(Return(QuicTime::Delta::Zero()));
699 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)) 699 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _))
700 .Times(AnyNumber()); 700 .Times(AnyNumber());
701 EXPECT_CALL(*send_algorithm_, RetransmissionDelay()) 701 EXPECT_CALL(*send_algorithm_, RetransmissionDelay())
702 .WillRepeatedly(Return(QuicTime::Delta::Zero())); 702 .WillRepeatedly(Return(QuicTime::Delta::Zero()));
703 EXPECT_CALL(*send_algorithm_, GetCongestionWindow()) 703 EXPECT_CALL(*send_algorithm_, GetCongestionWindow())
704 .WillRepeatedly(Return(kDefaultTCPMSS)); 704 .WillRepeatedly(Return(kDefaultTCPMSS));
705 EXPECT_CALL(*send_algorithm_, PacingRate()) 705 EXPECT_CALL(*send_algorithm_, PacingRate(_))
706 .WillRepeatedly(Return(QuicBandwidth::Zero())); 706 .WillRepeatedly(Return(QuicBandwidth::Zero()));
707 ON_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)) 707 ON_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _))
708 .WillByDefault(Return(true)); 708 .WillByDefault(Return(true));
709 EXPECT_CALL(*send_algorithm_, HasReliableBandwidthEstimate()) 709 EXPECT_CALL(*send_algorithm_, HasReliableBandwidthEstimate())
710 .Times(AnyNumber()); 710 .Times(AnyNumber());
711 EXPECT_CALL(*send_algorithm_, BandwidthEstimate()) 711 EXPECT_CALL(*send_algorithm_, BandwidthEstimate())
712 .Times(AnyNumber()) 712 .Times(AnyNumber())
713 .WillRepeatedly(Return(QuicBandwidth::Zero())); 713 .WillRepeatedly(Return(QuicBandwidth::Zero()));
714 EXPECT_CALL(*send_algorithm_, InSlowStart()).Times(AnyNumber()); 714 EXPECT_CALL(*send_algorithm_, InSlowStart()).Times(AnyNumber());
715 EXPECT_CALL(*send_algorithm_, InRecovery()).Times(AnyNumber()); 715 EXPECT_CALL(*send_algorithm_, InRecovery()).Times(AnyNumber());
(...skipping 4359 matching lines...) Expand 10 before | Expand all | Expand 10 after
5075 frame1_.data_length = data->length(); 5075 frame1_.data_length = data->length();
5076 5076
5077 EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_MAYBE_CORRUPTED_MEMORY, _, 5077 EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_MAYBE_CORRUPTED_MEMORY, _,
5078 ConnectionCloseSource::FROM_SELF)); 5078 ConnectionCloseSource::FROM_SELF));
5079 ProcessFramePacket(QuicFrame(&frame1_)); 5079 ProcessFramePacket(QuicFrame(&frame1_));
5080 } 5080 }
5081 5081
5082 } // namespace 5082 } // namespace
5083 } // namespace test 5083 } // namespace test
5084 } // namespace net 5084 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/crypto/crypto_protocol.h ('k') | net/quic/quic_flags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698