| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_DNS_DNS_TEST_UTIL_H_ | 5 #ifndef NET_DNS_DNS_TEST_UTIL_H_ |
| 6 #define NET_DNS_DNS_TEST_UTIL_H_ | 6 #define NET_DNS_DNS_TEST_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 uint16 qtype; | 182 uint16 qtype; |
| 183 Result result; | 183 Result result; |
| 184 }; | 184 }; |
| 185 | 185 |
| 186 typedef std::vector<MockDnsClientRule> MockDnsClientRuleList; | 186 typedef std::vector<MockDnsClientRule> MockDnsClientRuleList; |
| 187 | 187 |
| 188 // Creates mock DnsClient for testing HostResolverImpl. | 188 // Creates mock DnsClient for testing HostResolverImpl. |
| 189 scoped_ptr<DnsClient> CreateMockDnsClient(const DnsConfig& config, | 189 scoped_ptr<DnsClient> CreateMockDnsClient(const DnsConfig& config, |
| 190 const MockDnsClientRuleList& rules); | 190 const MockDnsClientRuleList& rules); |
| 191 | 191 |
| 192 class MockDnsConfigService : public DnsConfigService { | |
| 193 public: | |
| 194 virtual ~MockDnsConfigService(); | |
| 195 | |
| 196 // NetworkChangeNotifier::DNSObserver: | |
| 197 virtual void OnDNSChanged(unsigned detail) OVERRIDE; | |
| 198 | |
| 199 // Expose the protected methods for tests. | |
| 200 void ChangeConfig(const DnsConfig& config); | |
| 201 void ChangeHosts(const DnsHosts& hosts); | |
| 202 }; | |
| 203 | |
| 204 | |
| 205 } // namespace net | 192 } // namespace net |
| 206 | 193 |
| 207 #endif // NET_DNS_DNS_TEST_UTIL_H_ | 194 #endif // NET_DNS_DNS_TEST_UTIL_H_ |
| OLD | NEW |