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

Unified Diff: net/dns/dns_test_util.h

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/net/dns_probe_test_util.cc ('k') | net/dns/dns_test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/dns_test_util.h
diff --git a/net/dns/dns_test_util.h b/net/dns/dns_test_util.h
index 21769fc1231eedb455356de9a80379ccd2088d91..133c33fa9783d96934a0f6aaaa6332f3d90e40a6 100644
--- a/net/dns/dns_test_util.h
+++ b/net/dns/dns_test_util.h
@@ -158,18 +158,27 @@ class DnsClient;
class MockTransactionFactory;
struct MockDnsClientRule {
- enum Result {
+ enum ResultType {
FAIL, // Fail asynchronously with ERR_NAME_NOT_RESOLVED.
TIMEOUT, // Fail asynchronously with ERR_DNS_TIMEOUT.
EMPTY, // Return an empty response.
- OK, // Return a response with loopback address.
+ OK, // Return an IP address (the accompanying IP is an argument in the
+ // Result structure, or understood as localhost when unspecified).
+ };
+
+ struct Result {
+ explicit Result(const IPAddress& ip) : type(OK), ip(ip) {}
+ explicit Result(ResultType type) : type(type) {}
+
+ ResultType type;
+ IPAddress ip;
};
// If |delay| is true, matching transactions will be delayed until triggered
// by the consumer.
MockDnsClientRule(const std::string& prefix_arg,
uint16_t qtype_arg,
- Result result_arg,
+ const Result& result_arg,
bool delay)
: result(result_arg),
prefix(prefix_arg),
« no previous file with comments | « chrome/browser/net/dns_probe_test_util.cc ('k') | net/dns/dns_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698