Chromium Code Reviews| Index: net/dns/dns_test_util.h |
| diff --git a/net/dns/dns_test_util.h b/net/dns/dns_test_util.h |
| index 53a0620cb6c289055bcbde83919512d78b4e501b..55ae2518fa8c36df1e9490be08ebc3fe45b0919f 100644 |
| --- a/net/dns/dns_test_util.h |
| +++ b/net/dns/dns_test_util.h |
| @@ -5,6 +5,9 @@ |
| #ifndef NET_DNS_DNS_TEST_UTIL_H_ |
| #define NET_DNS_DNS_TEST_UTIL_H_ |
| +#include <string> |
| +#include <vector> |
| + |
| #include "base/basictypes.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "net/dns/dns_config_service.h" |
| @@ -166,8 +169,23 @@ static const int kT3TTL = 0x00000015; |
| static const unsigned kT3RecordCount = arraysize(kT3IpAddresses) + 2; |
| class DnsClient; |
| + |
| +struct MockDnsClientRule { |
| + std::string prefix; |
| + uint16 qtype; |
| + enum Result { |
| + FAIL_SYNC, // Fail synchronously with ERR_NAME_NOT_RESOLVED. |
| + FAIL_ASYNC, // Fail asynchronously with ERR_NAME_NOT_RESOLVED. |
| + EMPTY, // Return an empty response. |
| + OK, // Return a response with loopback address. |
| + } result; |
|
mmenke
2012/08/09 19:51:11
Don't think the style guide allows declaring an en
|
| +}; |
| + |
| +typedef std::vector<MockDnsClientRule> MockDnsClientRuleList; |
| + |
| // Creates mock DnsClient for testing HostResolverImpl. |
| -scoped_ptr<DnsClient> CreateMockDnsClient(const DnsConfig& config); |
| +scoped_ptr<DnsClient> CreateMockDnsClient(const DnsConfig& config, |
| + const MockDnsClientRuleList& rules); |
| class MockDnsConfigService : public DnsConfigService { |
| public: |