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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 #include <memory> | 10 #include <memory> |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 } | 245 } |
246 | 246 |
247 // Mark to call MessageLoop::QuitWhenIdle() upon callback. | 247 // Mark to call MessageLoop::QuitWhenIdle() upon callback. |
248 void set_quit_in_callback() { | 248 void set_quit_in_callback() { |
249 quit_in_callback_ = true; | 249 quit_in_callback_ = true; |
250 } | 250 } |
251 | 251 |
252 void StartTransaction(DnsTransactionFactory* factory) { | 252 void StartTransaction(DnsTransactionFactory* factory) { |
253 EXPECT_EQ(NULL, transaction_.get()); | 253 EXPECT_EQ(NULL, transaction_.get()); |
254 transaction_ = factory->CreateTransaction( | 254 transaction_ = factory->CreateTransaction( |
255 hostname_, | 255 hostname_, qtype_, base::Bind(&TransactionHelper::OnTransactionComplete, |
256 qtype_, | 256 base::Unretained(this)), |
257 base::Bind(&TransactionHelper::OnTransactionComplete, | 257 NetLogWithSource()); |
258 base::Unretained(this)), | |
259 BoundNetLog()); | |
260 EXPECT_EQ(hostname_, transaction_->GetHostname()); | 258 EXPECT_EQ(hostname_, transaction_->GetHostname()); |
261 EXPECT_EQ(qtype_, transaction_->GetType()); | 259 EXPECT_EQ(qtype_, transaction_->GetType()); |
262 transaction_->Start(); | 260 transaction_->Start(); |
263 } | 261 } |
264 | 262 |
265 void Cancel() { | 263 void Cancel() { |
266 ASSERT_TRUE(transaction_.get() != NULL); | 264 ASSERT_TRUE(transaction_.get() != NULL); |
267 transaction_.reset(NULL); | 265 transaction_.reset(NULL); |
268 } | 266 } |
269 | 267 |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 config_.timeout = TestTimeouts::tiny_timeout(); | 996 config_.timeout = TestTimeouts::tiny_timeout(); |
999 ConfigureFactory(); | 997 ConfigureFactory(); |
1000 | 998 |
1001 TransactionHelper helper0(".", dns_protocol::kTypeA, ERR_INVALID_ARGUMENT); | 999 TransactionHelper helper0(".", dns_protocol::kTypeA, ERR_INVALID_ARGUMENT); |
1002 EXPECT_TRUE(helper0.Run(transaction_factory_.get())); | 1000 EXPECT_TRUE(helper0.Run(transaction_factory_.get())); |
1003 } | 1001 } |
1004 | 1002 |
1005 } // namespace | 1003 } // namespace |
1006 | 1004 |
1007 } // namespace net | 1005 } // namespace net |
OLD | NEW |