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

Side by Side Diff: net/dns/dns_test_util.h

Issue 10377092: [net/dns] Isolate DnsConfigWatcher from DnsConfigService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added sanity DCHECK. Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/dns/dns_config_watcher_win.cc ('k') | net/dns/dns_test_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 static const int kT3TTL = 0x00000015; 165 static const int kT3TTL = 0x00000015;
166 // +2 for the CNAME records. 166 // +2 for the CNAME records.
167 static const unsigned kT3RecordCount = arraysize(kT3IpAddresses) + 2; 167 static const unsigned kT3RecordCount = arraysize(kT3IpAddresses) + 2;
168 168
169 class DnsClient; 169 class DnsClient;
170 // Creates mock DnsClient for testing HostResolverImpl. 170 // Creates mock DnsClient for testing HostResolverImpl.
171 scoped_ptr<DnsClient> CreateMockDnsClient(const DnsConfig& config); 171 scoped_ptr<DnsClient> CreateMockDnsClient(const DnsConfig& config);
172 172
173 class MockDnsConfigService : public DnsConfigService { 173 class MockDnsConfigService : public DnsConfigService {
174 public: 174 public:
175 virtual ~MockDnsConfigService() {} 175 virtual ~MockDnsConfigService();
176 176
177 virtual void Watch(const CallbackType& callback) OVERRIDE; 177 // NetworkChangeNotifier::DNSObserver:
178 virtual void OnDNSChanged(unsigned detail) OVERRIDE;
178 179
179 // Expose the protected methods for tests. 180 // Expose the protected methods for tests.
180 void ChangeConfig(const DnsConfig& config) { 181 void ChangeConfig(const DnsConfig& config);
181 DnsConfigService::OnConfigRead(config); 182 void ChangeHosts(const DnsHosts& hosts);
182 }
183
184 void ChangeHosts(const DnsHosts& hosts) {
185 DnsConfigService::OnHostsRead(hosts);
186 }
187 }; 183 };
188 184
189 185
190 } // namespace net 186 } // namespace net
191 187
192 #endif // NET_DNS_DNS_TEST_UTIL_H_ 188 #endif // NET_DNS_DNS_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « net/dns/dns_config_watcher_win.cc ('k') | net/dns/dns_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698