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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 scoped_ptr<DnsTransaction> transaction_; | 323 scoped_ptr<DnsTransaction> transaction_; |
324 int expected_answer_count_; | 324 int expected_answer_count_; |
325 bool cancel_in_callback_; | 325 bool cancel_in_callback_; |
326 bool quit_in_callback_; | 326 bool quit_in_callback_; |
327 | 327 |
328 bool completed_; | 328 bool completed_; |
329 }; | 329 }; |
330 | 330 |
331 class DnsTransactionTest : public testing::Test { | 331 class DnsTransactionTest : public testing::Test { |
332 public: | 332 public: |
333 DnsTransactionTest() : socket_factory_(NULL) {} | 333 DnsTransactionTest() {} |
334 | 334 |
335 // Generates |nameservers| for DnsConfig. | 335 // Generates |nameservers| for DnsConfig. |
336 void ConfigureNumServers(unsigned num_servers) { | 336 void ConfigureNumServers(unsigned num_servers) { |
337 CHECK_LE(num_servers, 255u); | 337 CHECK_LE(num_servers, 255u); |
338 config_.nameservers.clear(); | 338 config_.nameservers.clear(); |
339 IPAddressNumber dns_ip; | 339 IPAddressNumber dns_ip; |
340 { | 340 { |
341 bool rv = ParseIPLiteralToNumber("192.168.1.0", &dns_ip); | 341 bool rv = ParseIPLiteralToNumber("192.168.1.0", &dns_ip); |
342 EXPECT_TRUE(rv); | 342 EXPECT_TRUE(rv); |
343 } | 343 } |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 config_.timeout = TestTimeouts::tiny_timeout(); | 936 config_.timeout = TestTimeouts::tiny_timeout(); |
937 ConfigureFactory(); | 937 ConfigureFactory(); |
938 | 938 |
939 TransactionHelper helper0(".", dns_protocol::kTypeA, ERR_INVALID_ARGUMENT); | 939 TransactionHelper helper0(".", dns_protocol::kTypeA, ERR_INVALID_ARGUMENT); |
940 EXPECT_TRUE(helper0.Run(transaction_factory_.get())); | 940 EXPECT_TRUE(helper0.Run(transaction_factory_.get())); |
941 } | 941 } |
942 | 942 |
943 } // namespace | 943 } // namespace |
944 | 944 |
945 } // namespace net | 945 } // namespace net |
OLD | NEW |