#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "net/http/bidirectional_stream.h"
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "base/containers/span.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/time/time.h"
#include "base/timer/mock_timer.h"
#include "base/timer/timer.h"
#include "build/build_config.h"
#include "net/base/completion_once_callback.h"
#include "net/base/load_timing_info.h"
#include "net/base/load_timing_info_test_util.h"
#include "net/base/net_errors.h"
#include "net/base/session_usage.h"
#include "net/dns/public/secure_dns_policy.h"
#include "net/http/bidirectional_stream_request_info.h"
#include "net/http/http_network_session.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_server_properties.h"
#include "net/log/net_log.h"
#include "net/log/net_log_capture_mode.h"
#include "net/log/net_log_event_type.h"
#include "net/log/net_log_source_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/spdy_session.h"
#include "net/spdy/spdy_test_util_common.h"
#include "net/ssl/ssl_cert_request_info.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/url_request/url_request_test_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
IsError;
IsOk;
namespace net {
namespace {
const char kBodyData[] = …;
const size_t kBodyDataSize = …;
const std::string kBodyDataString(kBodyData, kBodyDataSize);
const size_t kReadBufferSize = …;
void ExpectLoadTimingValid(const LoadTimingInfo& load_timing_info) { … }
void TestLoadTimingReused(const LoadTimingInfo& load_timing_info) { … }
void TestLoadTimingNotReused(const LoadTimingInfo& load_timing_info) { … }
class TestDelegateBase : public BidirectionalStream::Delegate { … };
class DeleteStreamDelegate : public TestDelegateBase { … };
class MockTimer : public base::MockOneShotTimer { … };
}
class BidirectionalStreamTest : public TestWithTaskEnvironment { … };
TEST_F(BidirectionalStreamTest, CreateInsecureStream) { … }
TEST_F(BidirectionalStreamTest, SimplePostRequest) { … }
TEST_F(BidirectionalStreamTest, LoadTimingTwoRequests) { … }
TEST_F(BidirectionalStreamTest,
CreateInsecureStreamAndDestroyStreamRightAfter) { … }
TEST_F(BidirectionalStreamTest, ClientAuthRequestIgnored) { … }
TEST_F(BidirectionalStreamTest, TestReadDataAfterClose) { … }
TEST_F(BidirectionalStreamTest, TestNetLogContainEntries) { … }
TEST_F(BidirectionalStreamTest, TestInterleaveReadDataAndSendData) { … }
TEST_F(BidirectionalStreamTest, TestCoalesceSmallDataBuffers) { … }
TEST_F(BidirectionalStreamTest, TestCompleteAsyncRead) { … }
TEST_F(BidirectionalStreamTest, TestBuffering) { … }
TEST_F(BidirectionalStreamTest, TestBufferingWithTrailers) { … }
TEST_F(BidirectionalStreamTest, DeleteStreamAfterSendData) { … }
TEST_F(BidirectionalStreamTest, DeleteStreamDuringReadData) { … }
TEST_F(BidirectionalStreamTest, PropagateProtocolError) { … }
TEST_F(BidirectionalStreamTest, DeleteStreamDuringOnHeadersReceived) { … }
TEST_F(BidirectionalStreamTest, DeleteStreamDuringOnDataRead) { … }
TEST_F(BidirectionalStreamTest, DeleteStreamDuringOnTrailersReceived) { … }
TEST_F(BidirectionalStreamTest, DeleteStreamDuringOnFailed) { … }
TEST_F(BidirectionalStreamTest, TestHonorAlternativeServiceHeader) { … }
TEST_F(BidirectionalStreamTest, Tagging) { … }
}