Bootstrap resolution implementation
This change adds logic to HostResolverManager to use pre-configured IP
addresses for the initial connection to a DoH server. If a bootstrap IP
is used, the resolver also starts an asynchronous followup request to
ask the DoH server for its own IP address, which will be used for
subsequent connections.
This change does not add the ability to store any bootstrap IPs, so this
logic is not yet live.
Bug: 1200908
Change-Id: Iab4bf7344b59e042a9bdaa944ec5ac7c1ff2f35f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3193799
Reviewed-by: Eric Orth <[email protected]>
Auto-Submit: Ben Schwartz <[email protected]>
Reviewed-by: Tom Sepez <[email protected]>
Commit-Queue: Tom Sepez <[email protected]>
Cr-Commit-Position: refs/heads/main@{#951995}
diff --git a/net/dns/dns_test_util.cc b/net/dns/dns_test_util.cc
index 696c6b0..7e37f15 100644
--- a/net/dns/dns_test_util.cc
+++ b/net/dns/dns_test_util.cc
@@ -19,6 +19,7 @@
#include "base/task/single_thread_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
+#include "net/base/address_list.h"
#include "net/base/io_buffer.h"
#include "net/base/ip_address.h"
#include "net/base/net_errors.h"
@@ -30,7 +31,9 @@
#include "net/dns/dns_util.h"
#include "net/dns/public/dns_over_https_server_config.h"
#include "net/dns/resolve_context.h"
+#include "testing/gmock/include/gmock/gmock-matchers.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "url/scheme_host_port.h"
namespace net {
namespace {
@@ -734,6 +737,12 @@
NOTREACHED();
}
+absl::optional<AddressList> MockDnsClient::GetPresetAddrs(
+ const url::SchemeHostPort& endpoint) const {
+ EXPECT_THAT(preset_endpoint_, testing::Optional(endpoint));
+ return preset_addrs_;
+}
+
void MockDnsClient::CompleteDelayedTransactions() {
factory_->CompleteDelayedTransactions();
}