#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;
}(),
443);
QuicStreamId GetNthClientInitiatedStreamId(int n,
QuicTransportVersion version) { … }
QuicLongHeaderType EncryptionlevelToLongHeaderType(EncryptionLevel level) { … }
class TaggingEncrypterWithConfidentialityLimit : public TaggingEncrypter { … };
class StrictTaggingDecrypterWithIntegrityLimit : public StrictTaggingDecrypter { … };
class TestConnectionHelper : public QuicConnectionHelperInterface { … };
class TestConnection : public QuicConnection { … };
enum class AckResponse { … };
struct TestParams { … };
std::string PrintToString(const TestParams& p) { … }
std::vector<TestParams> GetTestParams() { … }
class QuicConnectionTest : public QuicTestWithParam<TestParams> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(QuicConnectionTest, CloseErrorCodeTestTransport) { … }
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) { … }
TEST_P(QuicConnectionTest, ConnectionMigrationWithPendingPaddingBytes) { … }
TEST_P(QuicConnectionTest,
ReversePathValidationResponseReceivedFromUnexpectedPeerAddress) { … }
TEST_P(QuicConnectionTest, ReversePathValidationFailureAtServer) { … }
TEST_P(QuicConnectionTest, ReceivePathProbeWithNoAddressChangeAtServer) { … }
TEST_P(QuicConnectionTest, BufferedMtuPacketTooBig) { … }
TEST_P(QuicConnectionTest, WriteOutOfOrderQueuedPackets) { … }
TEST_P(QuicConnectionTest, DiscardQueuedPacketsAfterConnectionClose) { … }
class TestQuicPathValidationContext : public QuicPathValidationContext { … };
class TestValidationResultDelegate : public QuicPathValidator::ResultDelegate { … };
class ServerPreferredAddressTestResultDelegate
: public QuicPathValidator::ResultDelegate { … };
TEST_P(QuicConnectionTest, ReceivePathProbingFromNewPeerAddressAtServer) { … }
TEST_P(QuicConnectionTest, ReceivePathProbingToPreferredAddressAtServer) { … }
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) { … }
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) { … }
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_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) { … }
TEST_P(QuicConnectionTest, SendMtuDiscoveryPacket) { … }
TEST_P(QuicConnectionTest, BatchWriterFlushedAfterMtuDiscoveryPacket) { … }
TEST_P(QuicConnectionTest, MtuDiscoveryDisabled) { … }
TEST_P(QuicConnectionTest, MtuDiscoveryEnabled) { … }
TEST_P(QuicConnectionTest,
MtuDiscoveryIgnoreOneWriteErrorInFlushAfterSuccessfulProbes) { … }
TEST_P(QuicConnectionTest, MtuDiscoveryWriteBlocked) { … }
TEST_P(QuicConnectionTest, MtuDiscoveryFailed) { … }
TEST_P(QuicConnectionTest, MtuDiscoverySecondProbeFailed) { … }
TEST_P(QuicConnectionTest, MtuDiscoveryWriterLimited) { … }
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) { … }
TEST_P(QuicConnectionTest, PathDegradingDetectionForNonCryptoPackets) { … }
TEST_P(QuicConnectionTest, RetransmittableOnWireSetsPingAlarm) { … }
TEST_P(QuicConnectionTest, ServerRetransmittableOnWire) { … }
TEST_P(QuicConnectionTest, RetransmittableOnWireSendFirstPacket) { … }
TEST_P(QuicConnectionTest, RetransmittableOnWireSendRandomBytes) { … }
TEST_P(QuicConnectionTest,
RetransmittableOnWireSendRandomBytesWithWriterBlocked) { … }
TEST_P(QuicConnectionTest, NoPathDegradingDetectionIfPathIsDegrading) { … }
TEST_P(QuicConnectionTest, NoPathDegradingDetectionBeforeHandshakeConfirmed) { … }
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) { … }
TEST_P(QuicConnectionTest, SendDataAndBecomeApplicationLimited) { … }
TEST_P(QuicConnectionTest, NotBecomeApplicationLimitedIfMoreDataAvailable) { … }
TEST_P(QuicConnectionTest, NotBecomeApplicationLimitedDueToWriteBlock) { … }
TEST_P(QuicConnectionTest, DoNotForceSendingAckOnPacketTooLarge) { … }
TEST_P(QuicConnectionTest, CloseConnectionAllLevels) { … }
TEST_P(QuicConnectionTest, CloseConnectionOneLevel) { … }
TEST_P(QuicConnectionTest, DoNotPadServerInitialConnectionClose) { … }
TEST_P(QuicConnectionTest, FailedToWriteHandshakePacket) { … }
TEST_P(QuicConnectionTest, MaxPacingRate) { … }
TEST_P(QuicConnectionTest, ClientAlwaysSendConnectionId) { … }
TEST_P(QuicConnectionTest, PingAfterLastRetransmittablePacketAcked) { … }
TEST_P(QuicConnectionTest, NoPingIfRetransmittablePacketSent) { … }
TEST_P(QuicConnectionTest, BackOffRetransmittableOnWireTimeout) { … }
TEST_P(QuicConnectionTest, ResetBackOffRetransmitableOnWireTimeout) { … }
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_P(QuicConnectionTest, ServerResponseToPathChallenge) { … }
TEST_P(QuicConnectionTest, ClientResponseToPathChallengeOnDefaulSocket) { … }
TEST_P(QuicConnectionTest, ClientResponseToPathChallengeOnAlternativeSocket) { … }
TEST_P(QuicConnectionTest,
RestartPathDegradingDetectionAfterMigrationWithProbe) { … }
TEST_P(QuicConnectionTest, ClientsResetCwndAfterConnectionMigration) { … }
TEST_P(QuicConnectionTest, DoNotScheduleSpuriousAckAlarm) { … }
TEST_P(QuicConnectionTest, DisablePacingOffloadConnectionOptions) { … }
TEST_P(QuicConnectionTest, OrphanPathResponse) { … }
TEST_P(QuicConnectionTest, AcceptPacketNumberZero) { … }
TEST_P(QuicConnectionTest, MultiplePacketNumberSpacesBasicSending) { … }
TEST_P(QuicConnectionTest, PeerAcksPacketsInWrongPacketNumberSpace) { … }
TEST_P(QuicConnectionTest, MultiplePacketNumberSpacesBasicReceiving) { … }
TEST_P(QuicConnectionTest, CancelAckAlarmOnWriteBlocked) { … }
TEST_P(QuicConnectionTest, ValidClientConnectionId) { … }
TEST_P(QuicConnectionTest, InvalidClientConnectionId) { … }
TEST_P(QuicConnectionTest, UpdateClientConnectionIdFromFirstPacket) { … }
void QuicConnectionTest::TestReplaceConnectionIdFromInitial() { … }
TEST_P(QuicConnectionTest, ReplaceServerConnectionIdFromInitial) { … }
TEST_P(QuicConnectionTest, ReplaceServerConnectionIdFromRetryAndInitial) { … }
TEST_P(QuicConnectionTest, CheckConnectedBeforeFlush) { … }
TEST_P(QuicConnectionTest, CoalescedPacket) { … }
TEST_P(QuicConnectionTest, CoalescedPacketThatSavesFrames) { … }
TEST_P(QuicConnectionTest, RtoAndWriteBlocked) { … }
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) { … }
TEST_P(QuicConnectionTest, MaxStreamsFrameCausesConnectionClose) { … }
TEST_P(QuicConnectionTest, StreamsBlockedFrameCausesConnectionClose) { … }
TEST_P(QuicConnectionTest,
BundleAckWithConnectionCloseMultiplePacketNumberSpace) { … }
TEST_P(QuicConnectionTest, SendPingWhenSkipPacketNumberForPto) { … }
TEST_P(QuicConnectionTest, DonotChangeQueuedAcks) { … }
TEST_P(QuicConnectionTest, DoNotExtendIdleTimeOnUndecryptablePackets) { … }
TEST_P(QuicConnectionTest, BundleAckWithImmediateResponse) { … }
TEST_P(QuicConnectionTest, AckAlarmFiresEarly) { … }
TEST_P(QuicConnectionTest, ClientOnlyBlackholeDetectionClient) { … }
TEST_P(QuicConnectionTest, ClientOnlyBlackholeDetectionServer) { … }
TEST_P(QuicConnectionTest, MadeForwardProgressOnDiscardingKeys) { … }
TEST_P(QuicConnectionTest, ProcessUndecryptablePacketsBasedOnEncryptionLevel) { … }
TEST_P(QuicConnectionTest, ServerBundlesInitialDataWithInitialAck) { … }
TEST_P(QuicConnectionTest, ClientBundlesHandshakeDataWithHandshakeAck) { … }
TEST_P(QuicConnectionTest, CoalescePacketOfLowerEncryptionLevel) { … }
TEST_P(QuicConnectionTest, ServerRetransmitsHandshakeDataEarly) { … }
TEST_P(QuicConnectionTest, InflatedRttSample) { … }
TEST_P(QuicConnectionTest, CoalescingPacketCausesInfiniteLoop) { … }
TEST_P(QuicConnectionTest, ClientAckDelayForAsyncPacketProcessing) { … }
TEST_P(QuicConnectionTest, TestingLiveness) { … }
TEST_P(QuicConnectionTest, DisableLivenessTesting) { … }
TEST_P(QuicConnectionTest, SilentIdleTimeout) { … }
TEST_P(QuicConnectionTest, DoNotSendPing) { … }
TEST_P(QuicConnectionTest, DuplicateAckCausesLostPackets) { … }
TEST_P(QuicConnectionTest, ShorterIdleTimeoutOnSentPackets) { … }
TEST_P(QuicConnectionTest,
ReserializeInitialPacketInCoalescerAfterDiscardingInitialKey) { … }
TEST_P(QuicConnectionTest, PathValidationOnNewSocketSuccess) { … }
TEST_P(QuicConnectionTest, PathValidationOnNewSocketWriteBlocked) { … }
TEST_P(QuicConnectionTest, NewPathValidationCancelsPreviousOne) { … }
TEST_P(QuicConnectionTest, PathValidationRetry) { … }
TEST_P(QuicConnectionTest, PathValidationReceivesStatelessReset) { … }
TEST_P(QuicConnectionTest, SendPathChallengeUsingBlockedNewSocket) { … }
TEST_P(QuicConnectionTest, SendPathChallengeUsingBlockedDefaultSocket) { … }
TEST_P(QuicConnectionTest, SendPathChallengeFailOnNewSocket) { … }
TEST_P(QuicConnectionTest, SendPathChallengeFailOnDefaultPath) { … }
TEST_P(QuicConnectionTest, SendPathChallengeFailOnAlternativePeerAddress) { … }
TEST_P(QuicConnectionTest,
SendPathChallengeFailPacketTooBigOnAlternativePeerAddress) { … }
TEST_P(QuicConnectionTest, ReceiveMultiplePathChallenge) { … }
TEST_P(QuicConnectionTest, ReceiveStreamFrameBeforePathChallenge) { … }
TEST_P(QuicConnectionTest, ReceiveStreamFrameFollowingPathChallenge) { … }
TEST_P(QuicConnectionTest, PathChallengeWithDataInOutOfOrderPacket) { … }
TEST_P(QuicConnectionTest, FailToWritePathResponseAtServer) { … }
TEST_P(QuicConnectionTest, HandshakeDataDoesNotGetPtoed) { … }
TEST_P(QuicConnectionTest, CoalescerHandlesInitialKeyDiscard) { … }
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_P(QuicConnectionTest, MultiPortPathRespectsActiveMigrationConfig) { … }
TEST_P(QuicConnectionTest, PathDegradingWhenAltPathIsNotReady) { … }
TEST_P(QuicConnectionTest, PathDegradingWhenAltPathIsReadyAndNotProbing) { … }
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) { … }
TEST_P(QuicConnectionTest, PeerMigrateBeforeHandshakeConfirm) { … }
TEST_P(QuicConnectionTest, TryToFlushAckWithAckQueued) { … }
TEST_P(QuicConnectionTest, PathChallengeBeforePeerIpAddressChangeAtServer) { … }
TEST_P(QuicConnectionTest,
PathValidationSucceedsBeforePeerIpAddressChangeAtServer) { … }
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) { … }