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

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

Issue 13270005: Display DNS probe results. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Refactor a bit again (DnsProbeRunner is now tied to a single DnsClient), other fixes Created 7 years, 6 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
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/net/dns_probe_test_util.h"
6
7 #include "base/memory/scoped_ptr.h"
mmenke 2013/06/12 19:17:12 Not needed, appears in header.
Deprecated (see juliatuttle) 2013/06/13 14:37:04 Done.
8 #include "net/dns/dns_client.h"
mmenke 2013/06/12 19:17:12 Not needed, if this appears in header (Of course,
Deprecated (see juliatuttle) 2013/06/13 14:37:04 Done.
9 #include "net/dns/dns_config_service.h"
10 #include "net/dns/dns_protocol.h"
11 #include "net/dns/dns_test_util.h"
mmenke 2013/06/12 19:17:12 Not needed, appears in header.
Deprecated (see juliatuttle) 2013/06/13 14:37:04 Done.
12
13 using net::DnsClient;
14 using net::DnsConfig;
15 using net::IPAddressNumber;
16 using net::IPEndPoint;
17 using net::MockDnsClientRule;
18 using net::MockDnsClientRuleList;
19 using net::ParseIPLiteralToNumber;
20
21 namespace chrome_browser_net {
22
23 scoped_ptr<DnsClient> CreateMockDnsClientForProbes(
24 MockDnsClientRule::Result good_result) {
25 DnsConfig config;
26 IPAddressNumber dns_ip;
27 ParseIPLiteralToNumber("192.168.1.1", &dns_ip);
28 const uint16 kDnsPort = net::dns_protocol::kDefaultPort;
29 config.nameservers.push_back(IPEndPoint(dns_ip, kDnsPort));
30
31 const uint16 kTypeA = net::dns_protocol::kTypeA;
32 MockDnsClientRuleList rules;
33 rules.push_back(MockDnsClientRule("google.com", kTypeA, good_result));
34
35 return CreateMockDnsClient(config, rules).Pass();
36 }
37
38 } // namespace chrome_browser_net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698