chromium/net/dns/host_resolver_service_endpoint_request_unittest.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 <algorithm>
#include <memory>
#include <optional>
#include <string>
#include <string_view>
#include <vector>

#include "base/functional/callback.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "net/base/address_family.h"
#include "net/base/features.h"
#include "net/base/net_errors.h"
#include "net/base/network_anonymization_key.h"
#include "net/base/request_priority.h"
#include "net/dns/address_sorter.h"
#include "net/dns/dns_task_results_manager.h"
#include "net/dns/dns_test_util.h"
#include "net/dns/host_resolver.h"
#include "net/dns/host_resolver_manager_service_endpoint_request_impl.h"
#include "net/dns/host_resolver_manager_unittest.h"
#include "net/dns/host_resolver_results_test_util.h"
#include "net/dns/public/host_resolver_results.h"
#include "net/dns/public/host_resolver_source.h"
#include "net/dns/resolve_context.h"
#include "net/log/net_log_with_source.h"
#include "net/test/gtest_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/scheme_host_port.h"

ElementsAre;
IsEmpty;
Optional;
UnorderedElementsAre;

IsError;
IsOk;

namespace net {

ServiceEndpointRequest;
ResolveHostRequest;
ResolveHostParameters;

namespace {

IPEndPoint MakeIPEndPoint(std::string_view ip_literal, uint16_t port = 0) {}

// Sorts endpoints using IPAddress's comparator.
class FakeAddressSorter : public AddressSorter {};

class Requester : public ServiceEndpointRequest::Delegate {};

class LegacyRequester {};

}  // namespace

class HostResolverServiceEndpointRequestTest
    : public HostResolverManagerDnsTest {};

TEST_F(HostResolverServiceEndpointRequestTest, NameNotResolved) {}

TEST_F(HostResolverServiceEndpointRequestTest, Ok) {}

TEST_F(HostResolverServiceEndpointRequestTest, ResolveLocally) {}

TEST_F(HostResolverServiceEndpointRequestTest, EndpointsAreSorted) {}

TEST_F(HostResolverServiceEndpointRequestTest, CancelRequestOnUpdated) {}

TEST_F(HostResolverServiceEndpointRequestTest, CancelRequestOnFinished) {}

TEST_F(HostResolverServiceEndpointRequestTest, Ipv4Slow) {}

TEST_F(HostResolverServiceEndpointRequestTest, Ipv6Slow) {}

TEST_F(HostResolverServiceEndpointRequestTest, Ipv6SlowResolutionDelayPassed) {}

TEST_F(HostResolverServiceEndpointRequestTest, HttpsSlow) {}

TEST_F(HostResolverServiceEndpointRequestTest, DestroyResolverWhileUpdating) {}

TEST_F(HostResolverServiceEndpointRequestTest, DestroyResolverWhileFinishing) {}

TEST_F(HostResolverServiceEndpointRequestTest,
       EndpointsCryptoReadySystemTaskOnly) {}

TEST_F(HostResolverServiceEndpointRequestTest, MultipleRequestsOk) {}

TEST_F(HostResolverServiceEndpointRequestTest,
       MultipleRequestsAddRequestInTheMiddleOfResolution) {}

TEST_F(HostResolverServiceEndpointRequestTest,
       MultipleRequestsAddAndCancelRequestInUpdatedCallback) {}

TEST_F(HostResolverServiceEndpointRequestTest,
       MultipleRequestsAddRequestInFinishedCallback) {}

TEST_F(HostResolverServiceEndpointRequestTest,
       MultipleRequestsCancelOneRequestOnUpdated) {}

TEST_F(HostResolverServiceEndpointRequestTest,
       MultipleRequestsCancelAllRequestOnUpdated) {}

TEST_F(HostResolverServiceEndpointRequestTest,
       MultipleRequestsCancelAllRequestOnFinished) {}

TEST_F(HostResolverServiceEndpointRequestTest, WithLegacyRequestOk) {}

TEST_F(HostResolverServiceEndpointRequestTest,
       WithLegacyRequestDestroyResolverOnUpdated) {}

TEST_F(HostResolverServiceEndpointRequestTest,
       WithLegacyRequestCancelRequestOnUpdated) {}

TEST_F(HostResolverServiceEndpointRequestTest,
       WithLegacyRequestCancelLegacyRequest) {}

TEST_F(HostResolverServiceEndpointRequestTest, ChangePriority) {}

TEST_F(HostResolverServiceEndpointRequestTest, ChangePriorityBeforeStart) {}

}  // namespace net