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

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

Issue 23597045: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged QuicPriority to RequestPriority changes Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "base/logging.h" 5 #include "base/logging.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "net/quic/congestion_control/inter_arrival_sender.h" 8 #include "net/quic/congestion_control/inter_arrival_sender.h"
9 #include "net/quic/test_tools/mock_clock.h" 9 #include "net/quic/test_tools/mock_clock.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 23 matching lines...) Expand all
34 34
35 void SendAvailableCongestionWindow() { 35 void SendAvailableCongestionWindow() {
36 while (sender_.TimeUntilSend(send_clock_.Now(), 36 while (sender_.TimeUntilSend(send_clock_.Now(),
37 NOT_RETRANSMISSION, HAS_RETRANSMITTABLE_DATA, NOT_HANDSHAKE).IsZero()) { 37 NOT_RETRANSMISSION, HAS_RETRANSMITTABLE_DATA, NOT_HANDSHAKE).IsZero()) {
38 QuicByteCount bytes_in_packet = kMaxPacketSize; 38 QuicByteCount bytes_in_packet = kMaxPacketSize;
39 sent_packets_[sequence_number_] = 39 sent_packets_[sequence_number_] =
40 new class SendAlgorithmInterface::SentPacket( 40 new class SendAlgorithmInterface::SentPacket(
41 bytes_in_packet, send_clock_.Now()); 41 bytes_in_packet, send_clock_.Now());
42 42
43 sender_.SentPacket(send_clock_.Now(), sequence_number_, bytes_in_packet, 43 sender_.SentPacket(send_clock_.Now(), sequence_number_, bytes_in_packet,
44 NOT_RETRANSMISSION); 44 NOT_RETRANSMISSION, HAS_RETRANSMITTABLE_DATA);
45 sequence_number_++; 45 sequence_number_++;
46 } 46 }
47 EXPECT_FALSE(sender_.TimeUntilSend(send_clock_.Now(), 47 EXPECT_FALSE(sender_.TimeUntilSend(send_clock_.Now(),
48 NOT_RETRANSMISSION, HAS_RETRANSMITTABLE_DATA, NOT_HANDSHAKE).IsZero()); 48 NOT_RETRANSMISSION, HAS_RETRANSMITTABLE_DATA, NOT_HANDSHAKE).IsZero());
49 } 49 }
50 50
51 void AckNPackets(int n) { 51 void AckNPackets(int n) {
52 for (int i = 0; i < n; ++i) { 52 for (int i = 0; i < n; ++i) {
53 sender_.OnIncomingAck(acked_sequence_number_++, kMaxPacketSize, rtt_); 53 sender_.OnIncomingAck(acked_sequence_number_++, kMaxPacketSize, rtt_);
54 } 54 }
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 acked_sequence_number_ += 2; // Create a loss by not acking both packets. 556 acked_sequence_number_ += 2; // Create a loss by not acking both packets.
557 SendFeedbackMessageNPackets(2, nine_ms_, nine_ms_); 557 SendFeedbackMessageNPackets(2, nine_ms_, nine_ms_);
558 558
559 // Make sure our bitrate is fixed at the expected_min_bitrate. 559 // Make sure our bitrate is fixed at the expected_min_bitrate.
560 EXPECT_EQ(expected_min_bitrate, sender_.BandwidthEstimate()); 560 EXPECT_EQ(expected_min_bitrate, sender_.BandwidthEstimate());
561 } 561 }
562 } 562 }
563 563
564 } // namespace test 564 } // namespace test
565 } // namespace net 565 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/inter_arrival_sender.cc ('k') | net/quic/congestion_control/quic_congestion_control_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698