#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) { … }
TEST_F(HostResolverTest, Source) { … }
TEST_F(HostResolverTest, GetEndpointResultsWithMetadata) { … }
TEST_F(HostResolverTest, SeparateCacheBySource) { … }
TEST_F(HostResolverTest, CacheDisabled) { … }
TEST_F(HostResolverTest, CacheStaleAllowed) { … }
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
}
}