Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1090)

Unified Diff: net/dns/dns_test_util.h

Issue 9667025: [net/dns] Serve requests from HOSTS file if possible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased to trunk. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/dns/dns_test_util.h
diff --git a/net/dns/dns_test_util.h b/net/dns/dns_test_util.h
index 8d8c0a6d4b4b2bd24e02139b2b35c8ad24aad331..e247be0c378e081d4ea589f7dfc35ce26d075dea 100644
--- a/net/dns/dns_test_util.h
+++ b/net/dns/dns_test_util.h
@@ -7,6 +7,8 @@
#pragma once
#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+#include "net/dns/dns_config_service.h"
#include "net/dns/dns_protocol.h"
namespace net {
@@ -156,6 +158,25 @@ static const char* const kT3IpAddresses[] = {
static const char kT3CanonName[] = "www.l.google.com";
static const int kT3TTL = 0x00000015;
+class DnsClient;
+// Creates mock DnsClient for testing HostResolverImpl.
+scoped_ptr<DnsClient> CreateMockDnsClient(const DnsConfig& config);
+
+class MockDnsConfigService : public DnsConfigService {
+ public:
+ virtual ~MockDnsConfigService() {}
+
+ // Expose the protected methods for tests.
+ void ChangeConfig(const DnsConfig& config) {
+ DnsConfigService::OnConfigRead(config);
+ }
+
+ void ChangeHosts(const DnsHosts& hosts) {
+ DnsConfigService::OnHostsRead(hosts);
+ }
+};
+
+
} // namespace net
#endif // NET_DNS_DNS_TEST_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698