Chromium Code Reviews| 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" |
|
eroman
2016/05/17 23:01:33
Hmm, yuck.
I didn't know we had such a typdef/fil
|
| 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 |
|
eroman
2016/05/17 23:01:33
optional: Fine to drop the quotes around "random".
mmenke
2016/05/19 19:09:45
Done.
|
| + // the returned DnsClient. |
| + static std::unique_ptr<DnsClient> CreateClientForTesting( |
| + NetLog* net_log, |
| + ClientSocketFactory* socket_factory, |
| + const RandIntCallback& rand_int_callback); |
| }; |
| } // namespace net |