#include "net/dns/dns_config_service.h"
#include <memory>
#include <string>
#include <string_view>
#include <utility>
#include "base/cancelable_callback.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/strings/string_split.h"
#include "base/task/single_thread_task_runner.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
#include "base/test/test_timeouts.h"
#include "net/base/address_family.h"
#include "net/base/ip_address.h"
#include "net/dns/dns_hosts.h"
#include "net/dns/public/dns_protocol.h"
#include "net/dns/test_dns_config_service.h"
#include "net/test/test_with_task_environment.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace net {
namespace {
_;
DoAll;
Return;
SetArgPointee;
class DnsConfigServiceTest : public TestWithTaskEnvironment { … };
class MockHostsParserFactory : public DnsHostsParser { … };
HostsReadingTestDnsConfigService::HostsParserFactory
MockHostsParserFactory::GetFactory() { … }
DnsHosts::value_type CreateHostsEntry(std::string_view name,
AddressFamily family,
IPAddress address) { … }
}
TEST_F(DnsConfigServiceTest, FirstConfig) { … }
TEST_F(DnsConfigServiceTest, Timeout) { … }
TEST_F(DnsConfigServiceTest, SameConfig) { … }
TEST_F(DnsConfigServiceTest, DifferentConfig) { … }
TEST_F(DnsConfigServiceTest, WatchFailure) { … }
TEST_F(DnsConfigServiceTest, HostsReadFailure) { … }
TEST_F(DnsConfigServiceTest, ReadEmptyHosts) { … }
TEST_F(DnsConfigServiceTest, ReadSingleHosts) { … }
TEST_F(DnsConfigServiceTest, ReadMultipleHosts) { … }
TEST_F(DnsConfigServiceTest, HostsReadSubsequentFailure) { … }
TEST_F(DnsConfigServiceTest, HostsReadSubsequentSuccess) { … }
TEST_F(DnsConfigServiceTest, ConfigReadDuringHostsReRead) { … }
TEST_F(DnsConfigServiceTest, HostsWatcherFailure) { … }
}