Index: net/dns/dns_client.h |
diff --git a/net/dns/dns_client.h b/net/dns/dns_client.h |
index 01d024b9a17032b18d51c57177e74ae478f1177a..684b8e62c5aa69ac9fdce25b161bb44cf6b2135d 100644 |
--- a/net/dns/dns_client.h |
+++ b/net/dns/dns_client.h |
@@ -8,10 +8,12 @@ |
#include <memory> |
#include "net/base/net_export.h" |
+#include "net/base/rand_callback.h" |
namespace net { |
class AddressSorter; |
+class ClientSocketFactory; |
struct DnsConfig; |
class DnsTransactionFactory; |
class NetLog; |
@@ -38,6 +40,14 @@ class NET_EXPORT DnsClient { |
// Creates default client. |
static std::unique_ptr<DnsClient> CreateClient(NetLog* net_log); |
+ |
+ // Creates a client for testing. Allows using a mock ClientSocketFactory and |
+ // a deterministic "random" number generator. |socket_factory| must outlive |
+ // the returned DnsClient. |
+ static std::unique_ptr<DnsClient> CreateClientForTesting( |
+ NetLog* net_log, |
+ ClientSocketFactory* socket_factory, |
+ const RandIntCallback& rand_int_callback); |
}; |
} // namespace net |