| 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..7046585fafcd413c7a07f72993143fc69706e744 100644
|
| --- a/net/dns/dns_transaction_unittest.cc
|
| +++ b/net/dns/dns_transaction_unittest.cc
|
| @@ -147,7 +147,7 @@ class TransactionHelper {
|
| DnsRecordParser parser = response->Parser();
|
| DnsResourceRecord record;
|
| for (int i = 0; i < expected_answer_count_; ++i) {
|
| - EXPECT_TRUE(parser.ParseRecord(&record));
|
| + EXPECT_TRUE(parser.ReadRecord(&record));
|
| }
|
| EXPECT_TRUE(parser.AtEnd());
|
| } else {
|
| @@ -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_;
|
| };
|
|
|