chromium/net/third_party/quiche/src/quiche/quic/core/quic_connection_test.cc

// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "quiche/quic/core/quic_connection.h"

#include <errno.h>

#include <algorithm>
#include <cstdint>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>

#include "absl/base/macros.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_join.h"
#include "absl/strings/string_view.h"
#include "quiche/quic/core/congestion_control/loss_detection_interface.h"
#include "quiche/quic/core/congestion_control/send_algorithm_interface.h"
#include "quiche/quic/core/crypto/null_decrypter.h"
#include "quiche/quic/core/crypto/null_encrypter.h"
#include "quiche/quic/core/crypto/quic_decrypter.h"
#include "quiche/quic/core/frames/quic_connection_close_frame.h"
#include "quiche/quic/core/frames/quic_new_connection_id_frame.h"
#include "quiche/quic/core/frames/quic_path_response_frame.h"
#include "quiche/quic/core/frames/quic_rst_stream_frame.h"
#include "quiche/quic/core/quic_connection_id.h"
#include "quiche/quic/core/quic_constants.h"
#include "quiche/quic/core/quic_error_codes.h"
#include "quiche/quic/core/quic_packet_creator.h"
#include "quiche/quic/core/quic_packets.h"
#include "quiche/quic/core/quic_path_validator.h"
#include "quiche/quic/core/quic_types.h"
#include "quiche/quic/core/quic_utils.h"
#include "quiche/quic/core/quic_versions.h"
#include "quiche/quic/platform/api/quic_expect_bug.h"
#include "quiche/quic/platform/api/quic_flags.h"
#include "quiche/quic/platform/api/quic_ip_address.h"
#include "quiche/quic/platform/api/quic_ip_address_family.h"
#include "quiche/quic/platform/api/quic_logging.h"
#include "quiche/quic/platform/api/quic_socket_address.h"
#include "quiche/quic/platform/api/quic_test.h"
#include "quiche/quic/test_tools/mock_clock.h"
#include "quiche/quic/test_tools/mock_connection_id_generator.h"
#include "quiche/quic/test_tools/mock_random.h"
#include "quiche/quic/test_tools/quic_coalesced_packet_peer.h"
#include "quiche/quic/test_tools/quic_config_peer.h"
#include "quiche/quic/test_tools/quic_connection_peer.h"
#include "quiche/quic/test_tools/quic_framer_peer.h"
#include "quiche/quic/test_tools/quic_packet_creator_peer.h"
#include "quiche/quic/test_tools/quic_path_validator_peer.h"
#include "quiche/quic/test_tools/quic_sent_packet_manager_peer.h"
#include "quiche/quic/test_tools/quic_test_utils.h"
#include "quiche/quic/test_tools/simple_data_producer.h"
#include "quiche/quic/test_tools/simple_session_notifier.h"
#include "quiche/common/simple_buffer_allocator.h"

_;
AnyNumber;
AtLeast;
DoAll;
DoDefault;
ElementsAre;
Ge;
IgnoreResult;
InSequence;
Invoke;
InvokeWithoutArgs;
Lt;
Ref;
Return;
SaveArg;
SetArgPointee;
StrictMock;

