| OLD | NEW |
| 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> |
| 8 |
| 7 #include "chrome/browser/net/dns_probe_runner.h" | 9 #include "chrome/browser/net/dns_probe_runner.h" |
| 8 #include "net/dns/dns_config_service.h" | 10 #include "net/dns/dns_config_service.h" |
| 9 #include "net/dns/dns_protocol.h" | 11 #include "net/dns/dns_protocol.h" |
| 10 | 12 |
| 11 using net::DnsClient; | 13 using net::DnsClient; |
| 12 using net::DnsConfig; | 14 using net::DnsConfig; |
| 13 using net::IPAddressNumber; | 15 using net::IPAddressNumber; |
| 14 using net::MockDnsClientRule; | 16 using net::MockDnsClientRule; |
| 15 using net::MockDnsClientRuleList; | 17 using net::MockDnsClientRuleList; |
| 16 using net::ParseIPLiteralToNumber; | 18 using net::ParseIPLiteralToNumber; |
| 17 | 19 |
| 18 namespace chrome_browser_net { | 20 namespace chrome_browser_net { |
| 19 | 21 |
| 20 scoped_ptr<DnsClient> CreateMockDnsClientForProbes( | 22 scoped_ptr<DnsClient> CreateMockDnsClientForProbes( |
| 21 MockDnsClientRule::Result result) { | 23 MockDnsClientRule::Result result) { |
| 22 DnsConfig config; | 24 DnsConfig config; |
| 23 IPAddressNumber dns_ip; | 25 IPAddressNumber dns_ip; |
| 24 ParseIPLiteralToNumber("192.168.1.1", &dns_ip); | 26 ParseIPLiteralToNumber("192.168.1.1", &dns_ip); |
| 25 const uint16 kDnsPort = net::dns_protocol::kDefaultPort; | 27 const uint16_t kDnsPort = net::dns_protocol::kDefaultPort; |
| 26 config.nameservers.push_back(net::IPEndPoint(dns_ip, kDnsPort)); | 28 config.nameservers.push_back(net::IPEndPoint(dns_ip, kDnsPort)); |
| 27 | 29 |
| 28 const uint16 kTypeA = net::dns_protocol::kTypeA; | 30 const uint16_t kTypeA = net::dns_protocol::kTypeA; |
| 29 MockDnsClientRuleList rules; | 31 MockDnsClientRuleList rules; |
| 30 rules.push_back(MockDnsClientRule(DnsProbeRunner::kKnownGoodHostname, kTypeA, | 32 rules.push_back(MockDnsClientRule(DnsProbeRunner::kKnownGoodHostname, kTypeA, |
| 31 result, false)); | 33 result, false)); |
| 32 | 34 |
| 33 return scoped_ptr<DnsClient>(new net::MockDnsClient(config, rules)); | 35 return scoped_ptr<DnsClient>(new net::MockDnsClient(config, rules)); |
| 34 } | 36 } |
| 35 | 37 |
| 36 } // namespace chrome_browser_net | 38 } // namespace chrome_browser_net |
| OLD | NEW |