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

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

Issue 687093002: Move receive_window_ from BbrTcpSender and TcpCubicSender to (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Gathering_ClientConnectionStats_78688302
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_test.cc ('k') | net/quic/quic_protocol.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 "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after
1320 for (int i = 0; i < 1100; ++i) { 1320 for (int i = 0; i < 1100; ++i) {
1321 SendStreamDataToPeer(1, "foo", 3 * i, !kFin, nullptr); 1321 SendStreamDataToPeer(1, "foo", 3 * i, !kFin, nullptr);
1322 } 1322 }
1323 1323
1324 // Ack packet 1, which leaves more than the limit outstanding. 1324 // Ack packet 1, which leaves more than the limit outstanding.
1325 EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _)); 1325 EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _));
1326 if (FLAGS_quic_too_many_outstanding_packets) { 1326 if (FLAGS_quic_too_many_outstanding_packets) {
1327 EXPECT_CALL(visitor_, 1327 EXPECT_CALL(visitor_,
1328 OnConnectionClosed(QUIC_TOO_MANY_OUTSTANDING_SENT_PACKETS, 1328 OnConnectionClosed(QUIC_TOO_MANY_OUTSTANDING_SENT_PACKETS,
1329 false)); 1329 false));
1330 EXPECT_CALL(visitor_, OnCanWrite()).Times(0);
1331 } else {
1332 EXPECT_CALL(visitor_, OnCanWrite()).Times(1);
1333 } 1330 }
1331 // We're receive buffer limited, so the connection won't try to write more.
1332 EXPECT_CALL(visitor_, OnCanWrite()).Times(0);
1333
1334 // Nack every packet except the last one, leaving a huge gap. 1334 // Nack every packet except the last one, leaving a huge gap.
1335 QuicAckFrame frame1 = InitAckFrame(1100); 1335 QuicAckFrame frame1 = InitAckFrame(1100);
1336 for (QuicPacketSequenceNumber i = 1; i < 1100; ++i) { 1336 for (QuicPacketSequenceNumber i = 1; i < 1100; ++i) {
1337 NackPacket(i, &frame1); 1337 NackPacket(i, &frame1);
1338 } 1338 }
1339 ProcessAckPacket(&frame1); 1339 ProcessAckPacket(&frame1);
1340 } 1340 }
1341 1341
1342 TEST_P(QuicConnectionTest, TooManyReceivedPackets) { 1342 TEST_P(QuicConnectionTest, TooManyReceivedPackets) {
1343 EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); 1343 EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
(...skipping 2763 matching lines...) Expand 10 before | Expand all | Expand 10 after
4107 QuicBlockedFrame blocked; 4107 QuicBlockedFrame blocked;
4108 blocked.stream_id = 3; 4108 blocked.stream_id = 3;
4109 EXPECT_CALL(visitor_, OnBlockedFrames(_)); 4109 EXPECT_CALL(visitor_, OnBlockedFrames(_));
4110 ProcessFramePacket(QuicFrame(&blocked)); 4110 ProcessFramePacket(QuicFrame(&blocked));
4111 EXPECT_TRUE(ack_alarm->IsSet()); 4111 EXPECT_TRUE(ack_alarm->IsSet());
4112 } 4112 }
4113 4113
4114 } // namespace 4114 } // namespace
4115 } // namespace test 4115 } // namespace test
4116 } // namespace net 4116 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/tcp_cubic_sender_test.cc ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698