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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/net/dns_probe_test_util.cc
diff --git a/chrome/browser/net/dns_probe_test_util.cc b/chrome/browser/net/dns_probe_test_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8e2b7125ebd0b08bfc860429e7174b75eacece90
--- /dev/null
+++ b/chrome/browser/net/dns_probe_test_util.cc
@@ -0,0 +1,38 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/net/dns_probe_test_util.h"
+
+#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.
+#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.
+#include "net/dns/dns_config_service.h"
+#include "net/dns/dns_protocol.h"
+#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.
+
+using net::DnsClient;
+using net::DnsConfig;
+using net::IPAddressNumber;
+using net::IPEndPoint;
+using net::MockDnsClientRule;
+using net::MockDnsClientRuleList;
+using net::ParseIPLiteralToNumber;
+
+namespace chrome_browser_net {
+
+scoped_ptr<DnsClient> CreateMockDnsClientForProbes(
+ MockDnsClientRule::Result good_result) {
+ DnsConfig config;
+ IPAddressNumber dns_ip;
+ ParseIPLiteralToNumber("192.168.1.1", &dns_ip);
+ const uint16 kDnsPort = net::dns_protocol::kDefaultPort;
+ config.nameservers.push_back(IPEndPoint(dns_ip, kDnsPort));
+
+ const uint16 kTypeA = net::dns_protocol::kTypeA;
+ MockDnsClientRuleList rules;
+ rules.push_back(MockDnsClientRule("google.com", kTypeA, good_result));
+
+ return CreateMockDnsClient(config, rules).Pass();
+}
+
+} // namespace chrome_browser_net

Powered by Google App Engine
This is Rietveld 408576698