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

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

Issue 2350863002: Deprecate FLAGS_quic_do_not_send_ack_on_emsgsize. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « net/quic/core/quic_connection.cc ('k') | net/quic/core/quic_flags_list.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/core/quic_connection.h" 5 #include "net/quic/core/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 5193 matching lines...) Expand 10 before | Expand all | Expand 10 after
5204 // Verify that the connection does not become app-limited after blocked write 5204 // Verify that the connection does not become app-limited after blocked write
5205 // even if there is outstanding data to send after the write. 5205 // even if there is outstanding data to send after the write.
5206 TEST_P(QuicConnectionTest, NotBecomeApplicationLimitedDueToWriteBlock) { 5206 TEST_P(QuicConnectionTest, NotBecomeApplicationLimitedDueToWriteBlock) {
5207 EXPECT_CALL(*send_algorithm_, OnApplicationLimited(_)).Times(0); 5207 EXPECT_CALL(*send_algorithm_, OnApplicationLimited(_)).Times(0);
5208 EXPECT_CALL(visitor_, WillingAndAbleToWrite()).WillRepeatedly(Return(true)); 5208 EXPECT_CALL(visitor_, WillingAndAbleToWrite()).WillRepeatedly(Return(true));
5209 BlockOnNextWrite(); 5209 BlockOnNextWrite();
5210 5210
5211 connection_.SendStreamData3(); 5211 connection_.SendStreamData3();
5212 } 5212 }
5213 5213
5214 TEST_P(QuicConnectionTest, ForceSendingAckOnPacketTooLarge) { 5214 TEST_P(QuicConnectionTest, DonotForceSendingAckOnPacketTooLarge) {
5215 FLAGS_quic_do_not_send_ack_on_emsgsize = false;
5216 EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); 5215 EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
5217 // Send an ack by simulating delayed ack alarm firing. 5216 // Send an ack by simulating delayed ack alarm firing.
5218 ProcessPacket(kDefaultPathId, 1); 5217 ProcessPacket(kDefaultPathId, 1);
5219 QuicAlarm* ack_alarm = QuicConnectionPeer::GetAckAlarm(&connection_);
5220 EXPECT_TRUE(ack_alarm->IsSet());
5221 connection_.GetAckAlarm()->Fire();
5222 // Simulate data packet causes write error.
5223 EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_PACKET_WRITE_ERROR, _, _));
5224 SimulateNextPacketTooLarge();
5225 connection_.SendStreamDataWithString(3, "foo", 0, !kFin, nullptr);
5226 EXPECT_EQ(3u, writer_->frame_count());
5227 EXPECT_FALSE(writer_->connection_close_frames().empty());
5228 // Ack frame is bundled.
5229 EXPECT_FALSE(writer_->ack_frames().empty());
5230 }
5231
5232 TEST_P(QuicConnectionTest, DonotForceSendingAckOnPacketTooLarge) {
5233 FLAGS_quic_do_not_send_ack_on_emsgsize = true;
5234 EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
5235 // Send an ack by simulating delayed ack alarm firing.
5236 ProcessPacket(kDefaultPathId, 1);
5237 QuicAlarm* ack_alarm = QuicConnectionPeer::GetAckAlarm(&connection_); 5218 QuicAlarm* ack_alarm = QuicConnectionPeer::GetAckAlarm(&connection_);
5238 EXPECT_TRUE(ack_alarm->IsSet()); 5219 EXPECT_TRUE(ack_alarm->IsSet());
5239 connection_.GetAckAlarm()->Fire(); 5220 connection_.GetAckAlarm()->Fire();
5240 // Simulate data packet causes write error. 5221 // Simulate data packet causes write error.
5241 EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_PACKET_WRITE_ERROR, _, _)); 5222 EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_PACKET_WRITE_ERROR, _, _));
5242 SimulateNextPacketTooLarge(); 5223 SimulateNextPacketTooLarge();
5243 connection_.SendStreamDataWithString(3, "foo", 0, !kFin, nullptr); 5224 connection_.SendStreamDataWithString(3, "foo", 0, !kFin, nullptr);
5244 EXPECT_EQ(1u, writer_->frame_count()); 5225 EXPECT_EQ(1u, writer_->frame_count());
5245 EXPECT_FALSE(writer_->connection_close_frames().empty()); 5226 EXPECT_FALSE(writer_->connection_close_frames().empty());
5246 // Ack frame is not bundled in connection close packet. 5227 // Ack frame is not bundled in connection close packet.
5247 EXPECT_TRUE(writer_->ack_frames().empty()); 5228 EXPECT_TRUE(writer_->ack_frames().empty());
5248 } 5229 }
5249 5230
5250 } // namespace 5231 } // namespace
5251 } // namespace test 5232 } // namespace test
5252 } // namespace net 5233 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_connection.cc ('k') | net/quic/core/quic_flags_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698