#include <list>
#include "base/functional/callback.h"
#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_future.h"
#include "base/threading/platform_thread.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/network_service_util.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_client.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/content_browser_test.h"
#include "content/shell/browser/shell.h"
#include "mojo/public/cpp/bindings/callback_helpers.h"
#include "net/base/address_list.h"
#include "net/base/ip_address.h"
#include "net/base/ip_endpoint.h"
#include "net/base/network_interfaces.h"
#include "net/base/request_priority.h"
#include "net/dns/host_resolver_system_task.h"
#include "net/dns/mock_host_resolver.h"
#include "net/dns/public/host_resolver_results.h"
#include "net/dns/public/resolve_error_info.h"
#include "net/dns/public/secure_dns_policy.h"
#include "sandbox/policy/features.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/simple_host_resolver.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/perf/perf_result_reporter.h"
namespace content {
namespace {
const int kHttpPort = …;
const char kHostname1[] = …;
const char kIpAddress1[] = …;
const char kHostname2[] = …;
const char kIpAddress2[] = …;
const char kFailHostname[] = …;
ResolveHostFuture;
}
class SystemDnsResolverBrowserTest : public content::ContentBrowserTest { … };
IN_PROC_BROWSER_TEST_F(SystemDnsResolverBrowserTest,
NetworkServiceResolvesOneHostname) { … }
IN_PROC_BROWSER_TEST_F(SystemDnsResolverBrowserTest,
NetworkServiceResolvesTwoHostnames) { … }
IN_PROC_BROWSER_TEST_F(SystemDnsResolverBrowserTest,
NetworkServiceFailsResolvingBadHostname) { … }
IN_PROC_BROWSER_TEST_F(SystemDnsResolverBrowserTest,
NetworkServiceResolvesOwnHostname) { … }
class SystemDnsResolverPerfTest : public content::ContentBrowserTest { … };
namespace {
constexpr char kMetricPrefixSystemDnsResolver[] = …;
constexpr char kMetricTimePerSystemDnsResolution[] = …;
const size_t kNumResolutions = …;
std::atomic<bool> g_finished = …;
void PostAnotherTask() { … }
perf_test::PerfResultReporter SetUpReporter(const std::string& story_name) { … }
}
IN_PROC_BROWSER_TEST_F(SystemDnsResolverPerfTest, MANUAL_ResolveManyHostnames) { … }
}