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

Unified Diff: net/dns/dns_transaction_unittest.cc

Issue 9369045: [net] HostResolverImpl + DnsTransaction + DnsConfigService = Asynchronous DNS ready for experiments. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ClientSocketFactory lifetime. Move ScopedAllowIO to StartWatch. Added DnsTask logging. Created 8 years, 10 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: net/dns/dns_transaction_unittest.cc
diff --git a/net/dns/dns_transaction_unittest.cc b/net/dns/dns_transaction_unittest.cc
index 8e0888a93a6f999908bb3687f34ed943e4441404..fd8d741c30e83d8e05e0f3640737523bf3378ab4 100644
--- a/net/dns/dns_transaction_unittest.cc
+++ b/net/dns/dns_transaction_unittest.cc
@@ -212,10 +212,10 @@ class DnsTransactionTest : public testing::Test {
// Called after fully configuring |config|.
void ConfigureFactory() {
- socket_factory_ = new TestSocketFactory();
+ socket_factory_.reset(new TestSocketFactory());
session_ = new DnsSession(
config_,
- socket_factory_,
+ socket_factory_.get(),
base::Bind(&DnsTransactionTest::GetNextId, base::Unretained(this)),
NULL /* NetLog */);
transaction_factory_ = DnsTransactionFactory::CreateFactory(session_.get());
@@ -232,7 +232,7 @@ class DnsTransactionTest : public testing::Test {
uint16 id,
const char* data,
size_t data_length) {
- CHECK(socket_factory_);
+ CHECK(socket_factory_.get());
DnsQuery* query = new DnsQuery(id, DomainFromDot(dotted_name), qtype);
queries_.push_back(query);
@@ -252,7 +252,7 @@ class DnsTransactionTest : public testing::Test {
// Add expected query of |dotted_name| and |qtype| and no response.
void AddTimeout(const char* dotted_name, uint16 qtype) {
- CHECK(socket_factory_);
+ CHECK(socket_factory_.get());
uint16 id = base::RandInt(0, kuint16max);
DnsQuery* query = new DnsQuery(id, DomainFromDot(dotted_name), qtype);
queries_.push_back(query);
@@ -268,7 +268,7 @@ class DnsTransactionTest : public testing::Test {
// Add expected query of |dotted_name| and |qtype| and response with no answer
// and rcode set to |rcode|.
void AddRcode(const char* dotted_name, uint16 qtype, int rcode) {
- CHECK(socket_factory_);
+ CHECK(socket_factory_.get());
CHECK_NE(dns_protocol::kRcodeNOERROR, rcode);
uint16 id = base::RandInt(0, kuint16max);
DnsQuery* query = new DnsQuery(id, DomainFromDot(dotted_name), qtype);
@@ -360,8 +360,7 @@ class DnsTransactionTest : public testing::Test {
ScopedVector<DelayedSocketData> socket_data_;
std::deque<int> transaction_ids_;
- // Owned by |session_|.
- TestSocketFactory* socket_factory_;
+ scoped_ptr<TestSocketFactory> socket_factory_;
scoped_refptr<DnsSession> session_;
scoped_ptr<DnsTransactionFactory> transaction_factory_;
};
« net/dns/dns_transaction.cc ('K') | « net/dns/dns_transaction.cc ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698