diff options
author | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-18 08:02:08 +0000 |
---|---|---|
committer | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-18 08:02:08 +0000 |
commit | 40f153572764e76066588fd2e358d05b8fa453bb (patch) | |
tree | 9c8bf3de47da4fac879d1035addf2a6780f163e4 /net/base/address_list.h | |
parent | a2c2fb9ff48cd37dbed258dca5b40461c92b71a8 (diff) | |
download | chromium_src-40f153572764e76066588fd2e358d05b8fa453bb.zip chromium_src-40f153572764e76066588fd2e358d05b8fa453bb.tar.gz chromium_src-40f153572764e76066588fd2e358d05b8fa453bb.tar.bz2 |
Use manually constructed IPv6 socket addresses for tests, rather than system created ones.
The advantage is that GURL's parsing of IPv6 addresses works on all systems, whereas getaddrinfo(ipv6_literal) only succeeds on IPv6 enabled systems.
This allows the tests to run consistently on all systems, including our own WinXP buildbots (which do not support IPv6).
BUG=http://crbug.com/16452
TEST=[net_unittests] SOCKS5ClientSocketTest.IPv6Domain, SOCKSClientSocketTest.SOCKS4AIfDomainInIPv6
Review URL: http://codereview.chromium.org/155618
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21053 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/address_list.h')
-rw-r--r-- | net/base/address_list.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/base/address_list.h b/net/base/address_list.h index 506350b..165086c 100644 --- a/net/base/address_list.h +++ b/net/base/address_list.h @@ -15,6 +15,9 @@ namespace net { // class is designed to be copied around by value. class AddressList { public: + // Constructs an empty address list. + AddressList() {} + // Adopt the given addrinfo list in place of the existing one if any. This // hands over responsibility for freeing the addrinfo list to the AddressList // object. @@ -41,6 +44,9 @@ class AddressList { // empty state as when first constructed. void Reset(); + // Used by unit-tests to manually set the TCP socket address. + static AddressList CreateIPv6Address(unsigned char data[16]); + // Get access to the head of the addrinfo list. const struct addrinfo* head() const { return data_->head; } @@ -54,6 +60,9 @@ class AddressList { // Indicates which free function to use for |head|. bool is_system_created; }; + + explicit AddressList(Data* data) : data_(data) {} + scoped_refptr<Data> data_; }; |