#include "net/quic/quic_chromium_client_session.h"
#include "base/base64.h"
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/strings/strcat.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/scoped_feature_list.h"
#include "base/time/default_tick_clock.h"
#include "build/build_config.h"
#include "net/base/connection_endpoint_metadata.h"
#include "net/base/features.h"
#include "net/base/network_anonymization_key.h"
#include "net/base/privacy_mode.h"
#include "net/base/proxy_chain.h"
#include "net/base/proxy_server.h"
#include "net/base/schemeful_site.h"
#include "net/base/session_usage.h"
#include "net/base/test_completion_callback.h"
#include "net/cert/cert_verify_result.h"
#include "net/dns/public/host_resolver_results.h"
#include "net/dns/public/secure_dns_policy.h"
#include "net/http/transport_security_state.h"
#include "net/http/transport_security_state_test_util.h"
#include "net/log/net_log.h"
#include "net/log/net_log_source.h"
#include "net/quic/address_utils.h"
#include "net/quic/crypto/proof_verifier_chromium.h"
#include "net/quic/mock_crypto_client_stream_factory.h"
#include "net/quic/mock_quic_data.h"
#include "net/quic/quic_chromium_alarm_factory.h"
#include "net/quic/quic_chromium_client_session_peer.h"
#include "net/quic/quic_chromium_connection_helper.h"
#include "net/quic/quic_chromium_packet_reader.h"
#include "net/quic/quic_chromium_packet_writer.h"
#include "net/quic/quic_connectivity_monitor.h"
#include "net/quic/quic_context.h"
#include "net/quic/quic_crypto_client_config_handle.h"
#include "net/quic/quic_crypto_client_stream_factory.h"
#include "net/quic/quic_http_utils.h"
#include "net/quic/quic_server_info.h"
#include "net/quic/quic_session_key.h"
#include "net/quic/quic_test_packet_maker.h"
#include "net/quic/test_quic_crypto_client_config_handle.h"
#include "net/socket/datagram_client_socket.h"
#include "net/socket/socket_test_util.h"
#include "net/spdy/spdy_test_util_common.h"
#include "net/ssl/ssl_config_service_defaults.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/http2/test_tools/spdy_test_utils.h"
#include "net/third_party/quiche/src/quiche/quic/core/crypto/aes_128_gcm_12_encrypter.h"
#include "net/third_party/quiche/src/quiche/quic/core/crypto/crypto_protocol.h"
#include "net/third_party/quiche/src/quiche/quic/core/crypto/quic_decrypter.h"
#include "net/third_party/quiche/src/quiche/quic/core/crypto/quic_encrypter.h"
#include "net/third_party/quiche/src/quiche/quic/core/quic_connection_id.h"
#include "net/third_party/quiche/src/quiche/quic/core/quic_packet_writer.h"
#include "net/third_party/quiche/src/quiche/quic/core/quic_tag.h"
#include "net/third_party/quiche/src/quiche/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quiche/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quiche/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quiche/quic/test_tools/crypto_test_utils.h"
#include "net/third_party/quiche/src/quiche/quic/test_tools/mock_connection_id_generator.h"
#include "net/third_party/quiche/src/quiche/quic/test_tools/qpack/qpack_test_utils.h"
#include "net/third_party/quiche/src/quiche/quic/test_tools/quic_connection_peer.h"
#include "net/third_party/quiche/src/quiche/quic/test_tools/quic_session_peer.h"
#include "net/third_party/quiche/src/quiche/quic/test_tools/quic_stream_peer.h"
#include "net/third_party/quiche/src/quiche/quic/test_tools/quic_test_utils.h"
#include "net/third_party/quiche/src/quiche/quic/test_tools/simple_quic_framer.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "url/gurl.h"
#include "url/scheme_host_port.h"
#include "url/url_constants.h"
_;
namespace net::test {
namespace {
const IPEndPoint kIpEndPoint = …;
const char kServerHostname[] = …;
const uint16_t kServerPort = …;
const size_t kMaxReadersPerQuicSession = …;
const handles::NetworkHandle kDefaultNetworkForTests = …;
const handles::NetworkHandle kNewNetworkForTests = …;
class TestingQuicChromiumClientSession : public QuicChromiumClientSession { … };
class QuicChromiumClientSessionTest
: public ::testing::TestWithParam<quic::ParsedQuicVersion>,
public WithTaskEnvironment { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(QuicChromiumClientSessionTest, GetSSLInfo1) { … }
TEST_P(QuicChromiumClientSessionTest, GetSSLInfo2) { … }
TEST_P(QuicChromiumClientSessionTest, IsFatalErrorNotSetForNonFatalError) { … }
TEST_P(QuicChromiumClientSessionTest, IsFatalErrorSetForFatalError) { … }
TEST_P(QuicChromiumClientSessionTest, CryptoConnect) { … }
TEST_P(QuicChromiumClientSessionTest, Handle) { … }
TEST_P(QuicChromiumClientSessionTest, StreamRequest) { … }
TEST_P(QuicChromiumClientSessionTest, ConfirmationRequiredStreamRequest) { … }
TEST_P(QuicChromiumClientSessionTest, StreamRequestBeforeConfirmation) { … }
TEST_P(QuicChromiumClientSessionTest, CancelStreamRequestBeforeRelease) { … }
TEST_P(QuicChromiumClientSessionTest, AsyncStreamRequest) { … }
TEST_P(QuicChromiumClientSessionTest, ReadAfterConnectionClose) { … }
TEST_P(QuicChromiumClientSessionTest, ClosedWithAsyncStreamRequest) { … }
TEST_P(QuicChromiumClientSessionTest, CancelPendingStreamRequest) { … }
TEST_P(QuicChromiumClientSessionTest, ConnectionCloseBeforeStreamRequest) { … }
TEST_P(QuicChromiumClientSessionTest, ConnectionCloseBeforeHandshakeConfirmed) { … }
TEST_P(QuicChromiumClientSessionTest, ConnectionCloseWithPendingStreamRequest) { … }
TEST_P(QuicChromiumClientSessionTest, MaxNumStreams) { … }
TEST_P(QuicChromiumClientSessionTest, PendingStreamOnRst) { … }
TEST_P(QuicChromiumClientSessionTest, ClosePendingStream) { … }
TEST_P(QuicChromiumClientSessionTest, MaxNumStreamsViaRequest) { … }
TEST_P(QuicChromiumClientSessionTest, GoAwayReceived) { … }
TEST_P(QuicChromiumClientSessionTest, CanPool) { … }
TEST_P(QuicChromiumClientSessionTest, CanPoolWithNetworkAnonymizationKey) { … }
TEST_P(QuicChromiumClientSessionTest, ConnectionNotPooledWithDifferentPin) { … }
TEST_P(QuicChromiumClientSessionTest, ConnectionPooledWithMatchingPin) { … }
TEST_P(QuicChromiumClientSessionTest, MigrateToSocket) { … }
TEST_P(QuicChromiumClientSessionTest, MigrateToSocketMaxReaders) { … }
TEST_P(QuicChromiumClientSessionTest, MigrateToSocketReadError) { … }
TEST_P(QuicChromiumClientSessionTest, RetransmittableOnWireTimeout) { … }
TEST_P(QuicChromiumClientSessionTest, ResetOnEmptyResponseHeaders) { … }
TEST_P(QuicChromiumClientSessionTest,
DegradingWithoutNetworkChange_NoNetworkHandle) { … }
TEST_P(QuicChromiumClientSessionTest, DegradingWithMultiPortEnabled) { … }
TEST_P(QuicChromiumClientSessionTest, DegradingWithIPAddressChange) { … }
TEST_P(QuicChromiumClientSessionTest,
DegradingOnDeafultNetwork_WithoutMigration) { … }
TEST_P(QuicChromiumClientSessionTest,
DegradingWithDeafultNetworkChange_WithoutMigration) { … }
TEST_P(QuicChromiumClientSessionTest, WriteErrorDuringCryptoConnect) { … }
TEST_P(QuicChromiumClientSessionTest, WriteErrorAfterHandshakeConfirmed) { … }
TEST_P(QuicChromiumClientSessionTest, ReportsReceivedEcn) { … }
TEST_P(QuicChromiumClientSessionTest, OnOriginFrame) { … }
}
}