chromium/net/quic/quic_proxy_client_socket_test_base.cc

// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "net/quic/quic_proxy_client_socket_test_base.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/time/default_tick_clock.h"
#include "net/base/connection_endpoint_metadata.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/proxy_string_util.h"
#include "net/base/session_usage.h"
#include "net/dns/mock_host_resolver.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/log/test_net_log.h"
#include "net/log/test_net_log_util.h"
#include "net/quic/crypto/proof_verifier_chromium.h"
#include "net/quic/mock_crypto_client_stream_factory.h"
#include "net/quic/quic_chromium_alarm_factory.h"
#include "net/quic/quic_chromium_client_session.h"
#include "net/quic/quic_chromium_connection_helper.h"
#include "net/quic/quic_chromium_packet_writer.h"
#include "net/quic/quic_crypto_client_config_handle.h"
#include "net/quic/quic_http_utils.h"
#include "net/quic/test_quic_crypto_client_config_handle.h"
#include "net/quic/test_task_runner.h"
#include "net/socket/socket_tag.h"
#include "net/socket/socket_test_util.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/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quiche/quic/test_tools/mock_random.h"
#include "net/third_party/quiche/src/quiche/quic/test_tools/quic_test_utils.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "url/scheme_host_port.h"

_;
AnyNumber;
Return;

namespace net {

QuicProxyClientSocketTestBase::~QuicProxyClientSocketTestBase() = default;

QuicProxyClientSocketTestBase::QuicProxyClientSocketTestBase()
    :{}

size_t QuicProxyClientSocketTestBase::GetStreamFrameDataLengthFromPacketLength(
    quic::QuicByteCount packet_length,
    quic::ParsedQuicVersion version,
    bool include_version,
    bool include_diversification_nonce,
    int connection_id_length,
    quic::QuicPacketNumberLength packet_number_length,
    quic::QuicStreamOffset offset) {}

void QuicProxyClientSocketTestBase::InitializeSession() {}

// Helper functions for constructing packets sent by the client

std::unique_ptr<quic::QuicReceivedPacket>
QuicProxyClientSocketTestBase::ConstructSettingsPacket(uint64_t packet_number) {}

std::unique_ptr<quic::QuicReceivedPacket>
QuicProxyClientSocketTestBase::ConstructAckAndRstOnlyPacket(
    uint64_t packet_number,
    quic::QuicRstStreamErrorCode error_code,
    uint64_t largest_received,
    uint64_t smallest_received) {}

std::unique_ptr<quic::QuicReceivedPacket>
QuicProxyClientSocketTestBase::ConstructAckAndRstPacket(
    uint64_t packet_number,
    quic::QuicRstStreamErrorCode error_code,
    uint64_t largest_received,
    uint64_t smallest_received) {}

std::unique_ptr<quic::QuicReceivedPacket>
QuicProxyClientSocketTestBase::ConstructRstPacket(
    uint64_t packet_number,
    quic::QuicRstStreamErrorCode error_code) {}

std::unique_ptr<quic::QuicReceivedPacket>
QuicProxyClientSocketTestBase::ConstructConnectRequestPacket(
    uint64_t packet_number,
    std::optional<const HttpRequestHeaders> extra_headers,
    RequestPriority request_priority) {}

std::unique_ptr<quic::QuicReceivedPacket>
QuicProxyClientSocketTestBase::ConstructConnectRequestPacketWithExtraHeaders(
    uint64_t packet_number,
    std::vector<std::pair<std::string, std::string>> extra_headers,
    RequestPriority request_priority) {}

std::unique_ptr<quic::QuicReceivedPacket>
QuicProxyClientSocketTestBase::ConstructConnectAuthRequestPacket(
    uint64_t packet_number) {}

std::unique_ptr<quic::QuicReceivedPacket>
QuicProxyClientSocketTestBase::ConstructDataPacket(uint64_t packet_number,
                                                   std::string_view data) {}

std::unique_ptr<quic::QuicReceivedPacket>
QuicProxyClientSocketTestBase::ConstructDatagramPacket(uint64_t packet_number,
                                                       std::string_view data) {}

std::unique_ptr<quic::QuicReceivedPacket>
QuicProxyClientSocketTestBase::ConstructAckAndDataPacket(
    uint64_t packet_number,
    uint64_t largest_received,
    uint64_t smallest_received,
    std::string_view data) {}

std::unique_ptr<quic::QuicReceivedPacket>
QuicProxyClientSocketTestBase::ConstructAckAndDatagramPacket(
    uint64_t packet_number,
    uint64_t largest_received,
    uint64_t smallest_received,
    std::string_view data) {}

std::unique_ptr<quic::QuicReceivedPacket>
QuicProxyClientSocketTestBase::ConstructAckPacket(uint64_t packet_number,
                                                  uint64_t largest_received,
                                                  uint64_t smallest_received) {}

// Helper functions for constructing packets sent by the server

std::unique_ptr<quic::QuicReceivedPacket>
QuicProxyClientSocketTestBase::ConstructServerRstPacket(
    uint64_t packet_number,
    quic::QuicRstStreamErrorCode error_code) {}

std::unique_ptr<quic::QuicReceivedPacket>
QuicProxyClientSocketTestBase::ConstructServerDataPacket(
    uint64_t packet_number,
    std::string_view data) {}

std::unique_ptr<quic::QuicReceivedPacket>
QuicProxyClientSocketTestBase::ConstructServerDatagramPacket(
    uint64_t packet_number,
    std::string_view data) {}

std::unique_ptr<quic::QuicReceivedPacket>
QuicProxyClientSocketTestBase::ConstructServerDataFinPacket(
    uint64_t packet_number,
    std::string_view data) {}

std::unique_ptr<quic::QuicReceivedPacket>
QuicProxyClientSocketTestBase::ConstructServerConnectReplyPacket(
    uint64_t packet_number,
    bool fin,
    size_t* header_length,
    std::optional<const HttpRequestHeaders> extra_headers) {}

std::unique_ptr<quic::QuicReceivedPacket> QuicProxyClientSocketTestBase::
    ConstructServerConnectReplyPacketWithExtraHeaders(
        uint64_t packet_number,
        bool fin,
        std::vector<std::pair<std::string, std::string>> extra_headers) {}

std::unique_ptr<quic::QuicReceivedPacket>
QuicProxyClientSocketTestBase::ConstructServerConnectAuthReplyPacket(
    uint64_t packet_number,
    bool fin) {}

std::unique_ptr<quic::QuicReceivedPacket>
QuicProxyClientSocketTestBase::ConstructServerConnectRedirectReplyPacket(
    uint64_t packet_number,
    bool fin) {}

std::unique_ptr<quic::QuicReceivedPacket>
QuicProxyClientSocketTestBase::ConstructServerConnectErrorReplyPacket(
    uint64_t packet_number,
    bool fin) {}

void QuicProxyClientSocketTestBase::ResumeAndRun() {}

std::string QuicProxyClientSocketTestBase::ConstructDataHeader(
    size_t body_len) {}
}  // namespace net