OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "base/scoped_ptr.h" | 5 #include "base/scoped_ptr.h" |
6 #include "net/base/address_list.h" | 6 #include "net/base/address_list.h" |
7 #include "net/base/mock_host_resolver.h" | 7 #include "net/base/mock_host_resolver.h" |
8 #include "net/base/net_errors.h" | 8 #include "net/base/net_errors.h" |
9 #include "net/base/net_log.h" | 9 #include "net/base/net_log.h" |
10 #include "net/base/net_util.h" | 10 #include "net/base/net_util.h" |
11 #include "net/base/sys_addrinfo.h" | 11 #include "net/base/sys_addrinfo.h" |
(...skipping 29 matching lines...) Expand all Loading... |
41 virtual void Shutdown() {} | 41 virtual void Shutdown() {} |
42 | 42 |
43 private: | 43 private: |
44 ~MockHostResolverWithMultipleResults() {} | 44 ~MockHostResolverWithMultipleResults() {} |
45 | 45 |
46 // Resolves an IP literal to an address list. | 46 // Resolves an IP literal to an address list. |
47 AddressList ResolveIPLiteral(const char* ip_literal) { | 47 AddressList ResolveIPLiteral(const char* ip_literal) { |
48 AddressList result; | 48 AddressList result; |
49 int rv = SystemHostResolverProc(ip_literal, | 49 int rv = SystemHostResolverProc(ip_literal, |
50 ADDRESS_FAMILY_UNSPECIFIED, | 50 ADDRESS_FAMILY_UNSPECIFIED, |
51 0, | |
52 &result); | 51 &result); |
53 EXPECT_EQ(OK, rv); | 52 EXPECT_EQ(OK, rv); |
54 EXPECT_EQ(NULL, result.head()->ai_next); | 53 EXPECT_EQ(NULL, result.head()->ai_next); |
55 return result; | 54 return result; |
56 } | 55 } |
57 | 56 |
58 // Builds an AddressList that is |ip_literal| + |address_list|. | 57 // Builds an AddressList that is |ip_literal| + |address_list|. |
59 // |orig_list| must not be empty. | 58 // |orig_list| must not be empty. |
60 AddressList PrependAddressToList(const char* ip_literal, | 59 AddressList PrependAddressToList(const char* ip_literal, |
61 const AddressList& orig_list) { | 60 const AddressList& orig_list) { |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 182 |
184 EXPECT_EQ("192.168.1.1;172.22.34.1;200.100.1.2", | 183 EXPECT_EQ("192.168.1.1;172.22.34.1;200.100.1.2", |
185 bindings->MyIpAddressEx()); | 184 bindings->MyIpAddressEx()); |
186 | 185 |
187 EXPECT_EQ("192.168.1.1;172.22.34.1;200.100.1.2", | 186 EXPECT_EQ("192.168.1.1;172.22.34.1;200.100.1.2", |
188 bindings->DnsResolveEx("FOO")); | 187 bindings->DnsResolveEx("FOO")); |
189 } | 188 } |
190 | 189 |
191 } // namespace | 190 } // namespace |
192 } // namespace net | 191 } // namespace net |
OLD | NEW |