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

Unified Diff: trunk/src/net/dns/dns_test_util.h

Issue 23102009: Revert 218616 "[net/dns] Perform A/AAAA queries for AF_UNSPEC re..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 4 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
« no previous file with comments | « trunk/src/net/base/priority_queue_unittest.cc ('k') | trunk/src/net/dns/dns_test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/net/dns/dns_test_util.h
===================================================================
--- trunk/src/net/dns/dns_test_util.h (revision 219026)
+++ trunk/src/net/dns/dns_test_util.h (working copy)
@@ -10,7 +10,6 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
-#include "net/dns/dns_client.h"
#include "net/dns/dns_config_service.h"
#include "net/dns/dns_protocol.h"
@@ -175,9 +174,7 @@
// +2 for the CNAME records, +1 for TXT record.
static const unsigned kT3RecordCount = arraysize(kT3IpAddresses) + 3;
-class AddressSorter;
class DnsClient;
-class MockTransactionFactory;
struct MockDnsClientRule {
enum Result {
@@ -187,44 +184,22 @@
OK, // Return a response with loopback address.
};
- // If |delay| is true, matching transactions will be delayed until triggered
- // by the consumer.
MockDnsClientRule(const std::string& prefix_arg,
uint16 qtype_arg,
- Result result_arg,
- bool delay)
- : result(result_arg), prefix(prefix_arg), qtype(qtype_arg),
- delay(delay) {}
+ Result result_arg)
+ : result(result_arg), prefix(prefix_arg), qtype(qtype_arg) { }
Result result;
std::string prefix;
uint16 qtype;
- bool delay;
};
typedef std::vector<MockDnsClientRule> MockDnsClientRuleList;
-// MockDnsClient provides MockTransactionFactory.
-class MockDnsClient : public DnsClient {
- public:
- MockDnsClient(const DnsConfig& config, const MockDnsClientRuleList& rules);
- virtual ~MockDnsClient();
+// Creates mock DnsClient for testing HostResolverImpl.
+scoped_ptr<DnsClient> CreateMockDnsClient(const DnsConfig& config,
+ const MockDnsClientRuleList& rules);
- // DnsClient interface:
- virtual void SetConfig(const DnsConfig& config) OVERRIDE;
- virtual const DnsConfig* GetConfig() const OVERRIDE;
- virtual DnsTransactionFactory* GetTransactionFactory() OVERRIDE;
- virtual AddressSorter* GetAddressSorter() OVERRIDE;
-
- // Completes all DnsTransactions that were delayed by a rule.
- void CompleteDelayedTransactions();
-
- private:
- DnsConfig config_;
- scoped_ptr<MockTransactionFactory> factory_;
- scoped_ptr<AddressSorter> address_sorter_;
-};
-
} // namespace net
#endif // NET_DNS_DNS_TEST_UTIL_H_
Property changes on: trunk\src\net\dns\dns_test_util.h
___________________________________________________________________
Deleted: svn:mergeinfo
« no previous file with comments | « trunk/src/net/base/priority_queue_unittest.cc ('k') | trunk/src/net/dns/dns_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698