| 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),
|
|
|