#include "quiche/quic/tools/quic_simple_server_stream.h"
#include <list>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "absl/base/macros.h"
#include "absl/memory/memory.h"
#include "absl/strings/string_view.h"
#include "quiche/quic/core/crypto/null_encrypter.h"
#include "quiche/quic/core/http/http_encoder.h"
#include "quiche/quic/core/http/spdy_utils.h"
#include "quiche/quic/core/quic_alarm_factory.h"
#include "quiche/quic/core/quic_default_clock.h"
#include "quiche/quic/core/quic_error_codes.h"
#include "quiche/quic/core/quic_types.h"
#include "quiche/quic/core/quic_utils.h"
#include "quiche/quic/platform/api/quic_expect_bug.h"
#include "quiche/quic/platform/api/quic_flags.h"
#include "quiche/quic/platform/api/quic_socket_address.h"
#include "quiche/quic/platform/api/quic_test.h"
#include "quiche/quic/test_tools/crypto_test_utils.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_session_peer.h"
#include "quiche/quic/test_tools/quic_spdy_session_peer.h"
#include "quiche/quic/test_tools/quic_stream_peer.h"
#include "quiche/quic/test_tools/quic_test_utils.h"
#include "quiche/quic/test_tools/simulator/simulator.h"
#include "quiche/quic/tools/quic_backend_response.h"
#include "quiche/quic/tools/quic_memory_cache_backend.h"
#include "quiche/quic/tools/quic_simple_server_backend.h"
#include "quiche/quic/tools/quic_simple_server_session.h"
#include "quiche/common/simple_buffer_allocator.h"
_;
AnyNumber;
InSequence;
Invoke;
StrictMock;
namespace quic {
namespace test {
const size_t kFakeFrameLen = …;
const size_t kErrorLength = …;
const size_t kDataFrameHeaderLength = …;
class TestStream : public QuicSimpleServerStream { … };
namespace {
class MockQuicSimpleServerSession : public QuicSimpleServerSession { … };
class QuicSimpleServerStreamTest : public QuicTestWithParam<ParsedQuicVersion> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(QuicSimpleServerStreamTest, TestFraming) { … }
TEST_P(QuicSimpleServerStreamTest, TestFramingOnePacket) { … }
TEST_P(QuicSimpleServerStreamTest, SendQuicRstStreamNoErrorInStopReading) { … }
TEST_P(QuicSimpleServerStreamTest, TestFramingExtraData) { … }
TEST_P(QuicSimpleServerStreamTest, SendResponseWithIllegalResponseStatus) { … }
TEST_P(QuicSimpleServerStreamTest, SendResponseWithIllegalResponseStatus2) { … }
TEST_P(QuicSimpleServerStreamTest, SendResponseWithValidHeaders) { … }
TEST_P(QuicSimpleServerStreamTest, SendResponseWithEarlyHints) { … }
class AlarmTestDelegate : public QuicAlarm::DelegateWithoutContext { … };
TEST_P(QuicSimpleServerStreamTest, SendResponseWithDelay) { … }
TEST_P(QuicSimpleServerStreamTest, TestSendErrorResponse) { … }
TEST_P(QuicSimpleServerStreamTest, InvalidMultipleContentLength) { … }
TEST_P(QuicSimpleServerStreamTest, InvalidLeadingNullContentLength) { … }
TEST_P(QuicSimpleServerStreamTest, InvalidMultipleContentLengthII) { … }
TEST_P(QuicSimpleServerStreamTest,
DoNotSendQuicRstStreamNoErrorWithRstReceived) { … }
TEST_P(QuicSimpleServerStreamTest, InvalidHeadersWithFin) { … }
class TestQuicSimpleServerBackend : public QuicSimpleServerBackend { … };
ACTION_P(SendHeadersResponse, response_ptr) { … }
ACTION_P(SendStreamData, data, close_stream) { … }
ACTION_P(TerminateStream, error) { … }
TEST_P(QuicSimpleServerStreamTest, ConnectSendsIntermediateResponses) { … }
TEST_P(QuicSimpleServerStreamTest, ErrorOnUnhandledConnect) { … }
TEST_P(QuicSimpleServerStreamTest, ConnectWithInvalidHeader) { … }
TEST_P(QuicSimpleServerStreamTest, BackendCanTerminateStream) { … }
}
}
}