#include "quiche/http2/adapter/oghttp2_adapter.h"
#include <cstdint>
#include <limits>
#include <memory>
#include <string>
#include <vector>
#include "absl/strings/str_join.h"
#include "quiche/http2/adapter/http2_protocol.h"
#include "quiche/http2/adapter/http2_visitor_interface.h"
#include "quiche/http2/adapter/mock_http2_visitor.h"
#include "quiche/http2/adapter/oghttp2_util.h"
#include "quiche/http2/adapter/test_frame_sequence.h"
#include "quiche/http2/adapter/test_utils.h"
#include "quiche/common/http/http_header_block.h"
#include "quiche/common/platform/api/quiche_expect_bug.h"
#include "quiche/common/platform/api/quiche_test.h"
namespace http2 {
namespace adapter {
namespace test {
namespace {
ConnectionError;
SpdyFrameType;
_;
enum FrameType { … };
TEST(OgHttp2AdapterTest, IsServerSession) { … }
TEST(OgHttp2AdapterTest, ProcessBytes) { … }
TEST(OgHttp2AdapterTest, HeaderValuesWithObsTextAllowedByDefault) { … }
TEST(OgHttp2AdapterTest, HeaderValuesWithObsTextDisallowed) { … }
TEST(OgHttp2AdapterTest, RequestPathWithSpaceOrTab) { … }
TEST(OgHttp2AdapterTest, RequestPathWithSpaceOrTabNoPathValidation) { … }
TEST(OgHttp2AdapterTest, InitialSettingsNoExtendedConnect) { … }
TEST(OgHttp2AdapterTest, InitialSettings) { … }
TEST(OgHttp2AdapterTest, AutomaticSettingsAndPingAcks) { … }
TEST(OgHttp2AdapterTest, AutomaticPingAcksDisabled) { … }
TEST(OgHttp2AdapterTest, InvalidMaxFrameSizeSetting) { … }
TEST(OgHttp2AdapterTest, InvalidPushSetting) { … }
TEST(OgHttp2AdapterTest, InvalidConnectProtocolSetting) { … }
TEST(OgHttp2AdapterTest, ClientSetsRemoteMaxStreamOption) { … }
TEST(OgHttp2AdapterTest, ClientHandles100Headers) { … }
TEST(OgHttp2AdapterTest, QueuingWindowUpdateAffectsWindow) { … }
TEST(OgHttp2AdapterTest, AckOfSettingInitialWindowSizeAffectsWindow) { … }
TEST(OgHttp2AdapterTest, ClientRejects100HeadersWithFin) { … }
TEST(OgHttp2AdapterTest, ClientRejects100HeadersWithContent) { … }
TEST(OgHttp2AdapterTest, ClientRejects100HeadersWithContentLength) { … }
TEST(OgHttp2AdapterTest, ClientHandlesResponseWithContentLengthAndPadding) { … }
TEST(OgHttp2AdapterTest, ClientHandles204WithContent) { … }
TEST(OgHttp2AdapterTest, ClientHandles304WithContent) { … }
TEST(OgHttp2AdapterTest, ClientHandles304WithContentLength) { … }
TEST(OgHttp2AdapterTest, ClientHandlesTrailers) { … }
class OgHttp2AdapterDataTest : public quiche::test::QuicheTestWithParam<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(OgHttp2AdapterDataTest, ClientSendsTrailers) { … }
TEST(OgHttp2AdapterTest, ClientRstStreamWhileHandlingHeaders) { … }
TEST(OgHttp2AdapterTest, ClientConnectionErrorWhileHandlingHeaders) { … }
TEST(OgHttp2AdapterTest, ClientConnectionErrorWhileHandlingHeadersOnly) { … }
TEST(OgHttp2AdapterTest, ClientRejectsHeaders) { … }
TEST(OgHttp2AdapterTest, ClientHandlesSmallerHpackHeaderTableSetting) { … }
TEST(OgHttp2AdapterTest, ClientHandlesLargerHpackHeaderTableSetting) { … }
TEST(OgHttp2AdapterTest, ClientSendsHpackHeaderTableSetting) { … }
TEST(OgHttp2AdapterTest, DISABLED_ClientHandlesInvalidTrailers) { … }
TEST(OgHttp2AdapterTest, ClientStartsShutdown) { … }
TEST(OgHttp2AdapterTest, ClientReceivesGoAway) { … }
TEST(OgHttp2AdapterTest, ClientReceivesMultipleGoAways) { … }
TEST(OgHttp2AdapterTest, ClientReceivesMultipleGoAwaysWithIncreasingStreamId) { … }
TEST(OgHttp2AdapterTest, ClientReceivesGoAwayWithPendingStreams) { … }
TEST(OgHttp2AdapterTest, ClientFailsOnGoAway) { … }
TEST(OgHttp2AdapterTest, ClientRejects101Response) { … }
TEST_P(OgHttp2AdapterDataTest, ClientObeysMaxConcurrentStreams) { … }
TEST_P(OgHttp2AdapterDataTest, ClientReceivesInitialWindowSetting) { … }
TEST_P(OgHttp2AdapterDataTest,
ClientReceivesInitialWindowSettingAfterStreamStart) { … }
TEST(OgHttp2AdapterTest, InvalidInitialWindowSetting) { … }
TEST(OggHttp2AdapterClientTest, InitialWindowSettingCausesOverflow) { … }
TEST(OgHttp2AdapterTest, FailureSendingConnectionPreface) { … }
TEST(OgHttp2AdapterTest, MaxFrameSizeSettingNotAppliedBeforeAck) { … }
TEST(OgHttp2AdapterTest, MaxFrameSizeSettingAppliedAfterAck) { … }
TEST(OgHttp2AdapterTest, ClientForbidsPushPromise) { … }
TEST(OgHttp2AdapterTest, ClientForbidsPushStream) { … }
TEST(OgHttp2AdapterTest, ClientReceivesDataOnClosedStream) { … }
TEST_P(OgHttp2AdapterDataTest, ClientEncountersFlowControlBlock) { … }
TEST_P(OgHttp2AdapterDataTest, ClientSendsTrailersAfterFlowControlBlock) { … }
TEST(OgHttp2AdapterTest, ClientQueuesRequests) { … }
TEST(OgHttp2AdapterTest, ClientAcceptsHeadResponseWithContentLength) { … }
TEST(OgHttp2AdapterTest, GetSendWindowSize) { … }
TEST(OgHttp2AdapterTest, WindowUpdateZeroDelta) { … }
TEST(OgHttp2AdapterTest, WindowUpdateCausesWindowOverflow) { … }
TEST(OgHttp2AdapterTest, WindowUpdateRaisesFlowControlWindowLimit) { … }
TEST(OgHttp2AdapterTest, MarkDataConsumedForNonexistentStream) { … }
TEST(OgHttp2AdapterTest, TestSerialize) { … }
TEST(OgHttp2AdapterTest, TestPartialSerialize) { … }
TEST(OgHttp2AdapterTest, TestStreamInitialWindowSizeUpdates) { … }
TEST(OgHttp2AdapterTest, ConnectionErrorOnControlFrameSent) { … }
TEST_P(OgHttp2AdapterDataTest, ConnectionErrorOnDataFrameSent) { … }
TEST(OgHttp2AdapterTest, ClientSendsContinuation) { … }
TEST_P(OgHttp2AdapterDataTest, RepeatedHeaderNames) { … }
TEST_P(OgHttp2AdapterDataTest, ServerRespondsToRequestWithTrailers) { … }
TEST(OgHttp2AdapterTest, ServerReceivesMoreHeaderBytesThanConfigured) { … }
TEST(OgHttp2AdapterTest, ServerVisitorRejectsHeaders) { … }
TEST_P(OgHttp2AdapterDataTest, ServerSubmitsResponseWithDataSourceError) { … }
TEST(OgHttp2AdapterTest, CompleteRequestWithServerResponse) { … }
TEST(OgHttp2AdapterTest, IncompleteRequestWithServerResponse) { … }
TEST(OgHttp2AdapterTest, IncompleteRequestWithServerResponseRstStreamEnabled) { … }
TEST(OgHttp2AdapterTest, ServerHandlesMultipleContentLength) { … }
TEST_P(OgHttp2AdapterDataTest, ServerSendsInvalidTrailers) { … }
TEST(OgHttp2AdapterTest, ServerHandlesDataWithPadding) { … }
TEST(OgHttp2AdapterTest, ServerHandlesHostHeader) { … }
TEST(OgHttp2AdapterTest, ServerHandlesHostHeaderWithLaxValidation) { … }
TEST_P(OgHttp2AdapterDataTest, ServerSubmitsTrailersWhileDataDeferred) { … }
TEST_P(OgHttp2AdapterDataTest, ServerSubmitsTrailersWithFlowControlBlockage) { … }
TEST_P(OgHttp2AdapterDataTest, ServerSubmitsTrailersWithDataEndStream) { … }
TEST_P(OgHttp2AdapterDataTest,
ServerSubmitsTrailersWithDataEndStreamAndDeferral) { … }
TEST(OgHttp2AdapterTest, ClientDisobeysConnectionFlowControl) { … }
TEST(OgHttp2AdapterTest, ClientDisobeysConnectionFlowControlWithOneDataFrame) { … }
TEST(OgHttp2AdapterTest, ClientDisobeysConnectionFlowControlAcrossReads) { … }
TEST(OgHttp2AdapterTest, ClientDisobeysStreamFlowControl) { … }
TEST(OgHttp2AdapterTest, ServerErrorWhileHandlingHeaders) { … }
TEST(OgHttp2AdapterTest, ServerErrorWhileHandlingHeadersDropsFrames) { … }
TEST(OgHttp2AdapterTest, ServerConnectionErrorWhileHandlingHeaders) { … }
TEST(OgHttp2AdapterTest, ServerErrorAfterHandlingHeaders) { … }
TEST(OgHttp2AdapterTest, ServerRejectsFrameHeader) { … }
TEST(OgHttp2AdapterTest, ServerRejectsBeginningOfData) { … }
TEST(OgHttp2AdapterTest, ServerReceivesTooLargeHeader) { … }
TEST(OgHttp2AdapterTest, ServerReceivesInvalidAuthority) { … }
TEST(OgHttpAdapterTest, ServerReceivesGoAway) { … }
TEST_P(OgHttp2AdapterDataTest, ServerSubmitResponse) { … }
TEST_P(OgHttp2AdapterDataTest, ServerSubmitResponseWithResetFromClient) { … }
TEST(OgHttp2AdapterTest, ServerRejectsStreamData) { … }
OgHttp2AdapterInteractionDataTest;
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(OgHttp2AdapterInteractionDataTest, ClientServerInteractionTest) { … }
TEST(OgHttp2AdapterInteractionTest,
ClientServerInteractionRepeatedHeaderNames) { … }
TEST(OgHttp2AdapterInteractionTest, ClientServerInteractionWithCookies) { … }
TEST(OgHttp2AdapterTest, ServerForbidsNewStreamBelowWatermark) { … }
TEST(OgHttp2AdapterTest, ServerForbidsWindowUpdateOnIdleStream) { … }
TEST(OgHttp2AdapterTest, ServerForbidsDataOnIdleStream) { … }
TEST(OgHttp2AdapterTest, ServerForbidsRstStreamOnIdleStream) { … }
TEST(OgHttp2AdapterTest, ServerForbidsNewStreamAboveStreamLimit) { … }
TEST(OgHttp2AdapterTest, ServerRstStreamsNewStreamAboveStreamLimitBeforeAck) { … }
TEST(OgHttp2AdapterTest, ServerForbidsProtocolPseudoheaderBeforeAck) { … }
TEST(OgHttp2AdapterTest, ServerAllowsProtocolPseudoheaderAfterAck) { … }
TEST_P(OgHttp2AdapterDataTest, SkipsSendingFramesForRejectedStream) { … }
TEST(OgHttpAdapterServerTest, ServerStartsShutdown) { … }
TEST(OgHttp2AdapterTest, ServerStartsShutdownAfterGoaway) { … }
TEST(OgHttp2AdapterTest, ConnectionErrorWithBlackholingData) { … }
TEST(OgHttp2AdapterTest, ConnectionErrorWithoutBlackholingData) { … }
TEST_P(OgHttp2AdapterDataTest, ServerDoesNotSendFramesAfterImmediateGoAway) { … }
TEST(OgHttp2AdapterTest, ServerHandlesContentLength) { … }
TEST(OgHttp2AdapterTest, ServerHandlesContentLengthMismatch) { … }
TEST(OgHttp2AdapterTest, ServerHandlesAsteriskPathForOptions) { … }
TEST(OgHttp2AdapterTest, ServerHandlesInvalidPath) { … }
TEST(OgHttp2AdapterTest, ServerHandlesTeHeader) { … }
TEST(OgHttp2AdapterTest, ServerHandlesConnectionSpecificHeaders) { … }
TEST(OgHttp2AdapterTest, ServerUsesCustomWindowUpdateStrategy) { … }
TEST(OgHttp2AdapterTest, ServerConsumesDataWithPadding) { … }
TEST(OgHttp2AdapterTest, NoopHeaderValidatorTest) { … }
TEST_P(OgHttp2AdapterDataTest, NegativeFlowControlStreamResumption) { … }
TEST(OgHttp2AdapterTest, SetCookieRoundtrip) { … }
}
}
}
}