#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "net/spdy/spdy_session_pool.h"
#include <cstddef>
#include <tuple>
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/trace_event/memory_allocator_dump.h"
#include "base/trace_event/process_memory_dump.h"
#include "build/build_config.h"
#include "net/base/proxy_string_util.h"
#include "net/base/session_usage.h"
#include "net/base/test_completion_callback.h"
#include "net/base/tracing.h"
#include "net/dns/host_cache.h"
#include "net/dns/public/host_resolver_results.h"
#include "net/dns/public/secure_dns_policy.h"
#include "net/http/http_network_session.h"
#include "net/log/net_log_with_source.h"
#include "net/log/test_net_log.h"
#include "net/socket/client_socket_handle.h"
#include "net/socket/socket_tag.h"
#include "net/socket/socket_test_util.h"
#include "net/socket/transport_client_socket_pool.h"
#include "net/spdy/spdy_session.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_certificate_data.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 "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
MemoryAllocatorDump;
IsError;
IsOk;
Contains;
Eq;
Contains;
ByRef;
namespace net {
class SpdySessionPoolTest : public TestWithTaskEnvironment { … };
class SpdySessionRequestDelegate
: public SpdySessionPool::SpdySessionRequest::Delegate { … };
bool TryCreateAliasedSpdySession(
SpdySessionPool* pool,
const SpdySessionKey& key,
const std::vector<HostResolverEndpointResult>& endpoints,
bool enable_ip_based_pooling = true,
bool is_websocket = false) { … }
bool TryCreateAliasedSpdySession(SpdySessionPool* pool,
const SpdySessionKey& key,
const std::string& ip_address_list,
bool enable_ip_based_pooling = true,
bool is_websocket = false) { … }
class SessionOpeningDelegate : public SpdyStream::Delegate { … };
TEST_F(SpdySessionPoolTest, CloseCurrentSessions) { … }
TEST_F(SpdySessionPoolTest, CloseCurrentIdleSessions) { … }
TEST_F(SpdySessionPoolTest, CloseAllSessions) { … }
class SpdySessionPoolOnIPAddressChangeTest : public SpdySessionPoolTest { … };
TEST_F(SpdySessionPoolOnIPAddressChangeTest, DoNotIgnoreIPAddressChanges) { … }
TEST_F(SpdySessionPoolOnIPAddressChangeTest, IgnoreIPAddressChanges) { … }
void SpdySessionPoolTest::RunIPPoolingTest(
SpdyPoolCloseSessionsType close_sessions_type) { … }
void SpdySessionPoolTest::RunIPPoolingDisabledTest(SSLSocketDataProvider* ssl) { … }
TEST_F(SpdySessionPoolTest, IPPooling) { … }
TEST_F(SpdySessionPoolTest, IPPoolingCloseCurrentSessions) { … }
TEST_F(SpdySessionPoolTest, IPPoolingCloseIdleSessions) { … }
TEST_F(SpdySessionPoolTest, IPPoolingNetLog) { … }
TEST_F(SpdySessionPoolTest, IPPoolingDnsAlpn) { … }
TEST_F(SpdySessionPoolTest, IPPoolingDisabled) { … }
TEST_F(SpdySessionPoolTest, IPPoolingClientCert) { … }
namespace {
enum class ChangeType { … };
class SpdySessionGoAwayOnChangeTest
: public SpdySessionPoolTest,
public ::testing::WithParamInterface<ChangeType> { … };
}
TEST_P(SpdySessionGoAwayOnChangeTest, GoAwayOnChange) { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST_F(SpdySessionPoolTest, CloseOnIPAddressChanged) { … }
TEST_F(SpdySessionPoolTest, HandleIPAddressChangeThenShutdown) { … }
TEST_F(SpdySessionPoolTest, HandleGracefulGoawayThenShutdown) { … }
TEST_F(SpdySessionPoolTest, IPConnectionPoolingWithWebSockets) { … }
class TestOnRequestDeletedCallback { … };
class TestRequestDelegate
: public SpdySessionPool::SpdySessionRequest::Delegate { … };
TEST_F(SpdySessionPoolTest, RequestSessionWithNoSessions) { … }
TEST_F(SpdySessionPoolTest, RequestSessionDuringNotification) { … }
static const char kSSLServerTestHost[] = …;
static const struct { … } kSSLServerTests[] = …;
TEST_F(SpdySessionPoolTest, SSLConfigForServerChanged) { … }
TEST_F(SpdySessionPoolTest, SSLConfigForServerChangedWithProxyChain) { … }
TEST_F(SpdySessionPoolTest, SSLConfigForServerChangedWithStreams) { … }
TEST_F(SpdySessionPoolTest, SSLConfigForServerChangedWithOnlyPendingStreams) { … }
}