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

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: Don't break DnsProbe histograms Created 7 years, 5 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 "net/dns/dns_config_service.h"
8 #include "net/dns/dns_protocol.h"
9
10 using net::DnsClient;
11 using net::DnsConfig;
12 using net::IPAddressNumber;
13 using net::IPEndPoint;
14 using net::MockDnsClientRule;
15 using net::MockDnsClientRuleList;
16 using net::ParseIPLiteralToNumber;
17
18 namespace chrome_browser_net {
19
20 scoped_ptr<DnsClient> CreateMockDnsClientForProbes(
21 MockDnsClientRule::Result result) {
22 DnsConfig config;
23 IPAddressNumber dns_ip;
24 ParseIPLiteralToNumber("192.168.1.1", &dns_ip);
25 const uint16 kDnsPort = net::dns_protocol::kDefaultPort;
26 config.nameservers.push_back(IPEndPoint(dns_ip, kDnsPort));
27
28 const uint16 kTypeA = net::dns_protocol::kTypeA;
29 MockDnsClientRuleList rules;
30 rules.push_back(MockDnsClientRule("google.com", kTypeA, result));
mmenke 2013/06/28 20:43:27 Think it would be a bit better to have the probe r
Deprecated (see juliatuttle) 2013/07/01 17:39:55 Done.
31
32 return CreateMockDnsClient(config, rules).Pass();
33 }
34
35 } // namespace chrome_browser_net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698