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

Unified Diff: net/quic/core/quic_connection_test.cc

Issue 2825083003: Landing Recent QUIC changes until Mon Apr 17 2017 (Closed)
Patch Set: Format Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/core/quic_connection.cc ('k') | net/quic/core/quic_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_connection_test.cc
diff --git a/net/quic/core/quic_connection_test.cc b/net/quic/core/quic_connection_test.cc
index 144f6744650cd40528db1d7202c704ff1ae64264..76cf9e46c2ef9496d0b1022e522d85095c927174 100644
--- a/net/quic/core/quic_connection_test.cc
+++ b/net/quic/core/quic_connection_test.cc
@@ -17,10 +17,10 @@
#include "net/quic/core/crypto/null_encrypter.h"
#include "net/quic/core/crypto/quic_decrypter.h"
#include "net/quic/core/crypto/quic_encrypter.h"
-#include "net/quic/core/quic_flags.h"
#include "net/quic/core/quic_packets.h"
#include "net/quic/core/quic_simple_buffer_allocator.h"
#include "net/quic/core/quic_utils.h"
+#include "net/quic/platform/api/quic_flags.h"
#include "net/quic/platform/api/quic_logging.h"
#include "net/quic/platform/api/quic_reference_counted.h"
#include "net/quic/platform/api/quic_str_cat.h"
@@ -59,7 +59,6 @@ namespace {
const char data1[] = "foo";
const char data2[] = "bar";
-const bool kFin = true;
const bool kHasStopWaiting = true;
const int kDefaultRetransmissionTimeMs = 500;
@@ -390,6 +389,10 @@ class TestPacketWriter : public QuicPacketWriter {
return framer_.ping_frames();
}
+ const std::vector<QuicPaddingFrame>& padding_frames() const {
+ return framer_.padding_frames();
+ }
+
size_t last_packet_size() { return last_packet_size_; }
const QuicVersionNegotiationPacket* version_negotiation_packet() {
@@ -511,24 +514,24 @@ class TestConnection : public QuicConnection {
QuicStreamId id,
QuicStringPiece data,
QuicStreamOffset offset,
- bool fin,
+ StreamSendingState state,
QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener) {
if (id != kCryptoStreamId && this->encryption_level() == ENCRYPTION_NONE) {
this->SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
}
struct iovec iov;
QuicIOVector data_iov(MakeIOVector(data, &iov));
- return QuicConnection::SendStreamData(id, data_iov, offset, fin,
+ return QuicConnection::SendStreamData(id, data_iov, offset, state,
std::move(ack_listener));
}
QuicConsumedData SendStreamData3() {
- return SendStreamDataWithString(kClientDataStreamId1, "food", 0, !kFin,
+ return SendStreamDataWithString(kClientDataStreamId1, "food", 0, NO_FIN,
nullptr);
}
QuicConsumedData SendStreamData5() {
- return SendStreamDataWithString(kClientDataStreamId2, "food2", 0, !kFin,
+ return SendStreamDataWithString(kClientDataStreamId2, "food2", 0, NO_FIN,
nullptr);
}
@@ -544,7 +547,8 @@ class TestConnection : public QuicConnection {
// split needlessly across packet boundaries). As a result, we have separate
// tests for some cases for this stream.
QuicConsumedData SendCryptoStreamData() {
- return SendStreamDataWithString(kCryptoStreamId, "chlo", 0, !kFin, nullptr);
+ return SendStreamDataWithString(kCryptoStreamId, "chlo", 0, NO_FIN,
+ nullptr);
}
void set_version(QuicVersion version) {
@@ -885,12 +889,12 @@ class QuicConnectionTest : public ::testing::TestWithParam<TestParams> {
QuicByteCount SendStreamDataToPeer(QuicStreamId id,
QuicStringPiece data,
QuicStreamOffset offset,
- bool fin,
+ StreamSendingState state,
QuicPacketNumber* last_packet) {
QuicByteCount packet_size;
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _))
.WillOnce(DoAll(SaveArg<3>(&packet_size), Return(true)));
- connection_.SendStreamDataWithString(id, data, offset, fin, nullptr);
+ connection_.SendStreamDataWithString(id, data, offset, state, nullptr);
if (last_packet != nullptr) {
*last_packet = creator_->packet_number();
}
@@ -1418,8 +1422,8 @@ TEST_P(QuicConnectionTest, OutOfOrderReceiptCausesAckSend) {
TEST_P(QuicConnectionTest, OutOfOrderAckReceiptCausesNoAck) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
- SendStreamDataToPeer(1, "foo", 0, !kFin, nullptr);
- SendStreamDataToPeer(1, "bar", 3, !kFin, nullptr);
+ SendStreamDataToPeer(1, "foo", 0, NO_FIN, nullptr);
+ SendStreamDataToPeer(1, "bar", 3, NO_FIN, nullptr);
EXPECT_EQ(2u, writer_->packets_write_attempts());
QuicAckFrame ack1 = InitAckFrame(1);
@@ -1441,7 +1445,7 @@ TEST_P(QuicConnectionTest, AckReceiptCausesAckSend) {
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _))
.WillOnce(
DoAll(SaveArg<2>(&original), SaveArg<3>(&packet_size), Return(true)));
- connection_.SendStreamDataWithString(3, "foo", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(3, "foo", 0, NO_FIN, nullptr);
QuicAckFrame frame = InitAckFrame(original);
NackPacket(original, &frame);
// First nack triggers early retransmit.
@@ -1468,7 +1472,7 @@ TEST_P(QuicConnectionTest, AckReceiptCausesAckSend) {
// indicate the high water mark needs to be raised.
EXPECT_CALL(*send_algorithm_,
OnPacketSent(_, _, _, _, HAS_RETRANSMITTABLE_DATA));
- connection_.SendStreamDataWithString(3, "foo", 3, !kFin, nullptr);
+ connection_.SendStreamDataWithString(3, "foo", 3, NO_FIN, nullptr);
// No ack sent.
EXPECT_EQ(1u, writer_->frame_count());
EXPECT_EQ(1u, writer_->stream_frames().size());
@@ -1478,7 +1482,7 @@ TEST_P(QuicConnectionTest, AckReceiptCausesAckSend) {
ProcessAckPacket(&frame2);
EXPECT_CALL(*send_algorithm_,
OnPacketSent(_, _, _, _, HAS_RETRANSMITTABLE_DATA));
- connection_.SendStreamDataWithString(3, "foo", 3, !kFin, nullptr);
+ connection_.SendStreamDataWithString(3, "foo", 3, NO_FIN, nullptr);
// Ack bundled.
if (GetParam().no_stop_waiting) {
EXPECT_EQ(2u, writer_->frame_count());
@@ -1497,7 +1501,7 @@ TEST_P(QuicConnectionTest, AckReceiptCausesAckSend) {
TEST_P(QuicConnectionTest, 20AcksCausesAckSend) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
- SendStreamDataToPeer(1, "foo", 0, !kFin, nullptr);
+ SendStreamDataToPeer(1, "foo", 0, NO_FIN, nullptr);
QuicAlarm* ack_alarm = QuicConnectionPeer::GetAckAlarm(&connection_);
// But an ack with no missing packets will not send an ack.
@@ -1516,9 +1520,9 @@ TEST_P(QuicConnectionTest, 20AcksCausesAckSend) {
TEST_P(QuicConnectionTest, LeastUnackedLower) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
- SendStreamDataToPeer(1, "foo", 0, !kFin, nullptr);
- SendStreamDataToPeer(1, "bar", 3, !kFin, nullptr);
- SendStreamDataToPeer(1, "eep", 6, !kFin, nullptr);
+ SendStreamDataToPeer(1, "foo", 0, NO_FIN, nullptr);
+ SendStreamDataToPeer(1, "bar", 3, NO_FIN, nullptr);
+ SendStreamDataToPeer(1, "eep", 6, NO_FIN, nullptr);
// Start out saying the least unacked is 2.
QuicPacketCreatorPeer::SetPacketNumber(&peer_creator_, 5);
@@ -1553,7 +1557,7 @@ TEST_P(QuicConnectionTest, TooManySentPackets) {
const int num_packets = kMaxTrackedPackets + 100;
for (int i = 0; i < num_packets; ++i) {
- SendStreamDataToPeer(1, "foo", 3 * i, !kFin, nullptr);
+ SendStreamDataToPeer(1, "foo", 3 * i, NO_FIN, nullptr);
}
// Ack packet 1, which leaves more than the limit outstanding.
@@ -1579,9 +1583,9 @@ TEST_P(QuicConnectionTest, TooManyReceivedPackets) {
TEST_P(QuicConnectionTest, LargestObservedLower) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
- SendStreamDataToPeer(1, "foo", 0, !kFin, nullptr);
- SendStreamDataToPeer(1, "bar", 3, !kFin, nullptr);
- SendStreamDataToPeer(1, "eep", 6, !kFin, nullptr);
+ SendStreamDataToPeer(1, "foo", 0, NO_FIN, nullptr);
+ SendStreamDataToPeer(1, "bar", 3, NO_FIN, nullptr);
+ SendStreamDataToPeer(1, "eep", 6, NO_FIN, nullptr);
EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _));
// Start out saying the largest observed is 2.
@@ -1619,7 +1623,7 @@ TEST_P(QuicConnectionTest, AckAll) {
TEST_P(QuicConnectionTest, BasicSending) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
QuicPacketNumber last_packet;
- SendStreamDataToPeer(1, "foo", 0, !kFin, &last_packet); // Packet 1
+ SendStreamDataToPeer(1, "foo", 0, NO_FIN, &last_packet); // Packet 1
EXPECT_EQ(1u, last_packet);
SendAckPacketToPeer(); // Packet 2
@@ -1638,7 +1642,7 @@ TEST_P(QuicConnectionTest, BasicSending) {
EXPECT_EQ(1u, least_unacked());
}
- SendStreamDataToPeer(1, "bar", 3, !kFin, &last_packet); // Packet 4
+ SendStreamDataToPeer(1, "bar", 3, NO_FIN, &last_packet); // Packet 4
EXPECT_EQ(4u, last_packet);
SendAckPacketToPeer(); // Packet 5
if (GetParam().no_stop_waiting) {
@@ -1691,7 +1695,7 @@ TEST_P(QuicConnectionTest, BasicSending) {
}
// But if we send more data it should.
- SendStreamDataToPeer(1, "eep", 6, !kFin, &last_packet); // Packet 8
+ SendStreamDataToPeer(1, "eep", 6, NO_FIN, &last_packet); // Packet 8
EXPECT_EQ(8u, last_packet);
SendAckPacketToPeer(); // Packet 9
if (GetParam().no_stop_waiting) {
@@ -1715,7 +1719,7 @@ TEST_P(QuicConnectionTest, RecordSentTimeBeforePacketSent) {
// First send without any pause and check the result.
QuicTime expected_recorded_send_time = clock_.Now();
- connection_.SendStreamDataWithString(1, "foo", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(1, "foo", 0, NO_FIN, nullptr);
EXPECT_EQ(expected_recorded_send_time, actual_recorded_send_time)
<< "Expected time = " << expected_recorded_send_time.ToDebuggingValue()
<< ". Actual time = " << actual_recorded_send_time.ToDebuggingValue();
@@ -1729,7 +1733,7 @@ TEST_P(QuicConnectionTest, RecordSentTimeBeforePacketSent) {
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _))
.WillOnce(DoAll(SaveArg<0>(&actual_recorded_send_time), Return(true)));
- connection_.SendStreamDataWithString(2, "baz", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(2, "baz", 0, NO_FIN, nullptr);
EXPECT_EQ(expected_recorded_send_time, actual_recorded_send_time)
<< "Expected time = " << expected_recorded_send_time.ToDebuggingValue()
<< ". Actual time = " << actual_recorded_send_time.ToDebuggingValue();
@@ -1776,8 +1780,9 @@ TEST_P(QuicConnectionTest, FramePackingNonCryptoThenCrypto) {
EXPECT_FALSE(connection_.HasQueuedData());
// Parse the last packet and ensure it's the crypto stream frame.
- EXPECT_EQ(1u, writer_->frame_count());
+ EXPECT_EQ(2u, writer_->frame_count());
ASSERT_EQ(1u, writer_->stream_frames().size());
+ ASSERT_EQ(1u, writer_->padding_frames().size());
EXPECT_EQ(kCryptoStreamId, writer_->stream_frames()[0]->stream_id);
}
@@ -1847,15 +1852,16 @@ TEST_P(QuicConnectionTest, FramePackingSendv) {
iov[0].iov_len = 2;
iov[1].iov_base = data + 2;
iov[1].iov_len = 2;
- connection_.SendStreamData(1, QuicIOVector(iov, 2, 4), 0, !kFin, nullptr);
+ connection_.SendStreamData(1, QuicIOVector(iov, 2, 4), 0, NO_FIN, nullptr);
EXPECT_EQ(0u, connection_.NumQueuedPackets());
EXPECT_FALSE(connection_.HasQueuedData());
// Parse the last packet and ensure multiple iovector blocks have
// been packed into a single stream frame from one stream.
- EXPECT_EQ(1u, writer_->frame_count());
+ EXPECT_EQ(2u, writer_->frame_count());
EXPECT_EQ(1u, writer_->stream_frames().size());
+ EXPECT_EQ(1u, writer_->padding_frames().size());
QuicStreamFrame* frame = writer_->stream_frames()[0].get();
EXPECT_EQ(1u, frame->stream_id);
EXPECT_EQ("ABCD", QuicStringPiece(frame->data_buffer, frame->data_length));
@@ -1872,7 +1878,7 @@ TEST_P(QuicConnectionTest, FramePackingSendvQueued) {
iov[0].iov_len = 2;
iov[1].iov_base = data + 2;
iov[1].iov_len = 2;
- connection_.SendStreamData(1, QuicIOVector(iov, 2, 4), 0, !kFin, nullptr);
+ connection_.SendStreamData(1, QuicIOVector(iov, 2, 4), 0, NO_FIN, nullptr);
EXPECT_EQ(1u, connection_.NumQueuedPackets());
EXPECT_TRUE(connection_.HasQueuedData());
@@ -1883,8 +1889,9 @@ TEST_P(QuicConnectionTest, FramePackingSendvQueued) {
EXPECT_EQ(0u, connection_.NumQueuedPackets());
// Parse the last packet and ensure it's one stream frame from one stream.
- EXPECT_EQ(1u, writer_->frame_count());
+ EXPECT_EQ(2u, writer_->frame_count());
EXPECT_EQ(1u, writer_->stream_frames().size());
+ EXPECT_EQ(1u, writer_->padding_frames().size());
EXPECT_EQ(1u, writer_->stream_frames()[0]->stream_id);
}
@@ -1893,7 +1900,7 @@ TEST_P(QuicConnectionTest, SendingZeroBytes) {
// Send a zero byte write with a fin using writev.
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _));
QuicIOVector empty_iov(nullptr, 0, 0);
- connection_.SendStreamData(kHeadersStreamId, empty_iov, 0, kFin, nullptr);
+ connection_.SendStreamData(kHeadersStreamId, empty_iov, 0, FIN, nullptr);
EXPECT_EQ(0u, connection_.NumQueuedPackets());
EXPECT_FALSE(connection_.HasQueuedData());
@@ -1926,7 +1933,7 @@ TEST_P(QuicConnectionTest, LargeSendWithPendingAck) {
iov.iov_len = len;
QuicIOVector iovector(&iov, 1, len);
QuicConsumedData consumed =
- connection_.SendStreamData(kHeadersStreamId, iovector, 0, true, nullptr);
+ connection_.SendStreamData(kHeadersStreamId, iovector, 0, FIN, nullptr);
EXPECT_EQ(len, consumed.bytes_consumed);
EXPECT_TRUE(consumed.fin_consumed);
EXPECT_EQ(0u, connection_.NumQueuedPackets());
@@ -1971,10 +1978,10 @@ TEST_P(QuicConnectionTest, OnCanWrite) {
TEST_P(QuicConnectionTest, RetransmitOnNack) {
QuicPacketNumber last_packet;
QuicByteCount second_packet_size;
- SendStreamDataToPeer(3, "foo", 0, !kFin, &last_packet); // Packet 1
+ SendStreamDataToPeer(3, "foo", 0, NO_FIN, &last_packet); // Packet 1
second_packet_size =
- SendStreamDataToPeer(3, "foos", 3, !kFin, &last_packet); // Packet 2
- SendStreamDataToPeer(3, "fooos", 7, !kFin, &last_packet); // Packet 3
+ SendStreamDataToPeer(3, "foos", 3, NO_FIN, &last_packet); // Packet 2
+ SendStreamDataToPeer(3, "fooos", 7, NO_FIN, &last_packet); // Packet 3
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
@@ -2002,7 +2009,7 @@ TEST_P(QuicConnectionTest, DoNotSendQueuedPacketForResetStream) {
BlockOnNextWrite();
QuicStreamId stream_id = 2;
- connection_.SendStreamDataWithString(stream_id, "foo", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(stream_id, "foo", 0, NO_FIN, nullptr);
// Now that there is a queued packet, reset the stream.
connection_.SendRstStream(stream_id, QUIC_ERROR_PROCESSING_STREAM, 14);
@@ -2020,7 +2027,7 @@ TEST_P(QuicConnectionTest, SendQueuedPacketForQuicRstStreamNoError) {
BlockOnNextWrite();
QuicStreamId stream_id = 2;
- connection_.SendStreamDataWithString(stream_id, "foo", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(stream_id, "foo", 0, NO_FIN, nullptr);
// Now that there is a queued packet, reset the stream.
connection_.SendRstStream(stream_id, QUIC_STREAM_NO_ERROR, 14);
@@ -2037,9 +2044,9 @@ TEST_P(QuicConnectionTest, SendQueuedPacketForQuicRstStreamNoError) {
TEST_P(QuicConnectionTest, DoNotRetransmitForResetStreamOnNack) {
QuicStreamId stream_id = 2;
QuicPacketNumber last_packet;
- SendStreamDataToPeer(stream_id, "foo", 0, !kFin, &last_packet);
- SendStreamDataToPeer(stream_id, "foos", 3, !kFin, &last_packet);
- SendStreamDataToPeer(stream_id, "fooos", 7, !kFin, &last_packet);
+ SendStreamDataToPeer(stream_id, "foo", 0, NO_FIN, &last_packet);
+ SendStreamDataToPeer(stream_id, "foos", 3, NO_FIN, &last_packet);
+ SendStreamDataToPeer(stream_id, "fooos", 7, NO_FIN, &last_packet);
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(1);
connection_.SendRstStream(stream_id, QUIC_ERROR_PROCESSING_STREAM, 14);
@@ -2057,9 +2064,9 @@ TEST_P(QuicConnectionTest, DoNotRetransmitForResetStreamOnNack) {
TEST_P(QuicConnectionTest, RetransmitForQuicRstStreamNoErrorOnNack) {
QuicStreamId stream_id = 2;
QuicPacketNumber last_packet;
- SendStreamDataToPeer(stream_id, "foo", 0, !kFin, &last_packet);
- SendStreamDataToPeer(stream_id, "foos", 3, !kFin, &last_packet);
- SendStreamDataToPeer(stream_id, "fooos", 7, !kFin, &last_packet);
+ SendStreamDataToPeer(stream_id, "foo", 0, NO_FIN, &last_packet);
+ SendStreamDataToPeer(stream_id, "foos", 3, NO_FIN, &last_packet);
+ SendStreamDataToPeer(stream_id, "fooos", 7, NO_FIN, &last_packet);
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(1);
connection_.SendRstStream(stream_id, QUIC_STREAM_NO_ERROR, 14);
@@ -2080,7 +2087,7 @@ TEST_P(QuicConnectionTest, RetransmitForQuicRstStreamNoErrorOnNack) {
TEST_P(QuicConnectionTest, DoNotRetransmitForResetStreamOnRTO) {
QuicStreamId stream_id = 2;
QuicPacketNumber last_packet;
- SendStreamDataToPeer(stream_id, "foo", 0, !kFin, &last_packet);
+ SendStreamDataToPeer(stream_id, "foo", 0, NO_FIN, &last_packet);
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(1);
connection_.SendRstStream(stream_id, QUIC_ERROR_PROCESSING_STREAM, 14);
@@ -2099,7 +2106,7 @@ TEST_P(QuicConnectionTest, DoNotRetransmitForResetStreamOnRTO) {
TEST_P(QuicConnectionTest, CancelRetransmissionAlarmAfterResetStream) {
QuicStreamId stream_id = 2;
QuicPacketNumber last_data_packet;
- SendStreamDataToPeer(stream_id, "foo", 0, !kFin, &last_data_packet);
+ SendStreamDataToPeer(stream_id, "foo", 0, NO_FIN, &last_data_packet);
// Cancel the stream.
const QuicPacketNumber rst_packet = last_data_packet + 1;
@@ -2126,7 +2133,7 @@ TEST_P(QuicConnectionTest, RetransmitForQuicRstStreamNoErrorOnRTO) {
QuicStreamId stream_id = 2;
QuicPacketNumber last_packet;
- SendStreamDataToPeer(stream_id, "foo", 0, !kFin, &last_packet);
+ SendStreamDataToPeer(stream_id, "foo", 0, NO_FIN, &last_packet);
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(1);
connection_.SendRstStream(stream_id, QUIC_STREAM_NO_ERROR, 14);
@@ -2144,10 +2151,10 @@ TEST_P(QuicConnectionTest, RetransmitForQuicRstStreamNoErrorOnRTO) {
TEST_P(QuicConnectionTest, DoNotSendPendingRetransmissionForResetStream) {
QuicStreamId stream_id = 2;
QuicPacketNumber last_packet;
- SendStreamDataToPeer(stream_id, "foo", 0, !kFin, &last_packet);
- SendStreamDataToPeer(stream_id, "foos", 3, !kFin, &last_packet);
+ SendStreamDataToPeer(stream_id, "foo", 0, NO_FIN, &last_packet);
+ SendStreamDataToPeer(stream_id, "foos", 3, NO_FIN, &last_packet);
BlockOnNextWrite();
- connection_.SendStreamDataWithString(stream_id, "fooos", 7, !kFin, nullptr);
+ connection_.SendStreamDataWithString(stream_id, "fooos", 7, NO_FIN, nullptr);
// Lose a packet which will trigger a pending retransmission.
QuicAckFrame ack = InitAckFrame(last_packet);
@@ -2173,10 +2180,10 @@ TEST_P(QuicConnectionTest, DoNotSendPendingRetransmissionForResetStream) {
TEST_P(QuicConnectionTest, SendPendingRetransmissionForQuicRstStreamNoError) {
QuicStreamId stream_id = 2;
QuicPacketNumber last_packet;
- SendStreamDataToPeer(stream_id, "foo", 0, !kFin, &last_packet);
- SendStreamDataToPeer(stream_id, "foos", 3, !kFin, &last_packet);
+ SendStreamDataToPeer(stream_id, "foo", 0, NO_FIN, &last_packet);
+ SendStreamDataToPeer(stream_id, "foos", 3, NO_FIN, &last_packet);
BlockOnNextWrite();
- connection_.SendStreamDataWithString(stream_id, "fooos", 7, !kFin, nullptr);
+ connection_.SendStreamDataWithString(stream_id, "fooos", 7, NO_FIN, nullptr);
// Lose a packet which will trigger a pending retransmission.
QuicAckFrame ack = InitAckFrame(last_packet);
@@ -2203,9 +2210,9 @@ TEST_P(QuicConnectionTest, SendPendingRetransmissionForQuicRstStreamNoError) {
TEST_P(QuicConnectionTest, RetransmitAckedPacket) {
QuicPacketNumber last_packet;
- SendStreamDataToPeer(1, "foo", 0, !kFin, &last_packet); // Packet 1
- SendStreamDataToPeer(1, "foos", 3, !kFin, &last_packet); // Packet 2
- SendStreamDataToPeer(1, "fooos", 7, !kFin, &last_packet); // Packet 3
+ SendStreamDataToPeer(1, "foo", 0, NO_FIN, &last_packet); // Packet 1
+ SendStreamDataToPeer(1, "foos", 3, NO_FIN, &last_packet); // Packet 2
+ SendStreamDataToPeer(1, "fooos", 7, NO_FIN, &last_packet); // Packet 3
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
@@ -2248,7 +2255,7 @@ TEST_P(QuicConnectionTest, RetransmitNackedLargestObserved) {
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _))
.WillOnce(DoAll(SaveArg<2>(&largest_observed), SaveArg<3>(&packet_size),
Return(true)));
- connection_.SendStreamDataWithString(3, "foo", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(3, "foo", 0, NO_FIN, nullptr);
QuicAckFrame frame = InitAckFrame(1);
NackPacket(largest_observed, &frame);
@@ -2268,7 +2275,7 @@ TEST_P(QuicConnectionTest, QueueAfterTwoRTOs) {
for (int i = 0; i < 10; ++i) {
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(1);
- connection_.SendStreamDataWithString(3, "foo", i * 3, !kFin, nullptr);
+ connection_.SendStreamDataWithString(3, "foo", i * 3, NO_FIN, nullptr);
}
// Block the writer and ensure they're queued.
@@ -2293,7 +2300,7 @@ TEST_P(QuicConnectionTest, WriteBlockedBufferedThenSent) {
BlockOnNextWrite();
writer_->set_is_write_blocked_data_buffered(true);
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(1);
- connection_.SendStreamDataWithString(1, "foo", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(1, "foo", 0, NO_FIN, nullptr);
EXPECT_TRUE(connection_.GetRetransmissionAlarm()->IsSet());
writer_->SetWritable();
@@ -2304,14 +2311,14 @@ TEST_P(QuicConnectionTest, WriteBlockedBufferedThenSent) {
TEST_P(QuicConnectionTest, WriteBlockedThenSent) {
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(0);
BlockOnNextWrite();
- connection_.SendStreamDataWithString(1, "foo", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(1, "foo", 0, NO_FIN, nullptr);
EXPECT_FALSE(connection_.GetRetransmissionAlarm()->IsSet());
EXPECT_EQ(1u, connection_.NumQueuedPackets());
// The second packet should also be queued, in order to ensure packets are
// never sent out of order.
writer_->SetWritable();
- connection_.SendStreamDataWithString(1, "foo", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(1, "foo", 0, NO_FIN, nullptr);
EXPECT_EQ(2u, connection_.NumQueuedPackets());
// Now both are sent in order when we unblock.
@@ -2322,7 +2329,7 @@ TEST_P(QuicConnectionTest, WriteBlockedThenSent) {
TEST_P(QuicConnectionTest, RetransmitWriteBlockedAckedOriginalThenSent) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
- connection_.SendStreamDataWithString(3, "foo", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(3, "foo", 0, NO_FIN, nullptr);
EXPECT_TRUE(connection_.GetRetransmissionAlarm()->IsSet());
BlockOnNextWrite();
@@ -2347,7 +2354,7 @@ TEST_P(QuicConnectionTest, RetransmitWriteBlockedAckedOriginalThenSent) {
TEST_P(QuicConnectionTest, AlarmsWhenWriteBlocked) {
// Block the connection.
BlockOnNextWrite();
- connection_.SendStreamDataWithString(3, "foo", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(3, "foo", 0, NO_FIN, nullptr);
EXPECT_EQ(1u, writer_->packets_write_attempts());
EXPECT_TRUE(writer_->IsWriteBlocked());
@@ -2366,7 +2373,7 @@ TEST_P(QuicConnectionTest, NoLimitPacketsPerNack) {
int offset = 0;
// Send packets 1 to 15.
for (int i = 0; i < 15; ++i) {
- SendStreamDataToPeer(1, "foo", offset, !kFin, nullptr);
+ SendStreamDataToPeer(1, "foo", offset, NO_FIN, nullptr);
offset += 3;
}
@@ -2392,16 +2399,16 @@ TEST_P(QuicConnectionTest, NoLimitPacketsPerNack) {
// Test sending multiple acks from the connection to the session.
TEST_P(QuicConnectionTest, MultipleAcks) {
QuicPacketNumber last_packet;
- SendStreamDataToPeer(1, "foo", 0, !kFin, &last_packet); // Packet 1
+ SendStreamDataToPeer(1, "foo", 0, NO_FIN, &last_packet); // Packet 1
EXPECT_EQ(1u, last_packet);
- SendStreamDataToPeer(3, "foo", 0, !kFin, &last_packet); // Packet 2
+ SendStreamDataToPeer(3, "foo", 0, NO_FIN, &last_packet); // Packet 2
EXPECT_EQ(2u, last_packet);
SendAckPacketToPeer(); // Packet 3
- SendStreamDataToPeer(5, "foo", 0, !kFin, &last_packet); // Packet 4
+ SendStreamDataToPeer(5, "foo", 0, NO_FIN, &last_packet); // Packet 4
EXPECT_EQ(4u, last_packet);
- SendStreamDataToPeer(1, "foo", 3, !kFin, &last_packet); // Packet 5
+ SendStreamDataToPeer(1, "foo", 3, NO_FIN, &last_packet); // Packet 5
EXPECT_EQ(5u, last_packet);
- SendStreamDataToPeer(3, "foo", 3, !kFin, &last_packet); // Packet 6
+ SendStreamDataToPeer(3, "foo", 3, NO_FIN, &last_packet); // Packet 6
EXPECT_EQ(6u, last_packet);
// Client will ack packets 1, 2, [!3], 4, 5.
@@ -2418,7 +2425,7 @@ TEST_P(QuicConnectionTest, MultipleAcks) {
}
TEST_P(QuicConnectionTest, DontLatchUnackedPacket) {
- SendStreamDataToPeer(1, "foo", 0, !kFin, nullptr); // Packet 1;
+ SendStreamDataToPeer(1, "foo", 0, NO_FIN, nullptr); // Packet 1;
// From now on, we send acks, so the send algorithm won't mark them pending.
ON_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _))
.WillByDefault(Return(false));
@@ -2460,7 +2467,7 @@ TEST_P(QuicConnectionTest, DontLatchUnackedPacket) {
ON_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _))
.WillByDefault(Return(true));
- SendStreamDataToPeer(1, "bar", 3, false, nullptr); // Packet 4
+ SendStreamDataToPeer(1, "bar", 3, NO_FIN, nullptr); // Packet 4
EXPECT_EQ(4u, stop_waiting()->least_unacked);
ON_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _))
.WillByDefault(Return(false));
@@ -2476,8 +2483,8 @@ TEST_P(QuicConnectionTest, DontLatchUnackedPacket) {
// the least unacked is raised above the ack packets.
ON_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _))
.WillByDefault(Return(true));
- SendStreamDataToPeer(1, "bar", 6, false, nullptr); // Packet 6
- SendStreamDataToPeer(1, "bar", 9, false, nullptr); // Packet 7
+ SendStreamDataToPeer(1, "bar", 6, NO_FIN, nullptr); // Packet 6
+ SendStreamDataToPeer(1, "bar", 9, NO_FIN, nullptr); // Packet 7
EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _));
frame = InitAckFrame(7);
@@ -2491,7 +2498,7 @@ TEST_P(QuicConnectionTest, DontLatchUnackedPacket) {
TEST_P(QuicConnectionTest, TLP) {
connection_.SetMaxTailLossProbes(1);
- SendStreamDataToPeer(3, "foo", 0, !kFin, nullptr);
+ SendStreamDataToPeer(3, "foo", 0, NO_FIN, nullptr);
EXPECT_EQ(1u, stop_waiting()->least_unacked);
QuicTime retransmission_time =
connection_.GetRetransmissionAlarm()->deadline();
@@ -2513,7 +2520,7 @@ TEST_P(QuicConnectionTest, RTO) {
QuicTime default_retransmission_time =
clock_.ApproximateNow() + DefaultRetransmissionTime();
- SendStreamDataToPeer(3, "foo", 0, !kFin, nullptr);
+ SendStreamDataToPeer(3, "foo", 0, NO_FIN, nullptr);
EXPECT_EQ(1u, stop_waiting()->least_unacked);
EXPECT_EQ(1u, writer_->header().packet_number);
@@ -2534,12 +2541,12 @@ TEST_P(QuicConnectionTest, RetransmitWithSameEncryptionLevel) {
// A TaggingEncrypter puts kTagSize copies of the given byte (0x01 here) at
// the end of the packet. We can test this to check which encrypter was used.
connection_.SetEncrypter(ENCRYPTION_NONE, new TaggingEncrypter(0x01));
- SendStreamDataToPeer(kCryptoStreamId, "foo", 0, !kFin, nullptr);
+ SendStreamDataToPeer(kCryptoStreamId, "foo", 0, NO_FIN, nullptr);
EXPECT_EQ(0x01010101u, writer_->final_bytes_of_last_packet());
connection_.SetEncrypter(ENCRYPTION_INITIAL, new TaggingEncrypter(0x02));
connection_.SetDefaultEncryptionLevel(ENCRYPTION_INITIAL);
- SendStreamDataToPeer(3, "foo", 0, !kFin, nullptr);
+ SendStreamDataToPeer(3, "foo", 0, NO_FIN, nullptr);
EXPECT_EQ(0x02020202u, writer_->final_bytes_of_last_packet());
{
@@ -2568,7 +2575,7 @@ TEST_P(QuicConnectionTest, SendHandshakeMessages) {
EXPECT_CALL(*send_algorithm_, TimeUntilSend(_, _))
.WillRepeatedly(testing::Return(QuicTime::Delta::Zero()));
BlockOnNextWrite();
- connection_.SendStreamDataWithString(1, "foo", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(1, "foo", 0, NO_FIN, nullptr);
// The packet should be serialized, but not queued.
EXPECT_EQ(1u, connection_.NumQueuedPackets());
@@ -2591,7 +2598,7 @@ TEST_P(QuicConnectionTest,
use_tagging_decrypter();
connection_.SetEncrypter(ENCRYPTION_NONE, new TaggingEncrypter(0x01));
QuicPacketNumber packet_number;
- SendStreamDataToPeer(kCryptoStreamId, "foo", 0, !kFin, &packet_number);
+ SendStreamDataToPeer(kCryptoStreamId, "foo", 0, NO_FIN, &packet_number);
// Simulate the retransmission alarm firing and the socket blocking.
BlockOnNextWrite();
@@ -2616,12 +2623,12 @@ TEST_P(QuicConnectionTest, RetransmitPacketsWithInitialEncryption) {
connection_.SetEncrypter(ENCRYPTION_NONE, new TaggingEncrypter(0x01));
connection_.SetDefaultEncryptionLevel(ENCRYPTION_NONE);
- SendStreamDataToPeer(1, "foo", 0, !kFin, nullptr);
+ SendStreamDataToPeer(1, "foo", 0, NO_FIN, nullptr);
connection_.SetEncrypter(ENCRYPTION_INITIAL, new TaggingEncrypter(0x02));
connection_.SetDefaultEncryptionLevel(ENCRYPTION_INITIAL);
- SendStreamDataToPeer(2, "bar", 0, !kFin, nullptr);
+ SendStreamDataToPeer(2, "bar", 0, NO_FIN, nullptr);
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(1);
connection_.RetransmitUnackedPackets(ALL_INITIAL_RETRANSMISSION);
@@ -2695,11 +2702,11 @@ TEST_P(QuicConnectionTest, TestRetransmitOrder) {
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _))
.WillOnce(DoAll(SaveArg<3>(&first_packet_size), Return(true)));
- connection_.SendStreamDataWithString(3, "first_packet", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(3, "first_packet", 0, NO_FIN, nullptr);
QuicByteCount second_packet_size;
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _))
.WillOnce(DoAll(SaveArg<3>(&second_packet_size), Return(true)));
- connection_.SendStreamDataWithString(3, "second_packet", 12, !kFin, nullptr);
+ connection_.SendStreamDataWithString(3, "second_packet", 12, NO_FIN, nullptr);
EXPECT_NE(first_packet_size, second_packet_size);
// Advance the clock by huge time to make sure packets will be retransmitted.
clock_.AdvanceTime(QuicTime::Delta::FromSeconds(10));
@@ -2723,7 +2730,7 @@ TEST_P(QuicConnectionTest, TestRetransmitOrder) {
TEST_P(QuicConnectionTest, SetRTOAfterWritingToSocket) {
BlockOnNextWrite();
- connection_.SendStreamDataWithString(1, "foo", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(1, "foo", 0, NO_FIN, nullptr);
// Make sure that RTO is not started when the packet is queued.
EXPECT_FALSE(connection_.GetRetransmissionAlarm()->IsSet());
@@ -2738,8 +2745,8 @@ TEST_P(QuicConnectionTest, DelayRTOWithAckReceipt) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(2);
- connection_.SendStreamDataWithString(2, "foo", 0, !kFin, nullptr);
- connection_.SendStreamDataWithString(3, "bar", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(2, "foo", 0, NO_FIN, nullptr);
+ connection_.SendStreamDataWithString(3, "bar", 0, NO_FIN, nullptr);
QuicAlarm* retransmission_alarm = connection_.GetRetransmissionAlarm();
EXPECT_TRUE(retransmission_alarm->IsSet());
EXPECT_EQ(clock_.Now() + DefaultRetransmissionTime(),
@@ -2781,7 +2788,7 @@ TEST_P(QuicConnectionTest, TestQueued) {
EXPECT_EQ(0u, connection_.NumQueuedPackets());
BlockOnNextWrite();
- connection_.SendStreamDataWithString(1, "foo", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(1, "foo", 0, NO_FIN, nullptr);
EXPECT_EQ(1u, connection_.NumQueuedPackets());
// Unblock the writes and actually send.
@@ -2835,7 +2842,7 @@ TEST_P(QuicConnectionTest, HandshakeTimeout) {
EXPECT_TRUE(connection_.connected());
// Send and ack new data 3 seconds later to lengthen the idle timeout.
- SendStreamDataToPeer(kHeadersStreamId, "GET /", 0, kFin, nullptr);
+ SendStreamDataToPeer(kHeadersStreamId, "GET /", 0, FIN, nullptr);
clock_.AdvanceTime(QuicTime::Delta::FromSeconds(3));
QuicAckFrame frame = InitAckFrame(1);
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
@@ -2873,7 +2880,7 @@ TEST_P(QuicConnectionTest, PingAfterSend) {
// the ping alarm.
clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(5));
EXPECT_FALSE(connection_.GetRetransmissionAlarm()->IsSet());
- SendStreamDataToPeer(kHeadersStreamId, "GET /", 0, kFin, nullptr);
+ SendStreamDataToPeer(kHeadersStreamId, "GET /", 0, FIN, nullptr);
EXPECT_TRUE(connection_.GetPingAlarm()->IsSet());
EXPECT_EQ(clock_.ApproximateNow() + QuicTime::Delta::FromSeconds(15),
connection_.GetPingAlarm()->deadline());
@@ -2918,7 +2925,7 @@ TEST_P(QuicConnectionTest, ReducedPingTimeout) {
// the ping alarm.
clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(5));
EXPECT_FALSE(connection_.GetRetransmissionAlarm()->IsSet());
- SendStreamDataToPeer(kHeadersStreamId, "GET /", 0, kFin, nullptr);
+ SendStreamDataToPeer(kHeadersStreamId, "GET /", 0, FIN, nullptr);
EXPECT_TRUE(connection_.GetPingAlarm()->IsSet());
EXPECT_EQ(clock_.ApproximateNow() + QuicTime::Delta::FromSeconds(10),
connection_.GetPingAlarm()->deadline());
@@ -2972,7 +2979,7 @@ TEST_P(QuicConnectionTest, SendMtuDiscoveryPacket) {
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _))
.WillOnce(DoAll(SaveArg<3>(&size_before_mtu_change), Return(true)))
.WillOnce(Return(true));
- connection_.SendStreamDataWithString(3, data, 0, kFin, nullptr);
+ connection_.SendStreamDataWithString(3, data, 0, FIN, nullptr);
EXPECT_EQ(3u, creator_->packet_number());
EXPECT_EQ(kDefaultMaxPacketSize, size_before_mtu_change);
@@ -2985,7 +2992,7 @@ TEST_P(QuicConnectionTest, SendMtuDiscoveryPacket) {
// Send the same data again. Check that it fits into a single packet now.
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(1);
- connection_.SendStreamDataWithString(3, data, 0, kFin, nullptr);
+ connection_.SendStreamDataWithString(3, data, 0, FIN, nullptr);
EXPECT_EQ(4u, creator_->packet_number());
}
@@ -2996,7 +3003,7 @@ TEST_P(QuicConnectionTest, MtuDiscoveryDisabled) {
const QuicPacketCount number_of_packets = kPacketsBetweenMtuProbesBase * 2;
for (QuicPacketCount i = 0; i < number_of_packets; i++) {
- SendStreamDataToPeer(3, ".", i, /*fin=*/false, nullptr);
+ SendStreamDataToPeer(3, ".", i, NO_FIN, nullptr);
EXPECT_FALSE(connection_.GetMtuDiscoveryAlarm()->IsSet());
EXPECT_EQ(0u, connection_.mtu_probe_count());
}
@@ -3011,13 +3018,12 @@ TEST_P(QuicConnectionTest, MtuDiscoveryEnabled) {
// Send enough packets so that the next one triggers path MTU discovery.
for (QuicPacketCount i = 0; i < kPacketsBetweenMtuProbesBase - 1; i++) {
- SendStreamDataToPeer(3, ".", i, /*fin=*/false, nullptr);
+ SendStreamDataToPeer(3, ".", i, NO_FIN, nullptr);
ASSERT_FALSE(connection_.GetMtuDiscoveryAlarm()->IsSet());
}
// Trigger the probe.
- SendStreamDataToPeer(3, "!", kPacketsBetweenMtuProbesBase,
- /*fin=*/false, nullptr);
+ SendStreamDataToPeer(3, "!", kPacketsBetweenMtuProbesBase, NO_FIN, nullptr);
ASSERT_TRUE(connection_.GetMtuDiscoveryAlarm()->IsSet());
QuicByteCount probe_size;
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _))
@@ -3038,7 +3044,7 @@ TEST_P(QuicConnectionTest, MtuDiscoveryEnabled) {
// Send more packets, and ensure that none of them sets the alarm.
for (QuicPacketCount i = 0; i < 4 * kPacketsBetweenMtuProbesBase; i++) {
- SendStreamDataToPeer(3, ".", i, /*fin=*/false, nullptr);
+ SendStreamDataToPeer(3, ".", i, NO_FIN, nullptr);
ASSERT_FALSE(connection_.GetMtuDiscoveryAlarm()->IsSet());
}
@@ -3076,7 +3082,7 @@ TEST_P(QuicConnectionTest, MtuDiscoveryFailed) {
EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _))
.Times(AnyNumber());
for (QuicPacketCount i = 0; i < number_of_packets; i++) {
- SendStreamDataToPeer(3, "!", i, /*fin=*/false, nullptr);
+ SendStreamDataToPeer(3, "!", i, NO_FIN, nullptr);
clock_.AdvanceTime(rtt);
// Receive an ACK, which marks all data packets as received, and all MTU
@@ -3127,13 +3133,12 @@ TEST_P(QuicConnectionTest, MtuDiscoveryWriterLimited) {
// Send enough packets so that the next one triggers path MTU discovery.
for (QuicPacketCount i = 0; i < kPacketsBetweenMtuProbesBase - 1; i++) {
- SendStreamDataToPeer(3, ".", i, /*fin=*/false, nullptr);
+ SendStreamDataToPeer(3, ".", i, NO_FIN, nullptr);
ASSERT_FALSE(connection_.GetMtuDiscoveryAlarm()->IsSet());
}
// Trigger the probe.
- SendStreamDataToPeer(3, "!", kPacketsBetweenMtuProbesBase,
- /*fin=*/false, nullptr);
+ SendStreamDataToPeer(3, "!", kPacketsBetweenMtuProbesBase, NO_FIN, nullptr);
ASSERT_TRUE(connection_.GetMtuDiscoveryAlarm()->IsSet());
QuicByteCount probe_size;
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _))
@@ -3155,7 +3160,7 @@ TEST_P(QuicConnectionTest, MtuDiscoveryWriterLimited) {
// Send more packets, and ensure that none of them sets the alarm.
for (QuicPacketCount i = 0; i < 4 * kPacketsBetweenMtuProbesBase; i++) {
- SendStreamDataToPeer(3, ".", i, /*fin=*/false, nullptr);
+ SendStreamDataToPeer(3, ".", i, NO_FIN, nullptr);
ASSERT_FALSE(connection_.GetMtuDiscoveryAlarm()->IsSet());
}
@@ -3175,13 +3180,12 @@ TEST_P(QuicConnectionTest, MtuDiscoveryWriterFailed) {
// Send enough packets so that the next one triggers path MTU discovery.
for (QuicPacketCount i = 0; i < kPacketsBetweenMtuProbesBase - 1; i++) {
- SendStreamDataToPeer(3, ".", i, /*fin=*/false, nullptr);
+ SendStreamDataToPeer(3, ".", i, NO_FIN, nullptr);
ASSERT_FALSE(connection_.GetMtuDiscoveryAlarm()->IsSet());
}
// Trigger the probe.
- SendStreamDataToPeer(3, "!", kPacketsBetweenMtuProbesBase,
- /*fin=*/false, nullptr);
+ SendStreamDataToPeer(3, "!", kPacketsBetweenMtuProbesBase, NO_FIN, nullptr);
ASSERT_TRUE(connection_.GetMtuDiscoveryAlarm()->IsSet());
writer_->SimulateNextPacketTooLarge();
connection_.GetMtuDiscoveryAlarm()->Fire();
@@ -3220,12 +3224,11 @@ TEST_P(QuicConnectionTest, NoMtuDiscoveryAfterConnectionClosed) {
// Send enough packets so that the next one triggers path MTU discovery.
for (QuicPacketCount i = 0; i < kPacketsBetweenMtuProbesBase - 1; i++) {
- SendStreamDataToPeer(3, ".", i, /*fin=*/false, nullptr);
+ SendStreamDataToPeer(3, ".", i, NO_FIN, nullptr);
ASSERT_FALSE(connection_.GetMtuDiscoveryAlarm()->IsSet());
}
- SendStreamDataToPeer(3, "!", kPacketsBetweenMtuProbesBase,
- /*fin=*/false, nullptr);
+ SendStreamDataToPeer(3, "!", kPacketsBetweenMtuProbesBase, NO_FIN, nullptr);
EXPECT_TRUE(connection_.GetMtuDiscoveryAlarm()->IsSet());
EXPECT_CALL(visitor_, OnConnectionClosed(_, _, _));
@@ -3249,13 +3252,13 @@ TEST_P(QuicConnectionTest, TimeoutAfterSend) {
// When we send a packet, the timeout will change to 5ms +
// kInitialIdleTimeoutSecs.
clock_.AdvanceTime(five_ms);
- SendStreamDataToPeer(kClientDataStreamId1, "foo", 0, kFin, nullptr);
+ SendStreamDataToPeer(kClientDataStreamId1, "foo", 0, FIN, nullptr);
EXPECT_EQ(default_timeout, connection_.GetTimeoutAlarm()->deadline());
// Now send more data. This will not move the timeout becase
// no data has been recieved since the previous write.
clock_.AdvanceTime(five_ms);
- SendStreamDataToPeer(kClientDataStreamId1, "foo", 0, kFin, nullptr);
+ SendStreamDataToPeer(kClientDataStreamId1, "foo", 0, FIN, nullptr);
EXPECT_EQ(default_timeout, connection_.GetTimeoutAlarm()->deadline());
// The original alarm will fire. We should not time out because we had a
@@ -3304,7 +3307,7 @@ TEST_P(QuicConnectionTest, TimeoutAfterRetransmission) {
const QuicTime send_time = start_time + five_ms;
clock_.AdvanceTime(five_ms);
ASSERT_EQ(send_time, clock_.Now());
- SendStreamDataToPeer(kClientDataStreamId1, "foo", 0, kFin, nullptr);
+ SendStreamDataToPeer(kClientDataStreamId1, "foo", 0, FIN, nullptr);
EXPECT_EQ(default_timeout, connection_.GetTimeoutAlarm()->deadline());
// Move forward 5 ms and receive a packet, which will move the timeout
@@ -3386,13 +3389,13 @@ TEST_P(QuicConnectionTest, NewTimeoutAfterSendSilentClose) {
// When we send a packet, the timeout will change to 5ms +
// kInitialIdleTimeoutSecs.
clock_.AdvanceTime(five_ms);
- SendStreamDataToPeer(kClientDataStreamId1, "foo", 0, kFin, nullptr);
+ SendStreamDataToPeer(kClientDataStreamId1, "foo", 0, FIN, nullptr);
EXPECT_EQ(default_timeout, connection_.GetTimeoutAlarm()->deadline());
// Now send more data. This will not move the timeout becase
// no data has been recieved since the previous write.
clock_.AdvanceTime(five_ms);
- SendStreamDataToPeer(kClientDataStreamId1, "foo", 0, kFin, nullptr);
+ SendStreamDataToPeer(kClientDataStreamId1, "foo", 0, FIN, nullptr);
EXPECT_EQ(default_timeout, connection_.GetTimeoutAlarm()->deadline());
// The original alarm will fire. We should not time out because we had a
@@ -3428,9 +3431,9 @@ TEST_P(QuicConnectionTest, TimeoutAfterReceive) {
const QuicTime::Delta five_ms = QuicTime::Delta::FromMilliseconds(5);
QuicTime default_timeout = clock_.ApproximateNow() + initial_idle_timeout;
- connection_.SendStreamDataWithString(kClientDataStreamId1, "foo", 0, !kFin,
+ connection_.SendStreamDataWithString(kClientDataStreamId1, "foo", 0, NO_FIN,
nullptr);
- connection_.SendStreamDataWithString(kClientDataStreamId1, "foo", 3, !kFin,
+ connection_.SendStreamDataWithString(kClientDataStreamId1, "foo", 3, NO_FIN,
nullptr);
EXPECT_EQ(default_timeout, connection_.GetTimeoutAlarm()->deadline());
@@ -3480,10 +3483,10 @@ TEST_P(QuicConnectionTest, TimeoutAfterReceiveNotSendWhenUnacked) {
QuicTime default_timeout = clock_.ApproximateNow() + initial_idle_timeout;
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _));
- connection_.SendStreamDataWithString(kClientDataStreamId1, "foo", 0, !kFin,
+ connection_.SendStreamDataWithString(kClientDataStreamId1, "foo", 0, NO_FIN,
nullptr);
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _));
- connection_.SendStreamDataWithString(kClientDataStreamId1, "foo", 3, !kFin,
+ connection_.SendStreamDataWithString(kClientDataStreamId1, "foo", 3, NO_FIN,
nullptr);
EXPECT_EQ(default_timeout, connection_.GetTimeoutAlarm()->deadline());
@@ -3513,7 +3516,7 @@ TEST_P(QuicConnectionTest, TimeoutAfterReceiveNotSendWhenUnacked) {
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(AnyNumber());
for (int i = 0; i < 100 && connection_.connected(); ++i) {
QUIC_LOG(INFO) << "sending data packet";
- connection_.SendStreamDataWithString(kClientDataStreamId1, "foo", 0, !kFin,
+ connection_.SendStreamDataWithString(kClientDataStreamId1, "foo", 0, NO_FIN,
nullptr);
connection_.GetTimeoutAlarm()->Fire();
clock_.AdvanceTime(QuicTime::Delta::FromSeconds(1));
@@ -3533,7 +3536,7 @@ TEST_P(QuicConnectionTest, TimeoutAfter5ClientRTOs) {
connection_.SetFromConfig(config);
// Send stream data.
- SendStreamDataToPeer(kClientDataStreamId1, "foo", 0, kFin, nullptr);
+ SendStreamDataToPeer(kClientDataStreamId1, "foo", 0, FIN, nullptr);
EXPECT_CALL(visitor_, OnPathDegrading());
// Fire the retransmission alarm 6 times, twice for TLP and 4 times for RTO.
@@ -3596,7 +3599,7 @@ TEST_P(QuicConnectionTest, TestQueueLimitsOnSendStreamData) {
.WillOnce(testing::Return(QuicTime::Delta::FromMicroseconds(10)));
const string payload(payload_length, 'a');
EXPECT_EQ(0u,
- connection_.SendStreamDataWithString(3, payload, 0, !kFin, nullptr)
+ connection_.SendStreamDataWithString(3, payload, 0, NO_FIN, nullptr)
.bytes_consumed);
EXPECT_EQ(0u, connection_.NumQueuedPackets());
}
@@ -3621,7 +3624,7 @@ TEST_P(QuicConnectionTest, LoopThroughSendingPackets) {
// The first stream frame will have 2 fewer overhead bytes than the other six.
const string payload(payload_length * 7 + 2, 'a');
EXPECT_EQ(payload.size(),
- connection_.SendStreamDataWithString(1, payload, 0, !kFin, nullptr)
+ connection_.SendStreamDataWithString(1, payload, 0, NO_FIN, nullptr)
.bytes_consumed);
}
@@ -3633,7 +3636,7 @@ TEST_P(QuicConnectionTest, LoopThroughSendingPacketsWithTruncation) {
// Now send some packets with no truncation.
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(2);
EXPECT_EQ(payload.size(),
- connection_.SendStreamDataWithString(3, payload, 0, !kFin, nullptr)
+ connection_.SendStreamDataWithString(3, payload, 0, NO_FIN, nullptr)
.bytes_consumed);
// Track the size of the second packet here. The overhead will be the largest
// we see in this test, due to the non-truncated connection id.
@@ -3645,7 +3648,7 @@ TEST_P(QuicConnectionTest, LoopThroughSendingPacketsWithTruncation) {
connection_.SetFromConfig(config);
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(2);
EXPECT_EQ(payload.size(),
- connection_.SendStreamDataWithString(3, payload, 0, !kFin, nullptr)
+ connection_.SendStreamDataWithString(3, payload, 0, NO_FIN, nullptr)
.bytes_consumed);
// Just like above, we save 8 bytes on payload, and 8 on truncation.
EXPECT_EQ(non_truncated_packet_size, writer_->last_packet_size() + 8 * 2);
@@ -4153,7 +4156,7 @@ TEST_P(QuicConnectionTest, NoAckOnOldNacks) {
TEST_P(QuicConnectionTest, SendDelayedAckOnOutgoingPacket) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
ProcessPacket(1);
- connection_.SendStreamDataWithString(kClientDataStreamId1, "foo", 0, !kFin,
+ connection_.SendStreamDataWithString(kClientDataStreamId1, "foo", 0, NO_FIN,
nullptr);
// Check that ack is bundled with outgoing data and that delayed ack
// alarm is reset.
@@ -4171,14 +4174,14 @@ TEST_P(QuicConnectionTest, SendDelayedAckOnOutgoingPacket) {
TEST_P(QuicConnectionTest, SendDelayedAckOnOutgoingCryptoPacket) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
ProcessPacket(1);
- connection_.SendStreamDataWithString(kCryptoStreamId, "foo", 0, !kFin,
+ connection_.SendStreamDataWithString(kCryptoStreamId, "foo", 0, NO_FIN,
nullptr);
// Check that ack is bundled with outgoing crypto data.
if (GetParam().no_stop_waiting) {
- EXPECT_EQ(2u, writer_->frame_count());
+ EXPECT_EQ(3u, writer_->frame_count());
EXPECT_TRUE(writer_->stop_waiting_frames().empty());
} else {
- EXPECT_EQ(3u, writer_->frame_count());
+ EXPECT_EQ(4u, writer_->frame_count());
EXPECT_FALSE(writer_->stop_waiting_frames().empty());
}
EXPECT_FALSE(connection_.GetAckAlarm()->IsSet());
@@ -4189,11 +4192,11 @@ TEST_P(QuicConnectionTest, BlockAndBufferOnFirstCHLOPacketOfTwo) {
ProcessPacket(1);
BlockOnNextWrite();
writer_->set_is_write_blocked_data_buffered(true);
- connection_.SendStreamDataWithString(kCryptoStreamId, "foo", 0, !kFin,
+ connection_.SendStreamDataWithString(kCryptoStreamId, "foo", 0, NO_FIN,
nullptr);
EXPECT_TRUE(writer_->IsWriteBlocked());
EXPECT_FALSE(connection_.HasQueuedData());
- connection_.SendStreamDataWithString(kCryptoStreamId, "bar", 3, !kFin,
+ connection_.SendStreamDataWithString(kCryptoStreamId, "bar", 3, NO_FIN,
nullptr);
EXPECT_TRUE(writer_->IsWriteBlocked());
EXPECT_TRUE(connection_.HasQueuedData());
@@ -4211,13 +4214,14 @@ TEST_P(QuicConnectionTest, BundleAckForSecondCHLO) {
ProcessPacket(2);
// Check that ack is sent and that delayed ack alarm is reset.
if (GetParam().no_stop_waiting) {
- EXPECT_EQ(2u, writer_->frame_count());
+ EXPECT_EQ(3u, writer_->frame_count());
EXPECT_TRUE(writer_->stop_waiting_frames().empty());
} else {
- EXPECT_EQ(3u, writer_->frame_count());
+ EXPECT_EQ(4u, writer_->frame_count());
EXPECT_FALSE(writer_->stop_waiting_frames().empty());
}
EXPECT_EQ(1u, writer_->stream_frames().size());
+ EXPECT_EQ(1u, writer_->padding_frames().size());
EXPECT_FALSE(writer_->ack_frames().empty());
EXPECT_EQ(2u, writer_->ack_frames().front().largest_observed);
EXPECT_FALSE(connection_.GetAckAlarm()->IsSet());
@@ -4239,13 +4243,14 @@ TEST_P(QuicConnectionTest, BundleAckForSecondCHLOTwoPacketReject) {
}
// Check that ack is sent and that delayed ack alarm is reset.
if (GetParam().no_stop_waiting) {
- EXPECT_EQ(2u, writer_->frame_count());
+ EXPECT_EQ(3u, writer_->frame_count());
EXPECT_TRUE(writer_->stop_waiting_frames().empty());
} else {
- EXPECT_EQ(3u, writer_->frame_count());
+ EXPECT_EQ(4u, writer_->frame_count());
EXPECT_FALSE(writer_->stop_waiting_frames().empty());
}
EXPECT_EQ(1u, writer_->stream_frames().size());
+ EXPECT_EQ(1u, writer_->padding_frames().size());
EXPECT_FALSE(writer_->ack_frames().empty());
EXPECT_EQ(2u, writer_->ack_frames().front().largest_observed);
EXPECT_FALSE(connection_.GetAckAlarm()->IsSet());
@@ -4253,9 +4258,9 @@ TEST_P(QuicConnectionTest, BundleAckForSecondCHLOTwoPacketReject) {
TEST_P(QuicConnectionTest, BundleAckWithDataOnIncomingAck) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
- connection_.SendStreamDataWithString(kClientDataStreamId1, "foo", 0, !kFin,
+ connection_.SendStreamDataWithString(kClientDataStreamId1, "foo", 0, NO_FIN,
nullptr);
- connection_.SendStreamDataWithString(kClientDataStreamId1, "foo", 3, !kFin,
+ connection_.SendStreamDataWithString(kClientDataStreamId1, "foo", 3, NO_FIN,
nullptr);
// Ack the second packet, which will retransmit the first packet.
QuicAckFrame ack = InitAckFrame(2);
@@ -4557,11 +4562,11 @@ TEST_P(QuicConnectionTest, CheckSendStats) {
connection_.SetMaxTailLossProbes(0);
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _));
- connection_.SendStreamDataWithString(3, "first", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(3, "first", 0, NO_FIN, nullptr);
size_t first_packet_size = writer_->last_packet_size();
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _));
- connection_.SendStreamDataWithString(5, "second", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(5, "second", 0, NO_FIN, nullptr);
size_t second_packet_size = writer_->last_packet_size();
// 2 retransmissions due to rto, 1 due to explicit nack.
@@ -4664,7 +4669,7 @@ TEST_P(QuicConnectionTest, ConnectionCloseWhenWritable) {
EXPECT_FALSE(writer_->IsWriteBlocked());
// Send a packet.
- connection_.SendStreamDataWithString(1, "foo", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(1, "foo", 0, NO_FIN, nullptr);
EXPECT_EQ(0u, connection_.NumQueuedPackets());
EXPECT_EQ(1u, writer_->packets_write_attempts());
@@ -4681,7 +4686,7 @@ TEST_P(QuicConnectionTest, ConnectionCloseGettingWriteBlocked) {
TEST_P(QuicConnectionTest, ConnectionCloseWhenWriteBlocked) {
BlockOnNextWrite();
- connection_.SendStreamDataWithString(1, "foo", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(1, "foo", 0, NO_FIN, nullptr);
EXPECT_EQ(1u, connection_.NumQueuedPackets());
EXPECT_EQ(1u, writer_->packets_write_attempts());
EXPECT_TRUE(writer_->IsWriteBlocked());
@@ -4697,7 +4702,7 @@ TEST_P(QuicConnectionTest, AckNotifierTriggerCallback) {
EXPECT_CALL(*listener, OnPacketAcked(_, _)).Times(1);
// Send some data, which will register the listener to be notified.
- connection_.SendStreamDataWithString(1, "foo", 0, !kFin, listener);
+ connection_.SendStreamDataWithString(1, "foo", 0, NO_FIN, listener);
// Process an ACK from the server which should trigger the callback.
EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _));
@@ -4714,11 +4719,11 @@ TEST_P(QuicConnectionTest, AckNotifierFailToTriggerCallback) {
// Send some data, which will register the listener to be notified. This will
// not be ACKed and so the listener should never be called.
- connection_.SendStreamDataWithString(1, "foo", 0, !kFin, listener);
+ connection_.SendStreamDataWithString(1, "foo", 0, NO_FIN, listener);
// Send some other data which we will ACK.
- connection_.SendStreamDataWithString(1, "foo", 0, !kFin, nullptr);
- connection_.SendStreamDataWithString(1, "bar", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(1, "foo", 0, NO_FIN, nullptr);
+ connection_.SendStreamDataWithString(1, "bar", 0, NO_FIN, nullptr);
// Now we receive ACK for packets 2 and 3, but importantly missing packet 1
// which we registered to be notified about.
@@ -4741,10 +4746,10 @@ TEST_P(QuicConnectionTest, AckNotifierCallbackAfterRetransmission) {
EXPECT_CALL(*listener, OnPacketAcked(3, _)).Times(1);
// Send four packets, and register to be notified on ACK of packet 2.
- connection_.SendStreamDataWithString(3, "foo", 0, !kFin, nullptr);
- connection_.SendStreamDataWithString(3, "bar", 0, !kFin, listener);
- connection_.SendStreamDataWithString(3, "baz", 0, !kFin, nullptr);
- connection_.SendStreamDataWithString(3, "qux", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(3, "foo", 0, NO_FIN, nullptr);
+ connection_.SendStreamDataWithString(3, "bar", 0, NO_FIN, listener);
+ connection_.SendStreamDataWithString(3, "baz", 0, NO_FIN, nullptr);
+ connection_.SendStreamDataWithString(3, "qux", 0, NO_FIN, nullptr);
// Now we receive ACK for packets 1, 3, and 4 and lose 2.
QuicAckFrame frame = InitAckFrame(4);
@@ -4777,7 +4782,7 @@ TEST_P(QuicConnectionTest, AckNotifierCallbackForAckAfterRTO) {
QuicTime default_retransmission_time =
clock_.ApproximateNow() + DefaultRetransmissionTime();
- connection_.SendStreamDataWithString(3, "foo", 0, !kFin, listener);
+ connection_.SendStreamDataWithString(3, "foo", 0, NO_FIN, listener);
EXPECT_EQ(1u, stop_waiting()->least_unacked);
EXPECT_EQ(1u, writer_->header().packet_number);
@@ -4814,10 +4819,10 @@ TEST_P(QuicConnectionTest, AckNotifierCallbackForAckOfNackedPacket) {
new StrictMock<MockAckListener>());
// Send four packets, and register to be notified on ACK of packet 2.
- connection_.SendStreamDataWithString(3, "foo", 0, !kFin, nullptr);
- connection_.SendStreamDataWithString(3, "bar", 0, !kFin, listener);
- connection_.SendStreamDataWithString(3, "baz", 0, !kFin, nullptr);
- connection_.SendStreamDataWithString(3, "qux", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(3, "foo", 0, NO_FIN, nullptr);
+ connection_.SendStreamDataWithString(3, "bar", 0, NO_FIN, listener);
+ connection_.SendStreamDataWithString(3, "baz", 0, NO_FIN, nullptr);
+ connection_.SendStreamDataWithString(3, "qux", 0, NO_FIN, nullptr);
// Now we receive ACK for packets 1, 3, and 4 and lose 2.
QuicAckFrame frame = InitAckFrame(4);
@@ -4908,7 +4913,7 @@ TEST_P(QuicConnectionTest, NoDataNoFin) {
// Regression test for b/18594622
QuicReferenceCountedPointer<MockAckListener> listener(new MockAckListener);
EXPECT_QUIC_BUG(
- connection_.SendStreamDataWithString(3, "", 0, !kFin, listener),
+ connection_.SendStreamDataWithString(3, "", 0, NO_FIN, listener),
"Attempt to send empty stream frame");
}
@@ -4923,7 +4928,7 @@ TEST_P(QuicConnectionTest, DoNotSendGoAwayTwice) {
TEST_P(QuicConnectionTest, ReevaluateTimeUntilSendOnAck) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
- connection_.SendStreamDataWithString(kClientDataStreamId1, "foo", 0, !kFin,
+ connection_.SendStreamDataWithString(kClientDataStreamId1, "foo", 0, NO_FIN,
nullptr);
// Evaluate CanWrite, and have it return a non-Zero value.
@@ -4984,7 +4989,7 @@ TEST_P(QuicConnectionTest, SendingUnencryptedStreamDataFails) {
_, ConnectionCloseSource::FROM_SELF));
struct iovec iov;
QuicIOVector data_iov(MakeIOVector("", &iov));
- EXPECT_QUIC_BUG(connection_.SendStreamData(3, data_iov, 0, kFin, nullptr),
+ EXPECT_QUIC_BUG(connection_.SendStreamData(3, data_iov, 0, FIN, nullptr),
"Cannot send stream data without encryption.");
EXPECT_FALSE(connection_.connected());
}
@@ -4995,7 +5000,7 @@ TEST_P(QuicConnectionTest, OnPathDegrading) {
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _))
.WillOnce(DoAll(SaveArg<3>(&packet_size), Return(true)));
- connection_.SendStreamDataWithString(3, "packet", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(3, "packet", 0, NO_FIN, nullptr);
size_t num_timeouts =
kMinTimeoutsBeforePathDegrading +
QuicSentPacketManagerPeer::GetMaxTailLossProbes(
@@ -5071,7 +5076,7 @@ TEST_P(QuicConnectionTest, CloseConnectionOnPacketTooLarge) {
EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_PACKET_WRITE_ERROR, _,
ConnectionCloseSource::FROM_SELF))
.Times(1);
- connection_.SendStreamDataWithString(3, "foo", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(3, "foo", 0, NO_FIN, nullptr);
}
TEST_P(QuicConnectionTest, AlwaysGetPacketTooLarge) {
@@ -5081,7 +5086,7 @@ TEST_P(QuicConnectionTest, AlwaysGetPacketTooLarge) {
EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_PACKET_WRITE_ERROR, _,
ConnectionCloseSource::FROM_SELF))
.Times(1);
- connection_.SendStreamDataWithString(3, "foo", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(3, "foo", 0, NO_FIN, nullptr);
}
// Verify that if connection has no outstanding data, it notifies the send
@@ -5134,7 +5139,7 @@ TEST_P(QuicConnectionTest, DonotForceSendingAckOnPacketTooLarge) {
// Simulate data packet causes write error.
EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_PACKET_WRITE_ERROR, _, _));
SimulateNextPacketTooLarge();
- connection_.SendStreamDataWithString(3, "foo", 0, !kFin, nullptr);
+ connection_.SendStreamDataWithString(3, "foo", 0, NO_FIN, nullptr);
EXPECT_EQ(1u, writer_->frame_count());
EXPECT_FALSE(writer_->connection_close_frames().empty());
// Ack frame is not bundled in connection close packet.
« no previous file with comments | « net/quic/core/quic_connection.cc ('k') | net/quic/core/quic_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698