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

Side by Side Diff: chrome/browser/net/dns_probe_test_util.cc

Issue 2567623003: Make ERR_ICANN_NAME_COLLISION work for async DNS resolver. (Closed)
Patch Set: address Matt's comments Created 4 years 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
« no previous file with comments | « chrome/browser/net/dns_probe_test_util.h ('k') | net/dns/dns_test_util.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "chrome/browser/net/dns_probe_test_util.h" 5 #include "chrome/browser/net/dns_probe_test_util.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "chrome/browser/net/dns_probe_runner.h" 9 #include "chrome/browser/net/dns_probe_runner.h"
10 #include "net/base/ip_address.h" 10 #include "net/base/ip_address.h"
11 #include "net/dns/dns_config_service.h" 11 #include "net/dns/dns_config_service.h"
12 #include "net/dns/dns_protocol.h" 12 #include "net/dns/dns_protocol.h"
13 13
14 using net::DnsClient; 14 using net::DnsClient;
15 using net::DnsConfig; 15 using net::DnsConfig;
16 using net::MockDnsClientRule; 16 using net::MockDnsClientRule;
17 using net::MockDnsClientRuleList; 17 using net::MockDnsClientRuleList;
18 18
19 namespace chrome_browser_net { 19 namespace chrome_browser_net {
20 20
21 std::unique_ptr<DnsClient> CreateMockDnsClientForProbes( 21 std::unique_ptr<DnsClient> CreateMockDnsClientForProbes(
22 MockDnsClientRule::Result result) { 22 MockDnsClientRule::ResultType result) {
23 DnsConfig config; 23 DnsConfig config;
24 net::IPAddress dns_ip(192, 168, 1, 1); 24 net::IPAddress dns_ip(192, 168, 1, 1);
25 const uint16_t kDnsPort = net::dns_protocol::kDefaultPort; 25 const uint16_t kDnsPort = net::dns_protocol::kDefaultPort;
26 config.nameservers.push_back(net::IPEndPoint(dns_ip, kDnsPort)); 26 config.nameservers.push_back(net::IPEndPoint(dns_ip, kDnsPort));
27 27
28 const uint16_t kTypeA = net::dns_protocol::kTypeA; 28 const uint16_t kTypeA = net::dns_protocol::kTypeA;
29 MockDnsClientRuleList rules; 29 MockDnsClientRuleList rules;
30 rules.push_back(MockDnsClientRule(DnsProbeRunner::kKnownGoodHostname, kTypeA, 30 rules.push_back(MockDnsClientRule(DnsProbeRunner::kKnownGoodHostname, kTypeA,
31 result, false)); 31 MockDnsClientRule::Result(result), false));
32 32
33 return std::unique_ptr<DnsClient>(new net::MockDnsClient(config, rules)); 33 return std::unique_ptr<DnsClient>(new net::MockDnsClient(config, rules));
34 } 34 }
35 35
36 } // namespace chrome_browser_net 36 } // namespace chrome_browser_net
OLDNEW
« no previous file with comments | « chrome/browser/net/dns_probe_test_util.h ('k') | net/dns/dns_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698