#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "net/spdy/spdy_stream.h"
#include <stdint.h>
#include <algorithm>
#include <cstddef>
#include <limits>
#include <memory>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include "base/functional/bind.h"
#include "base/memory/ref_counted.h"
#include "base/run_loop.h"
#include "base/time/time.h"
#include "net/base/request_priority.h"
#include "net/base/session_usage.h"
#include "net/dns/public/secure_dns_policy.h"
#include "net/http/http_request_info.h"
#include "net/log/net_log_event_type.h"
#include "net/log/test_net_log.h"
#include "net/log/test_net_log_util.h"
#include "net/socket/socket_tag.h"
#include "net/socket/socket_test_util.h"
#include "net/spdy/buffered_spdy_framer.h"
#include "net/spdy/spdy_http_utils.h"
#include "net/spdy/spdy_session.h"
#include "net/spdy/spdy_session_pool.h"
#include "net/spdy/spdy_stream_test_util.h"
#include "net/spdy/spdy_test_util_common.h"
#include "net/test/cert_test_util.h"
#include "net/test/gtest_util.h"
#include "net/test/test_data_directory.h"
#include "net/test/test_with_task_environment.h"
#include "net/third_party/quiche/src/quiche/common/http/http_header_block.h"
#include "net/third_party/quiche/src/quiche/spdy/core/spdy_protocol.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace net::test {
namespace {
const char kPostBody[] = …;
const size_t kPostBodyLength = …;
const std::string_view kPostBodyStringPiece(kPostBody, kPostBodyLength);
MockRead ReadFrameExceptForLastByte(const spdy::SpdySerializedFrame& frame) { … }
MockRead LastByteOfReadFrame(const spdy::SpdySerializedFrame& frame) { … }
}
class SpdyStreamTest : public ::testing::Test, public WithTaskEnvironment { … };
TEST_F(SpdyStreamTest, SendDataAfterOpen) { … }
TEST_F(SpdyStreamTest, BrokenConnectionDetectionSuccessfulRequest) { … }
class StreamDelegateWithTrailers : public test::StreamDelegateWithBody { … };
TEST_F(SpdyStreamTest, Trailers) { … }
TEST_F(SpdyStreamTest, StreamError) { … }
TEST_F(SpdyStreamTest, SendLargeDataAfterOpenRequestResponse) { … }
TEST_F(SpdyStreamTest, SendLargeDataAfterOpenBidirectional) { … }
TEST_F(SpdyStreamTest, UpperCaseHeaders) { … }
TEST_F(SpdyStreamTest, HeadersMustHaveStatus) { … }
TEST_F(SpdyStreamTest, TrailersMustNotFollowTrailers) { … }
TEST_F(SpdyStreamTest, DataMustNotFollowTrailers) { … }
class SpdyStreamTestWithMockClock : public SpdyStreamTest { … };
TEST_F(SpdyStreamTestWithMockClock, NonInformationalResponseStart) { … }
TEST_F(SpdyStreamTestWithMockClock, InformationalHeaders) { … }
TEST_F(SpdyStreamTestWithMockClock, EarlyHints) { … }
TEST_F(SpdyStreamTest, StatusMustBeNumber) { … }
TEST_F(SpdyStreamTest, StatusCannotHaveExtraText) { … }
TEST_F(SpdyStreamTest, StatusMustBePresent) { … }
TEST_F(SpdyStreamTest, IncreaseSendWindowSizeOverflow) { … }
void StallStream(const base::WeakPtr<SpdyStream>& stream) { … }
void IncreaseStreamSendWindowSize(const base::WeakPtr<SpdyStream>& stream,
int32_t delta_window_size) { … }
void AdjustStreamSendWindowSize(const base::WeakPtr<SpdyStream>& stream,
int32_t delta_window_size) { … }
void SpdyStreamTest::RunResumeAfterUnstallRequestResponseTest(
UnstallFunction unstall_function) { … }
TEST_F(SpdyStreamTest, ResumeAfterSendWindowSizeIncreaseRequestResponse) { … }
TEST_F(SpdyStreamTest, ResumeAfterSendWindowSizeAdjustRequestResponse) { … }
void SpdyStreamTest::RunResumeAfterUnstallBidirectionalTest(
UnstallFunction unstall_function) { … }
TEST_F(SpdyStreamTest, ResumeAfterSendWindowSizeIncreaseBidirectional) { … }
TEST_F(SpdyStreamTest, ResumeAfterSendWindowSizeAdjustBidirectional) { … }
TEST_F(SpdyStreamTest, ReceivedBytes) { … }
TEST_F(SpdyStreamTest, DataOnHalfClosedRemoveStream) { … }
TEST_F(SpdyStreamTest, DelegateIsInformedOfEOF) { … }
TEST_F(SpdyStreamTestWithMockClock, FlowControlSlowReads) { … }
}