chromium/services/network/host_resolver_unittest.cc

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

#include "services/network/host_resolver.h"

#include <map>
#include <optional>
#include <utility>
#include <vector>

#include "base/check.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "net/base/address_list.h"
#include "net/base/host_port_pair.h"
#include "net/base/ip_address.h"
#include "net/base/ip_endpoint.h"
#include "net/base/net_errors.h"
#include "net/base/network_isolation_key.h"
#include "net/dns/context_host_resolver.h"
#include "net/dns/dns_config.h"
#include "net/dns/dns_test_util.h"
#include "net/dns/host_resolver.h"
#include "net/dns/host_resolver_manager.h"
#include "net/dns/mock_host_resolver.h"
#include "net/dns/public/dns_protocol.h"
#include "net/dns/public/host_resolver_results.h"
#include "net/dns/public/host_resolver_source.h"
#include "net/dns/public/mdns_listener_update_type.h"
#include "net/dns/public/secure_dns_policy.h"
#include "net/log/net_log.h"
#include "net/net_buildflags.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"

namespace network {
namespace {

class HostResolverTest : public testing::Test {};

net::IPEndPoint CreateExpectedEndPoint(const std::string& address,
                                       uint16_t port) {}

class TestResolveHostClient : public mojom::ResolveHostClient {};

class TestMdnsListenClient : public mojom::MdnsListenClient {};

TEST_F(HostResolverTest, Sync) {}

TEST_F(HostResolverTest, Async) {}

TEST_F(HostResolverTest, DnsQueryType) {}

TEST_F(HostResolverTest, InitialPriority) {}

// Make requests specifying a source for host resolution and ensure the correct
// source is requested from the inner resolver.
TEST_F(HostResolverTest, Source) {}

// Make host resolve requests specifying https scheme and
// test that a resolver successfully gets https record information.
TEST_F(HostResolverTest, GetEndpointResultsWithMetadata) {}

// Test that cached results are properly keyed by requested source.
TEST_F(HostResolverTest, SeparateCacheBySource) {}

TEST_F(HostResolverTest, CacheDisabled) {}

TEST_F(HostResolverTest, CacheStaleAllowed) {}

// Test for a resolve with a result only in the cache and error if the cache is
// disabled.
TEST_F(HostResolverTest, CacheDisabled_ErrorResults) {}

TEST_F(HostResolverTest, IncludeCanonicalName) {}

TEST_F(HostResolverTest, LoopbackOnly) {}

TEST_F(HostResolverTest, HandlesSecureDnsPolicyParameter) {}

TEST_F(HostResolverTest, Failure_Sync) {}

TEST_F(HostResolverTest, Failure_Async) {}

TEST_F(HostResolverTest, NetworkAnonymizationKey) {}

TEST_F(HostResolverTest, NoOptionalParameters) {}

TEST_F(HostResolverTest, NoControlHandle) {}

TEST_F(HostResolverTest, CloseControlHandle) {}

TEST_F(HostResolverTest, Cancellation) {}

TEST_F(HostResolverTest, Cancellation_SubsequentRequest) {}

TEST_F(HostResolverTest, DestroyResolver) {}

TEST_F(HostResolverTest, CloseClient) {}

TEST_F(HostResolverTest, CloseClient_SubsequentRequest) {}

TEST_F(HostResolverTest, Binding) {}

TEST_F(HostResolverTest, CloseBinding) {}

TEST_F(HostResolverTest, CloseBinding_SubsequentRequest) {}

TEST_F(HostResolverTest, IsSpeculative) {}

net::DnsConfig CreateValidDnsConfig() {}

TEST_F(HostResolverTest, TextResults) {}

TEST_F(HostResolverTest, HostResults) {}

TEST_F(HostResolverTest, RespectsDisablingAdditionalQueryTypes) {}

TEST_F(HostResolverTest, CanonicalizesInputHost) {}

#if BUILDFLAG(ENABLE_MDNS)
TEST_F(HostResolverTest, MdnsListener_AddressResult) {}

TEST_F(HostResolverTest, MdnsListener_TextResult) {}

TEST_F(HostResolverTest, MdnsListener_HostnameResult) {}

TEST_F(HostResolverTest, MdnsListener_UnhandledResult) {}
#endif  // BUILDFLAG(ENABLE_MDNS)

}  // namespace
}  // namespace network