| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/dns/dns_transaction.h" | 5 #include "net/dns/dns_transaction.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 } | 295 } |
| 296 } | 296 } |
| 297 | 297 |
| 298 // Called after fully configuring |config|. | 298 // Called after fully configuring |config|. |
| 299 void ConfigureFactory() { | 299 void ConfigureFactory() { |
| 300 socket_factory_.reset(new TestSocketFactory()); | 300 socket_factory_.reset(new TestSocketFactory()); |
| 301 session_ = new DnsSession( | 301 session_ = new DnsSession( |
| 302 config_, | 302 config_, |
| 303 socket_factory_.get(), | 303 socket_factory_.get(), |
| 304 base::Bind(&DnsTransactionTest::GetNextId, base::Unretained(this)), | 304 base::Bind(&DnsTransactionTest::GetNextId, base::Unretained(this)), |
| 305 0, /* pool_size */ |
| 305 NULL /* NetLog */); | 306 NULL /* NetLog */); |
| 306 transaction_factory_ = DnsTransactionFactory::CreateFactory(session_.get()); | 307 transaction_factory_ = DnsTransactionFactory::CreateFactory(session_.get()); |
| 307 } | 308 } |
| 308 | 309 |
| 309 void AddSocketData(scoped_ptr<DnsSocketData> data) { | 310 void AddSocketData(scoped_ptr<DnsSocketData> data) { |
| 310 transaction_ids_.push_back(data->query_id()); | 311 transaction_ids_.push_back(data->query_id()); |
| 311 socket_factory_->AddSocketDataProvider(data->GetProvider()); | 312 socket_factory_->AddSocketDataProvider(data->GetProvider()); |
| 312 socket_data_.push_back(data.release()); | 313 socket_data_.push_back(data.release()); |
| 313 } | 314 } |
| 314 | 315 |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 AddSyncQueryAndResponse(2 /* id */, kT2HostName, kT2Qtype, | 799 AddSyncQueryAndResponse(2 /* id */, kT2HostName, kT2Qtype, |
| 799 kT2ResponseDatagram, arraysize(kT2ResponseDatagram)); | 800 kT2ResponseDatagram, arraysize(kT2ResponseDatagram)); |
| 800 | 801 |
| 801 TransactionHelper helper0("www", kT2Qtype, kT2RecordCount); | 802 TransactionHelper helper0("www", kT2Qtype, kT2RecordCount); |
| 802 EXPECT_TRUE(helper0.Run(transaction_factory_.get())); | 803 EXPECT_TRUE(helper0.Run(transaction_factory_.get())); |
| 803 } | 804 } |
| 804 | 805 |
| 805 } // namespace | 806 } // namespace |
| 806 | 807 |
| 807 } // namespace net | 808 } // namespace net |
| OLD | NEW |