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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 class DnsTransactionTest : public testing::Test { | 195 class DnsTransactionTest : public testing::Test { |
196 public: | 196 public: |
197 DnsTransactionTest() : socket_factory_(NULL) {} | 197 DnsTransactionTest() : socket_factory_(NULL) {} |
198 | 198 |
199 // Generates |nameservers| for DnsConfig. | 199 // Generates |nameservers| for DnsConfig. |
200 void ConfigureNumServers(unsigned num_servers) { | 200 void ConfigureNumServers(unsigned num_servers) { |
201 CHECK_LE(num_servers, 255u); | 201 CHECK_LE(num_servers, 255u); |
202 config_.nameservers.clear(); | 202 config_.nameservers.clear(); |
203 IPAddressNumber dns_ip; | 203 IPAddressNumber dns_ip; |
204 { | 204 { |
205 bool rv = ParseIPLiteralToNumber("192.128.1.0", &dns_ip); | 205 bool rv = ParseIPLiteralToNumber("192.168.1.0", &dns_ip); |
206 EXPECT_TRUE(rv); | 206 EXPECT_TRUE(rv); |
207 } | 207 } |
208 for (unsigned i = 0; i < num_servers; ++i) { | 208 for (unsigned i = 0; i < num_servers; ++i) { |
209 dns_ip[3] = i; | 209 dns_ip[3] = i; |
210 config_.nameservers.push_back(IPEndPoint(dns_ip, | 210 config_.nameservers.push_back(IPEndPoint(dns_ip, |
211 dns_protocol::kDefaultPort)); | 211 dns_protocol::kDefaultPort)); |
212 } | 212 } |
213 } | 213 } |
214 | 214 |
215 // Called after fully configuring |config|. | 215 // Called after fully configuring |config|. |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 TransactionHelper helper2("x", | 675 TransactionHelper helper2("x", |
676 dns_protocol::kTypeA, | 676 dns_protocol::kTypeA, |
677 ERR_NAME_NOT_RESOLVED); | 677 ERR_NAME_NOT_RESOLVED); |
678 EXPECT_TRUE(helper2.Run(transaction_factory_.get())); | 678 EXPECT_TRUE(helper2.Run(transaction_factory_.get())); |
679 } | 679 } |
680 | 680 |
681 } // namespace | 681 } // namespace |
682 | 682 |
683 } // namespace net | 683 } // namespace net |
684 | 684 |
OLD | NEW |