namespace quic {
namespace test {
namespace {

const char data1[] =;
const char data2[] =;

const bool kHasStopWaiting =;

const int kDefaultRetransmissionTimeMs =;

DiversificationNonce kTestDiversificationNonce =;

const StatelessResetToken kTestStatelessResetToken{};

const QuicSocketAddress kPeerAddress =;
const QuicSocketAddress kSelfAddress =;
const QuicSocketAddress kServerPreferredAddress =address;
      address.FromString("2604:31c0::");
      return address;
    }(),
    /*port=*/443);

QuicStreamId GetNthClientInitiatedStreamId(int n,
                                           QuicTransportVersion version) {}

QuicLongHeaderType EncryptionlevelToLongHeaderType(EncryptionLevel level) {}

// A TaggingEncrypterWithConfidentialityLimit is a TaggingEncrypter that allows
// specifying the confidentiality limit on the maximum number of packets that
// may be encrypted per key phase in TLS+QUIC.
class TaggingEncrypterWithConfidentialityLimit : public TaggingEncrypter {};

class StrictTaggingDecrypterWithIntegrityLimit : public StrictTaggingDecrypter {};

class TestConnectionHelper : public QuicConnectionHelperInterface {};

class TestConnection : public QuicConnection {};

enum class AckResponse {};

// Run tests with combinations of {ParsedQuicVersion, AckResponse}.
struct TestParams {};

// Used by ::testing::PrintToStringParamName().
std::string PrintToString(const TestParams& p) {}

// Constructs various test permutations.
std::vector<TestParams> GetTestParams() {}

class QuicConnectionTest : public QuicTestWithParam<TestParams> {};

// Run all end to end tests with all supported versions.
INSTANTIATE_TEST_SUITE_P();

// These two tests ensure that the QuicErrorCode mapping works correctly.
// Both tests expect to see a Google QUIC close if not running IETF QUIC.
// If running IETF QUIC, the first will generate a transport connection
// close, the second an application connection close.
// The connection close codes for the two tests are manually chosen;
// they are expected to always map to transport- and application-
// closes, respectively. If that changes, new codes should be chosen.
TEST_P(QuicConnectionTest, CloseErrorCodeTestTransport) {}

// Test that the IETF QUIC Error code mapping function works
// properly for application connection close codes.
TEST_P(QuicConnectionTest, CloseErrorCodeTestApplication) {}

TEST_P(QuicConnectionTest, SelfAddressChangeAtClient) {}

TEST_P(QuicConnectionTest, SelfAddressChangeAtServer) {}

TEST_P(QuicConnectionTest, AllowSelfAddressChangeToMappedIpv4AddressAtServer) {}

TEST_P(QuicConnectionTest, ClientAddressChangeAndPacketReordered) {}

TEST_P(QuicConnectionTest, PeerPortChangeAtServer) {}

TEST_P(QuicConnectionTest, PeerIpAddressChangeAtServer) {}

TEST_P(QuicConnectionTest, PeerIpAddressChangeAtServerWithMissingConnectionId) {}

TEST_P(QuicConnectionTest, EffectivePeerAddressChangeAtServer) {}

// Regression test for b/200020764.
TEST_P(QuicConnectionTest, ConnectionMigrationWithPendingPaddingBytes) {}

// Regression test for b/196208556.
TEST_P(QuicConnectionTest,
       ReversePathValidationResponseReceivedFromUnexpectedPeerAddress) {}

TEST_P(QuicConnectionTest, ReversePathValidationFailureAtServer) {}

TEST_P(QuicConnectionTest, ReceivePathProbeWithNoAddressChangeAtServer) {}

// Regression test for b/150161358.
TEST_P(QuicConnectionTest, BufferedMtuPacketTooBig) {}

TEST_P(QuicConnectionTest, WriteOutOfOrderQueuedPackets) {}

TEST_P(QuicConnectionTest, DiscardQueuedPacketsAfterConnectionClose) {}

class TestQuicPathValidationContext : public QuicPathValidationContext {};

class TestValidationResultDelegate : public QuicPathValidator::ResultDelegate {};

// A test implementation which migrates to server preferred address
// on path validation suceeds. Otherwise, client cleans up alternative path.
class ServerPreferredAddressTestResultDelegate
    : public QuicPathValidator::ResultDelegate {};

// Receive a path probe request at the server side, in IETF version: receive a
// packet contains PATH CHALLENGE with peer address change.
TEST_P(QuicConnectionTest, ReceivePathProbingFromNewPeerAddressAtServer) {}

// Receive a packet contains PATH CHALLENGE with self address change.
TEST_P(QuicConnectionTest, ReceivePathProbingToPreferredAddressAtServer) {}

// Receive a padded PING packet with a port change on server side.
TEST_P(QuicConnectionTest, ReceivePaddedPingWithPortChangeAtServer) {}

TEST_P(QuicConnectionTest, ReceiveReorderedPathProbingAtServer) {}

TEST_P(QuicConnectionTest, MigrateAfterProbingAtServer) {}

TEST_P(QuicConnectionTest, ReceiveConnectivityProbingPacketAtClient) {}

TEST_P(QuicConnectionTest, ReceiveConnectivityProbingResponseAtClient) {}

TEST_P(QuicConnectionTest, PeerAddressChangeAtClient) {}

TEST_P(QuicConnectionTest, NoNormalizedPeerAddressChangeAtClient) {}

TEST_P(QuicConnectionTest, ServerAddressChangesToKnownAddress) {}

TEST_P(QuicConnectionTest,
       PeerAddressChangesToPreferredAddressBeforeClientInitiates) {}

TEST_P(QuicConnectionTest, MaxPacketSize) {}

TEST_P(QuicConnectionTest, PeerLowersMaxPacketSize) {}

TEST_P(QuicConnectionTest, PeerCannotRaiseMaxPacketSize) {}

TEST_P(QuicConnectionTest, SmallerServerMaxPacketSize) {}

TEST_P(QuicConnectionTest, LowerServerResponseMtuTest) {}

TEST_P(QuicConnectionTest, IncreaseServerMaxPacketSize) {}

TEST_P(QuicConnectionTest, IncreaseServerMaxPacketSizeWhileWriterLimited) {}

TEST_P(QuicConnectionTest, LimitMaxPacketSizeByWriter) {}

TEST_P(QuicConnectionTest, LimitMaxPacketSizeByWriterForNewConnection) {}

TEST_P(QuicConnectionTest, PacketsInOrder) {}

TEST_P(QuicConnectionTest, PacketsOutOfOrder) {}

TEST_P(QuicConnectionTest, DuplicatePacket) {}

TEST_P(QuicConnectionTest, PacketsOutOfOrderWithAdditionsAndLeastAwaiting) {}

TEST_P(QuicConnectionTest, RejectUnencryptedStreamData) {}

TEST_P(QuicConnectionTest, OutOfOrderReceiptCausesAckSend) {}

TEST_P(QuicConnectionTest, OutOfOrderAckReceiptCausesNoAck) {}

TEST_P(QuicConnectionTest, AckReceiptCausesAckSend) {}

TEST_P(QuicConnectionTest, AckFrequencyUpdatedFromAckFrequencyFrame) {}

TEST_P(QuicConnectionTest, AckDecimationReducesAcks) {}

TEST_P(QuicConnectionTest, AckNeedsRetransmittableFrames) {}

TEST_P(QuicConnectionTest, AckNeedsRetransmittableFramesAfterPto) {}

TEST_P(QuicConnectionTest, TooManySentPackets) {}

TEST_P(QuicConnectionTest, LargestObservedLower) {}

TEST_P(QuicConnectionTest, AckUnsentData) {}

TEST_P(QuicConnectionTest, BasicSending) {}

// QuicConnection should record the packet sent-time prior to sending the
// packet.
TEST_P(QuicConnectionTest, RecordSentTimeBeforePacketSent) {}

TEST_P(QuicConnectionTest, ConnectionStatsRetransmission_WithRetransmissions) {}

TEST_P(QuicConnectionTest, ConnectionStatsRetransmission_WithMixedFrames) {}

TEST_P(QuicConnectionTest, ConnectionStatsRetransmission_NoRetransmission) {}

TEST_P(QuicConnectionTest, FramePacking) {}

TEST_P(QuicConnectionTest, FramePackingNonCryptoThenCrypto) {}

TEST_P(QuicConnectionTest, FramePackingCryptoThenNonCrypto) {}

TEST_P(QuicConnectionTest, FramePackingAckResponse) {}

TEST_P(QuicConnectionTest, FramePackingSendv) {}

TEST_P(QuicConnectionTest, FramePackingSendvQueued) {}

TEST_P(QuicConnectionTest, SendingZeroBytes) {}

TEST_P(QuicConnectionTest, LargeSendWithPendingAck) {}

TEST_P(QuicConnectionTest, OnCanWrite) {}

TEST_P(QuicConnectionTest, RetransmitOnNack) {}

TEST_P(QuicConnectionTest, DoNotSendQueuedPacketForResetStream) {}

TEST_P(QuicConnectionTest, SendQueuedPacketForQuicRstStreamNoError) {}

TEST_P(QuicConnectionTest, DoNotRetransmitForResetStreamOnNack) {}

TEST_P(QuicConnectionTest, RetransmitForQuicRstStreamNoErrorOnNack) {}

TEST_P(QuicConnectionTest, DoNotRetransmitForResetStreamOnRTO) {}

// Ensure that if the only data in flight is non-retransmittable, the
// retransmission alarm is not set.
TEST_P(QuicConnectionTest, CancelRetransmissionAlarmAfterResetStream) {}

TEST_P(QuicConnectionTest, RetransmitForQuicRstStreamNoErrorOnPTO) {}

TEST_P(QuicConnectionTest, DoNotSendPendingRetransmissionForResetStream) {}

TEST_P(QuicConnectionTest, SendPendingRetransmissionForQuicRstStreamNoError) {}

TEST_P(QuicConnectionTest, RetransmitAckedPacket) {}

TEST_P(QuicConnectionTest, RetransmitNackedLargestObserved) {}

TEST_P(QuicConnectionTest, WriteBlockedBufferedThenSent) {}

TEST_P(QuicConnectionTest, WriteBlockedThenSent) {}

TEST_P(QuicConnectionTest, RetransmitWriteBlockedAckedOriginalThenSent) {}

TEST_P(QuicConnectionTest, AlarmsWhenWriteBlocked) {}

TEST_P(QuicConnectionTest, NoSendAlarmAfterProcessPacketWhenWriteBlocked) {}

TEST_P(QuicConnectionTest, SendAlarmNonZeroDelay) {}

TEST_P(QuicConnectionTest, AddToWriteBlockedListIfWriterBlockedWhenProcessing) {}

TEST_P(QuicConnectionTest, DoNotAddToWriteBlockedListAfterDisconnect) {}

TEST_P(QuicConnectionTest, AddToWriteBlockedListIfBlockedOnFlushPackets) {}

TEST_P(QuicConnectionTest, NoLimitPacketsPerNack) {}

// Test sending multiple acks from the connection to the session.
TEST_P(QuicConnectionTest, MultipleAcks) {}

TEST_P(QuicConnectionTest, DontLatchUnackedPacket) {}

TEST_P(QuicConnectionTest, SendHandshakeMessages) {}

TEST_P(QuicConnectionTest, DropRetransmitsForInitialPacketAfterForwardSecure) {}

TEST_P(QuicConnectionTest, RetransmitPacketsWithInitialEncryption) {}

TEST_P(QuicConnectionTest, BufferNonDecryptablePackets) {}

TEST_P(QuicConnectionTest, Buffer100NonDecryptablePacketsThenKeyChange) {}

TEST_P(QuicConnectionTest, SetRTOAfterWritingToSocket) {}

TEST_P(QuicConnectionTest, TestQueued) {}

TEST_P(QuicConnectionTest, InitialTimeout) {}

TEST_P(QuicConnectionTest, IdleTimeoutAfterFirstSentPacket) {}

TEST_P(QuicConnectionTest, IdleTimeoutAfterSendTwoPackets) {}

TEST_P(QuicConnectionTest, HandshakeTimeout) {}

TEST_P(QuicConnectionTest, PingAfterSend) {}

TEST_P(QuicConnectionTest, ReducedPingTimeout) {}

// Tests whether sending an MTU discovery packet to peer successfully causes the
// maximum packet size to increase.
TEST_P(QuicConnectionTest, SendMtuDiscoveryPacket) {}

// Verifies that when a MTU probe packet is sent and buffered in a batch writer,
// the writer is flushed immediately.
TEST_P(QuicConnectionTest, BatchWriterFlushedAfterMtuDiscoveryPacket) {}

// Tests whether MTU discovery does not happen when it is not explicitly enabled
// by the connection options.
TEST_P(QuicConnectionTest, MtuDiscoveryDisabled) {}

// Tests whether MTU discovery works when all probes are acknowledged on the
// first try.
TEST_P(QuicConnectionTest, MtuDiscoveryEnabled) {}

// After a successful MTU probe, one and only one write error should be ignored
// if it happened in QuicConnection::FlushPacket.
TEST_P(QuicConnectionTest,
       MtuDiscoveryIgnoreOneWriteErrorInFlushAfterSuccessfulProbes) {}

// Simulate the case where the first attempt to send a probe is write blocked,
// and after unblock, the second attempt returns a MSG_TOO_BIG error.
TEST_P(QuicConnectionTest, MtuDiscoveryWriteBlocked) {}

// Tests whether MTU discovery works correctly when the probes never get
// acknowledged.
TEST_P(QuicConnectionTest, MtuDiscoveryFailed) {}

// Probe 3 times, the first one succeeds, then fails, then succeeds again.
TEST_P(QuicConnectionTest, MtuDiscoverySecondProbeFailed) {}

// Tests whether MTU discovery works when the writer has a limit on how large a
// packet can be.
TEST_P(QuicConnectionTest, MtuDiscoveryWriterLimited) {}

// Tests whether MTU discovery works when the writer returns an error despite
// advertising higher packet length.
TEST_P(QuicConnectionTest, MtuDiscoveryWriterFailed) {}

TEST_P(QuicConnectionTest, NoMtuDiscoveryAfterConnectionClosed) {}

TEST_P(QuicConnectionTest, TimeoutAfterSendDuringHandshake) {}

TEST_P(QuicConnectionTest, TimeoutAfterSendAfterHandshake) {}

TEST_P(QuicConnectionTest, TimeoutAfterSendSilentCloseWithOpenStreams) {}

TEST_P(QuicConnectionTest, TimeoutAfterReceive) {}

TEST_P(QuicConnectionTest, TimeoutAfterReceiveNotSendWhenUnacked) {}

TEST_P(QuicConnectionTest, SendScheduler) {}

TEST_P(QuicConnectionTest, FailToSendFirstPacket) {}

TEST_P(QuicConnectionTest, SendSchedulerEAGAIN) {}

TEST_P(QuicConnectionTest, TestQueueLimitsOnSendStreamData) {}

TEST_P(QuicConnectionTest, SendingThreePackets) {}

TEST_P(QuicConnectionTest, LoopThroughSendingPacketsWithTruncation) {}

TEST_P(QuicConnectionTest, SendDelayedAck) {}

TEST_P(QuicConnectionTest, SendDelayedAckDecimation) {}

TEST_P(QuicConnectionTest, SendDelayedAckDecimationUnlimitedAggregation) {}

TEST_P(QuicConnectionTest, SendDelayedAckDecimationEighthRtt) {}

TEST_P(QuicConnectionTest, SendDelayedAckOnHandshakeConfirmed) {}

TEST_P(QuicConnectionTest, SendDelayedAckOnSecondPacket) {}

TEST_P(QuicConnectionTest, NoAckOnOldNacks) {}

TEST_P(QuicConnectionTest, SendDelayedAckOnOutgoingPacket) {}

TEST_P(QuicConnectionTest, SendDelayedAckOnOutgoingCryptoPacket) {}

TEST_P(QuicConnectionTest, BlockAndBufferOnFirstCHLOPacketOfTwo) {}

TEST_P(QuicConnectionTest, BundleAckForSecondCHLO) {}

TEST_P(QuicConnectionTest, BundleAckForSecondCHLOTwoPacketReject) {}

TEST_P(QuicConnectionTest, BundleAckWithDataOnIncomingAck) {}

TEST_P(QuicConnectionTest, NoAckSentForClose) {}

TEST_P(QuicConnectionTest, SendWhenDisconnected) {}

TEST_P(QuicConnectionTest, SendConnectivityProbingWhenDisconnected) {}

TEST_P(QuicConnectionTest, WriteBlockedAfterClientSendsConnectivityProbe) {}

TEST_P(QuicConnectionTest, WriterBlockedAfterServerSendsConnectivityProbe) {}

TEST_P(QuicConnectionTest, WriterErrorWhenClientSendsConnectivityProbe) {}

TEST_P(QuicConnectionTest, WriterErrorWhenServerSendsConnectivityProbe) {}

TEST_P(QuicConnectionTest, IetfStatelessReset) {}

TEST_P(QuicConnectionTest, GoAway) {}

TEST_P(QuicConnectionTest, WindowUpdate) {}

TEST_P(QuicConnectionTest, Blocked) {}

TEST_P(QuicConnectionTest, ZeroBytePacket) {}

TEST_P(QuicConnectionTest, ClientHandlesVersionNegotiation) {}

TEST_P(QuicConnectionTest, ClientHandlesVersionNegotiationWithConnectionClose) {}

TEST_P(QuicConnectionTest, BadVersionNegotiation) {}

TEST_P(QuicConnectionTest, ProcessFramesIfPacketClosedConnection) {}

TEST_P(QuicConnectionTest, SelectMutualVersion) {}

TEST_P(QuicConnectionTest, ConnectionCloseWhenWritable) {}

TEST_P(QuicConnectionTest, ConnectionCloseGettingWriteBlocked) {}

TEST_P(QuicConnectionTest, ConnectionCloseWhenWriteBlocked) {}

TEST_P(QuicConnectionTest, OnPacketSentDebugVisitor) {}

TEST_P(QuicConnectionTest, OnPacketHeaderDebugVisitor) {}

TEST_P(QuicConnectionTest, Pacing) {}

TEST_P(QuicConnectionTest, WindowUpdateInstigateAcks) {}

TEST_P(QuicConnectionTest, BlockedFrameInstigateAcks) {}

TEST_P(QuicConnectionTest, ReevaluateTimeUntilSendOnAck) {}

TEST_P(QuicConnectionTest, SendAcksImmediately) {}

TEST_P(QuicConnectionTest, SendPingImmediately) {}

TEST_P(QuicConnectionTest, SendBlockedImmediately) {}

TEST_P(QuicConnectionTest, FailedToSendBlockedFrames) {}

TEST_P(QuicConnectionTest, SendingUnencryptedStreamDataFails) {}

TEST_P(QuicConnectionTest, SetRetransmissionAlarmForCryptoPacket) {}

// Includes regression test for b/69979024.
TEST_P(QuicConnectionTest, PathDegradingDetectionForNonCryptoPackets) {}

TEST_P(QuicConnectionTest, RetransmittableOnWireSetsPingAlarm) {}

TEST_P(QuicConnectionTest, ServerRetransmittableOnWire) {}

TEST_P(QuicConnectionTest, RetransmittableOnWireSendFirstPacket) {}

TEST_P(QuicConnectionTest, RetransmittableOnWireSendRandomBytes) {}

TEST_P(QuicConnectionTest,
       RetransmittableOnWireSendRandomBytesWithWriterBlocked) {}

// This test verifies that the connection marks path as degrading and does not
// spin timer to detect path degrading when a new packet is sent on the
// degraded path.
TEST_P(QuicConnectionTest, NoPathDegradingDetectionIfPathIsDegrading) {}

TEST_P(QuicConnectionTest, NoPathDegradingDetectionBeforeHandshakeConfirmed) {}

// This test verifies that the connection unmarks path as degrarding and spins
// the timer to detect future path degrading when forward progress is made
// after path has been marked degrading.
TEST_P(QuicConnectionTest, UnmarkPathDegradingOnForwardProgress) {}

TEST_P(QuicConnectionTest, NoPathDegradingOnServer) {}

TEST_P(QuicConnectionTest, NoPathDegradingAfterSendingAck) {}

TEST_P(QuicConnectionTest, MultipleCallsToCloseConnection) {}

TEST_P(QuicConnectionTest, ServerReceivesChloOnNonCryptoStream) {}

TEST_P(QuicConnectionTest, ClientReceivesRejOnNonCryptoStream) {}

TEST_P(QuicConnectionTest, CloseConnectionOnPacketTooLarge) {}

TEST_P(QuicConnectionTest, AlwaysGetPacketTooLarge) {}

TEST_P(QuicConnectionTest, CloseConnectionOnQueuedWriteError) {}

// Verify that if connection has no outstanding data, it notifies the send
// algorithm after the write.
TEST_P(QuicConnectionTest, SendDataAndBecomeApplicationLimited) {}

// Verify that the connection does not become app-limited if there is
// outstanding data to send after the write.
TEST_P(QuicConnectionTest, NotBecomeApplicationLimitedIfMoreDataAvailable) {}

// Verify that the connection does not become app-limited after blocked write
// even if there is outstanding data to send after the write.
TEST_P(QuicConnectionTest, NotBecomeApplicationLimitedDueToWriteBlock) {}

TEST_P(QuicConnectionTest, DoNotForceSendingAckOnPacketTooLarge) {}

TEST_P(QuicConnectionTest, CloseConnectionAllLevels) {}

TEST_P(QuicConnectionTest, CloseConnectionOneLevel) {}

TEST_P(QuicConnectionTest, DoNotPadServerInitialConnectionClose) {}

// Regression test for b/63620844.
TEST_P(QuicConnectionTest, FailedToWriteHandshakePacket) {}

TEST_P(QuicConnectionTest, MaxPacingRate) {}

TEST_P(QuicConnectionTest, ClientAlwaysSendConnectionId) {}

TEST_P(QuicConnectionTest, PingAfterLastRetransmittablePacketAcked) {}

TEST_P(QuicConnectionTest, NoPingIfRetransmittablePacketSent) {}

// When there is no stream data received but are open streams, send the
// first few consecutive pings with aggressive retransmittable-on-wire
// timeout. Exponentially back off the retransmittable-on-wire ping timeout
// afterwards until it exceeds the default ping timeout.
TEST_P(QuicConnectionTest, BackOffRetransmittableOnWireTimeout) {}

// This test verify that the count of consecutive aggressive pings is reset
// when new data is received. And it also verifies the connection resets
// the exponential back-off of the retransmittable-on-wire ping timeout
// after receiving new stream data.
TEST_P(QuicConnectionTest, ResetBackOffRetransmitableOnWireTimeout) {}

// Make sure that we never send more retransmissible on the wire pings than
// the limit in FLAGS_quic_max_retransmittable_on_wire_ping_count.
TEST_P(QuicConnectionTest, RetransmittableOnWirePingLimit) {}

TEST_P(QuicConnectionTest, ValidStatelessResetToken) {}

TEST_P(QuicConnectionTest, WriteBlockedWithInvalidAck) {}

TEST_P(QuicConnectionTest, SendMessage) {}

TEST_P(QuicConnectionTest, GetCurrentLargestMessagePayload) {}

TEST_P(QuicConnectionTest, GetGuaranteedLargestMessagePayload) {}

TEST_P(QuicConnectionTest, LimitedLargestMessagePayload) {}

// Test to check that the path challenge/path response logic works
// correctly. This test is only for version-99
TEST_P(QuicConnectionTest, ServerResponseToPathChallenge) {}

TEST_P(QuicConnectionTest, ClientResponseToPathChallengeOnDefaulSocket) {}

TEST_P(QuicConnectionTest, ClientResponseToPathChallengeOnAlternativeSocket) {}

TEST_P(QuicConnectionTest,
       RestartPathDegradingDetectionAfterMigrationWithProbe) {}

TEST_P(QuicConnectionTest, ClientsResetCwndAfterConnectionMigration) {}

// Regression test for b/110259444
TEST_P(QuicConnectionTest, DoNotScheduleSpuriousAckAlarm) {}

TEST_P(QuicConnectionTest, DisablePacingOffloadConnectionOptions) {}

// Regression test for b/110259444
// Get a path response without having issued a path challenge...
TEST_P(QuicConnectionTest, OrphanPathResponse) {}

TEST_P(QuicConnectionTest, AcceptPacketNumberZero) {}

TEST_P(QuicConnectionTest, MultiplePacketNumberSpacesBasicSending) {}

TEST_P(QuicConnectionTest, PeerAcksPacketsInWrongPacketNumberSpace) {}

TEST_P(QuicConnectionTest, MultiplePacketNumberSpacesBasicReceiving) {}

TEST_P(QuicConnectionTest, CancelAckAlarmOnWriteBlocked) {}

// Make sure a packet received with the right client connection ID is processed.
TEST_P(QuicConnectionTest, ValidClientConnectionId) {}

// Make sure a packet received with a different client connection ID is dropped.
TEST_P(QuicConnectionTest, InvalidClientConnectionId) {}

// Make sure the first packet received with a different client connection ID on
// the server is processed and it changes the client connection ID.
TEST_P(QuicConnectionTest, UpdateClientConnectionIdFromFirstPacket) {}
void QuicConnectionTest::TestReplaceConnectionIdFromInitial() {}

TEST_P(QuicConnectionTest, ReplaceServerConnectionIdFromInitial) {}

TEST_P(QuicConnectionTest, ReplaceServerConnectionIdFromRetryAndInitial) {}

// Regression test for b/134416344.
TEST_P(QuicConnectionTest, CheckConnectedBeforeFlush) {}

// Verify that a packet containing three coalesced packets is parsed correctly.
TEST_P(QuicConnectionTest, CoalescedPacket) {}

// Regression test for crbug.com/992831.
TEST_P(QuicConnectionTest, CoalescedPacketThatSavesFrames) {}

// Regresstion test for b/138962304.
TEST_P(QuicConnectionTest, RtoAndWriteBlocked) {}

// Regresstion test for b/138962304.
TEST_P(QuicConnectionTest, PtoAndWriteBlocked) {}

TEST_P(QuicConnectionTest, ProbeTimeout) {}

TEST_P(QuicConnectionTest, CloseConnectionAfter6ClientPTOs) {}

TEST_P(QuicConnectionTest, CloseConnectionAfter7ClientPTOs) {}

TEST_P(QuicConnectionTest, CloseConnectionAfter8ClientPTOs) {}

TEST_P(QuicConnectionTest, DeprecateHandshakeMode) {}

TEST_P(QuicConnectionTest, AntiAmplificationLimit) {}

TEST_P(QuicConnectionTest, 3AntiAmplificationLimit) {}

TEST_P(QuicConnectionTest, 10AntiAmplificationLimit) {}

TEST_P(QuicConnectionTest, AckPendingWithAmplificationLimited) {}

TEST_P(QuicConnectionTest, ConnectionCloseFrameType) {}

TEST_P(QuicConnectionTest, PtoSkipsPacketNumber) {}

TEST_P(QuicConnectionTest, SendCoalescedPackets) {}

TEST_P(QuicConnectionTest, FailToCoalescePacket) {}

TEST_P(QuicConnectionTest, ClientReceivedHandshakeDone) {}

TEST_P(QuicConnectionTest, ServerReceivedHandshakeDone) {}

TEST_P(QuicConnectionTest, MultiplePacketNumberSpacePto) {}

void QuicConnectionTest::TestClientRetryHandling(
    bool invalid_retry_tag, bool missing_original_id_in_config,
    bool wrong_original_id_in_config, bool missing_retry_id_in_config,
    bool wrong_retry_id_in_config) {}

TEST_P(QuicConnectionTest, ClientParsesRetry) {}

TEST_P(QuicConnectionTest, ClientParsesRetryInvalidTag) {}

TEST_P(QuicConnectionTest, ClientParsesRetryMissingOriginalId) {}

TEST_P(QuicConnectionTest, ClientParsesRetryWrongOriginalId) {}

TEST_P(QuicConnectionTest, ClientParsesRetryMissingRetryId) {}

TEST_P(QuicConnectionTest, ClientParsesRetryWrongRetryId) {}

TEST_P(QuicConnectionTest, ClientRetransmitsInitialPacketsOnRetry) {}

TEST_P(QuicConnectionTest, NoInitialPacketsRetransmissionOnInvalidRetry) {}

TEST_P(QuicConnectionTest, ClientReceivesOriginalConnectionIdWithoutRetry) {}

TEST_P(QuicConnectionTest, ClientReceivesRetrySourceConnectionIdWithoutRetry) {}

// Regression test for http://crbug/1047977
TEST_P(QuicConnectionTest, MaxStreamsFrameCausesConnectionClose) {}

TEST_P(QuicConnectionTest, StreamsBlockedFrameCausesConnectionClose) {}

TEST_P(QuicConnectionTest,
       BundleAckWithConnectionCloseMultiplePacketNumberSpace) {}

// Regression test for b/151220135.
TEST_P(QuicConnectionTest, SendPingWhenSkipPacketNumberForPto) {}

// Regression test for b/155757133
TEST_P(QuicConnectionTest, DonotChangeQueuedAcks) {}

TEST_P(QuicConnectionTest, DoNotExtendIdleTimeOnUndecryptablePackets) {}

TEST_P(QuicConnectionTest, BundleAckWithImmediateResponse) {}

TEST_P(QuicConnectionTest, AckAlarmFiresEarly) {}

TEST_P(QuicConnectionTest, ClientOnlyBlackholeDetectionClient) {}

TEST_P(QuicConnectionTest, ClientOnlyBlackholeDetectionServer) {}

// Regresstion test for b/158491591.
TEST_P(QuicConnectionTest, MadeForwardProgressOnDiscardingKeys) {}

TEST_P(QuicConnectionTest, ProcessUndecryptablePacketsBasedOnEncryptionLevel) {}

TEST_P(QuicConnectionTest, ServerBundlesInitialDataWithInitialAck) {}

TEST_P(QuicConnectionTest, ClientBundlesHandshakeDataWithHandshakeAck) {}

// Regresstion test for b/156232673.
TEST_P(QuicConnectionTest, CoalescePacketOfLowerEncryptionLevel) {}

// Regression test for b/160790422.
TEST_P(QuicConnectionTest, ServerRetransmitsHandshakeDataEarly) {}

// Regression test for b/161228202
TEST_P(QuicConnectionTest, InflatedRttSample) {}

// Regression test for b/161228202
TEST_P(QuicConnectionTest, CoalescingPacketCausesInfiniteLoop) {}

TEST_P(QuicConnectionTest, ClientAckDelayForAsyncPacketProcessing) {}

TEST_P(QuicConnectionTest, TestingLiveness) {}

TEST_P(QuicConnectionTest, DisableLivenessTesting) {}

TEST_P(QuicConnectionTest, SilentIdleTimeout) {}

TEST_P(QuicConnectionTest, DoNotSendPing) {}

// Regression test for b/159698337
TEST_P(QuicConnectionTest, DuplicateAckCausesLostPackets) {}

TEST_P(QuicConnectionTest, ShorterIdleTimeoutOnSentPackets) {}

// Regression test for b/166255274
TEST_P(QuicConnectionTest,
       ReserializeInitialPacketInCoalescerAfterDiscardingInitialKey) {}

TEST_P(QuicConnectionTest, PathValidationOnNewSocketSuccess) {}

TEST_P(QuicConnectionTest, PathValidationOnNewSocketWriteBlocked) {}

TEST_P(QuicConnectionTest, NewPathValidationCancelsPreviousOne) {}

// Regression test for b/182571515.
TEST_P(QuicConnectionTest, PathValidationRetry) {}

TEST_P(QuicConnectionTest, PathValidationReceivesStatelessReset) {}

// Tests that PATH_CHALLENGE is dropped if it is sent via a blocked alternative
// writer.
TEST_P(QuicConnectionTest, SendPathChallengeUsingBlockedNewSocket) {}

//  Tests that PATH_CHALLENGE is dropped if it is sent via the default writer
//  and the writer is blocked.
TEST_P(QuicConnectionTest, SendPathChallengeUsingBlockedDefaultSocket) {}

// Tests that write error on the alternate socket should be ignored.
TEST_P(QuicConnectionTest, SendPathChallengeFailOnNewSocket) {}

// Tests that write error while sending PATH_CHALLANGE from the default socket
// should close the connection.
TEST_P(QuicConnectionTest, SendPathChallengeFailOnDefaultPath) {}

TEST_P(QuicConnectionTest, SendPathChallengeFailOnAlternativePeerAddress) {}

TEST_P(QuicConnectionTest,
       SendPathChallengeFailPacketTooBigOnAlternativePeerAddress) {}

// Check that if there are two PATH_CHALLENGE frames in the packet, the latter
// one is ignored.
TEST_P(QuicConnectionTest, ReceiveMultiplePathChallenge) {}

TEST_P(QuicConnectionTest, ReceiveStreamFrameBeforePathChallenge) {}

TEST_P(QuicConnectionTest, ReceiveStreamFrameFollowingPathChallenge) {}

// Tests that a PATH_CHALLENGE is received in between other frames in an out of
// order packet.
TEST_P(QuicConnectionTest, PathChallengeWithDataInOutOfOrderPacket) {}

// Tests that a PATH_CHALLENGE is cached if its PATH_RESPONSE can't be sent.
TEST_P(QuicConnectionTest, FailToWritePathResponseAtServer) {}

// Regression test for b/168101557.
TEST_P(QuicConnectionTest, HandshakeDataDoesNotGetPtoed) {}

// Regression test for b/168294218.
TEST_P(QuicConnectionTest, CoalescerHandlesInitialKeyDiscard) {}

// Regresstion test for b/168294218
TEST_P(QuicConnectionTest, ZeroRttRejectionAndMissingInitialKeys) {}

TEST_P(QuicConnectionTest, OnZeroRttPacketAcked) {}

TEST_P(QuicConnectionTest, InitiateKeyUpdate) {}

TEST_P(QuicConnectionTest, InitiateKeyUpdateApproachingConfidentialityLimit) {}

TEST_P(QuicConnectionTest,
       CloseConnectionOnConfidentialityLimitKeyUpdateNotAllowed) {}

TEST_P(QuicConnectionTest, CloseConnectionOnIntegrityLimitDuringHandshake) {}

TEST_P(QuicConnectionTest, CloseConnectionOnIntegrityLimitAfterHandshake) {}

TEST_P(QuicConnectionTest,
       CloseConnectionOnIntegrityLimitAcrossEncryptionLevels) {}

TEST_P(QuicConnectionTest, IntegrityLimitDoesNotApplyWithoutDecryptionKey) {}

TEST_P(QuicConnectionTest, CloseConnectionOnIntegrityLimitAcrossKeyPhases) {}

TEST_P(QuicConnectionTest, SendAckFrequencyFrame) {}

TEST_P(QuicConnectionTest, SendAckFrequencyFrameUponHandshakeCompletion) {}

TEST_P(QuicConnectionTest, FastRecoveryOfLostServerHello) {}

TEST_P(QuicConnectionTest, ServerHelloGetsReordered) {}

TEST_P(QuicConnectionTest, MigratePath) {}

TEST_P(QuicConnectionTest, MigrateToNewPathDuringProbing) {}

TEST_P(QuicConnectionTest, MultiPortConnection) {}

TEST_P(QuicConnectionTest, TooManyMultiPortPathCreations) {}

TEST_P(QuicConnectionTest, MultiPortPathReceivesStatelessReset) {}

// Test that if the client's active migration is disabled, multi-port will not
// be attempted.
TEST_P(QuicConnectionTest, MultiPortPathRespectsActiveMigrationConfig) {}

// Verify that when multi-port is enabled and path degrading is triggered, if
// the alt-path is not ready, nothing happens.
TEST_P(QuicConnectionTest, PathDegradingWhenAltPathIsNotReady) {}

// Verify that when multi-port is enabled and path degrading is triggered, if
// the alt-path is ready and not probing, it should be migrated.
TEST_P(QuicConnectionTest, PathDegradingWhenAltPathIsReadyAndNotProbing) {}

// Verify that when multi-port is enabled and path degrading is triggered, if
// the alt-path is probing, the probing should be cancelled and the path should
// be migrated.
TEST_P(QuicConnectionTest, PathDegradingWhenAltPathIsReadyAndProbing) {}

TEST_P(QuicConnectionTest, SingleAckInPacket) {}

TEST_P(QuicConnectionTest,
       ServerReceivedZeroRttPacketAfterOneRttPacketWithRetainedKey) {}

TEST_P(QuicConnectionTest, NewTokenFrameInstigateAcks) {}

TEST_P(QuicConnectionTest, ServerClosesConnectionOnNewTokenFrame) {}

TEST_P(QuicConnectionTest, OverrideRetryTokenWithRetryPacket) {}

TEST_P(QuicConnectionTest, DonotOverrideRetryTokenWithAddressToken) {}

TEST_P(QuicConnectionTest,
       ServerReceivedZeroRttWithHigherPacketNumberThanOneRtt) {}

// Regression test for b/177312785
TEST_P(QuicConnectionTest, PeerMigrateBeforeHandshakeConfirm) {}

// Regresstion test for b/175685916
TEST_P(QuicConnectionTest, TryToFlushAckWithAckQueued) {}

TEST_P(QuicConnectionTest, PathChallengeBeforePeerIpAddressChangeAtServer) {}

TEST_P(QuicConnectionTest,
       PathValidationSucceedsBeforePeerIpAddressChangeAtServer) {}

// Regression test of b/228645208.
TEST_P(QuicConnectionTest, NoNonProbingFrameOnAlternativePath) {}

TEST_P(QuicConnectionTest, DoNotIssueNewCidIfVisitorSaysNo) {}

TEST_P(QuicConnectionTest,
       ProbedOnAnotherPathAfterPeerIpAddressChangeAtServer) {}

TEST_P(QuicConnectionTest,
       PathValidationFailedOnClientDueToLackOfServerConnectionId) {}

TEST_P(QuicConnectionTest,
       PathValidationFailedOnClientDueToLackOfClientConnectionIdTheSecondTime) {}

TEST_P(QuicConnectionTest, ServerConnectionIdRetiredUponPathValidationFailure) {}

TEST_P(QuicConnectionTest,
       MigratePathDirectlyFailedDueToLackOfServerConnectionId) {}

TEST_P(QuicConnectionTest,
       MigratePathDirectlyFailedDueToLackOfClientConnectionIdTheSecondTime) {}

TEST_P(QuicConnectionTest,
       CloseConnectionAfterReceiveNewConnectionIdFromPeerUsingEmptyCID) {}

TEST_P(QuicConnectionTest, NewConnectionIdFrameResultsInError) {}

TEST_P(QuicConnectionTest,
       ClientRetirePeerIssuedConnectionIdTriggeredByNewConnectionIdFrame) {}

TEST_P(QuicConnectionTest,
       ServerRetirePeerIssuedConnectionIdTriggeredByNewConnectionIdFrame) {}

TEST_P(
    QuicConnectionTest,
    ReplacePeerIssuedConnectionIdOnBothPathsTriggeredByNewConnectionIdFrame) {}

TEST_P(QuicConnectionTest,
       CloseConnectionAfterReceiveRetireConnectionIdWhenNoCIDIssued) {}

TEST_P(QuicConnectionTest, RetireConnectionIdFrameResultsInError) {}

TEST_P(QuicConnectionTest,
       ServerRetireSelfIssuedConnectionIdWithoutSendingNewConnectionIdBefore) {}

TEST_P(QuicConnectionTest, ServerRetireSelfIssuedConnectionId) {}TEST_P(QuicConnectionTest, PatchMissingClientConnectionIdOntoAlternativePath) {}TEST_P(QuicConnectionTest, PatchMissingClientConnectionIdOntoDefaultPath) {}TEST_P(QuicConnectionTest, ShouldGeneratePacketBlockedByMissingConnectionId) {}TEST_P(QuicConnectionTest, LostDataThenGetAcknowledged) {}TEST_P(QuicConnectionTest, PtoSendStreamData) {}TEST_P(QuicConnectionTest, SendingZeroRttPacketsDoesNotPostponePTO) {}TEST_P(QuicConnectionTest, QueueingUndecryptablePacketsDoesntPostponePTO) {}TEST_P(QuicConnectionTest, QueueUndecryptableHandshakePackets) {}TEST_P(QuicConnectionTest, PingNotSentAt0RTTLevelWhenInitialAvailable) {}TEST_P(QuicConnectionTest, AckElicitingFrames) {}TEST_P(QuicConnectionTest, ReceivedChloAndAck) {}TEST_P(QuicConnectionTest, FailedToRetransmitShlo) {}TEST_P(QuicConnectionTest, FailedToConsumeCryptoData) {}TEST_P(QuicConnectionTest,
       RTTSampleDoesNotIncludeQueuingDelayWithPostponedAckProcessing) {}TEST_P(QuicConnectionTest, NoExtraPaddingInReserializedInitial) {}TEST_P(QuicConnectionTest, ReportedAckDelayIncludesQueuingDelay) {}TEST_P(QuicConnectionTest, CoalesceOneRTTPacketWithInitialAndHandshakePackets) {}TEST_P(QuicConnectionTest, SendMultipleConnectionCloses) {}TEST_P(QuicConnectionTest, EarliestSentTimeNotInitializedWhenPtoFires) {}TEST_P(QuicConnectionTest, CalculateNetworkBlackholeDelay) {}TEST_P(QuicConnectionTest, FixBytesAccountingForBufferedCoalescedPackets) {}TEST_P(QuicConnectionTest, StrictAntiAmplificationLimit) {}TEST_P(QuicConnectionTest, OriginalConnectionId) {}ACTION_P2(InstallKeys, conn, level) {}TEST_P(QuicConnectionTest, ServerConnectionIdChangeWithLateInitial) {}TEST_P(QuicConnectionTest, ServerConnectionIdChangeTwiceWithLateInitial) {}TEST_P(QuicConnectionTest, ClientValidatedServerPreferredAddress) {}TEST_P(QuicConnectionTest, ClientValidatedServerPreferredAddress2) {}TEST_P(QuicConnectionTest, ClientFailedToValidateServerPreferredAddress) {}TEST_P(QuicConnectionTest, OptimizedServerPreferredAddress) {}TEST_P(QuicConnectionTest, OptimizedServerPreferredAddress2) {}TEST_P(QuicConnectionTest, MaxDuplicatedPacketsSentToServerPreferredAddress) {}TEST_P(QuicConnectionTest, MultiPortCreationAfterServerMigration) {}TEST_P(QuicConnectionTest, ClientReceivePathChallengeAfterServerMigration) {}TEST_P(QuicConnectionTest, ClientProbesAfterServerMigration) {}TEST_P(QuicConnectionTest, EcnMarksCorrectlyRecorded) {}TEST_P(QuicConnectionTest, EcnMarksCoalescedPacket) {}TEST_P(QuicConnectionTest, EcnMarksUndecryptableCoalescedPacket) {}TEST_P(QuicConnectionTest, ReceivedPacketInfoDefaults) {}TEST_P(QuicConnectionTest, DetectMigrationToPreferredAddress) {}TEST_P(QuicConnectionTest,
       DetectSimutanuousServerAndClientAddressChangeWithProbe) {}TEST_P(QuicConnectionTest, EcnCodepointsRejected) {}TEST_P(QuicConnectionTest, EcnCodepointsAccepted) {}TEST_P(QuicConnectionTest, EcnCodepointsRejectedIfFlagIsFalse) {}TEST_P(QuicConnectionTest, EcnValidationDisabled) {}TEST_P(QuicConnectionTest, RtoDisablesEcnMarking) {}TEST_P(QuicConnectionTest, RtoDoesntDisableEcnMarkingIfEcnAcked) {}TEST_P(QuicConnectionTest, InvalidFeedbackCancelsEcn) {}TEST_P(QuicConnectionTest, StateMatchesSentEcn) {}TEST_P(QuicConnectionTest, CoalescedPacketSplitsEcn) {}TEST_P(QuicConnectionTest, BufferedPacketRetainsOldEcn) {}TEST_P(QuicConnectionTest, RejectEcnIfWriterDoesNotSupport) {}