| 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/address_sorter_posix.h" | 5 #include "net/dns/address_sorter_posix.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
| 10 #include "net/base/net_util.h" | 10 #include "net/base/net_util.h" |
| 11 #include "net/base/test_completion_callback.h" | 11 #include "net/base/test_completion_callback.h" |
| 12 #include "net/socket/client_socket_factory.h" | 12 #include "net/socket/client_socket_factory.h" |
| 13 #include "net/socket/ssl_client_socket.h" | 13 #include "net/socket/ssl_client_socket.h" |
| 14 #include "net/socket/ssl_host_info.h" |
| 14 #include "net/socket/stream_socket.h" | 15 #include "net/socket/stream_socket.h" |
| 15 #include "net/udp/datagram_client_socket.h" | 16 #include "net/udp/datagram_client_socket.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 18 |
| 18 namespace net { | 19 namespace net { |
| 19 namespace { | 20 namespace { |
| 20 | 21 |
| 21 // Used to map destination address to source address. | 22 // Used to map destination address to source address. |
| 22 typedef std::map<IPAddressNumber, IPAddressNumber> AddressMapping; | 23 typedef std::map<IPAddressNumber, IPAddressNumber> AddressMapping; |
| 23 | 24 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 const AddressList&, | 104 const AddressList&, |
| 104 NetLog*, | 105 NetLog*, |
| 105 const NetLog::Source&) OVERRIDE { | 106 const NetLog::Source&) OVERRIDE { |
| 106 NOTIMPLEMENTED(); | 107 NOTIMPLEMENTED(); |
| 107 return scoped_ptr<StreamSocket>(); | 108 return scoped_ptr<StreamSocket>(); |
| 108 } | 109 } |
| 109 virtual scoped_ptr<SSLClientSocket> CreateSSLClientSocket( | 110 virtual scoped_ptr<SSLClientSocket> CreateSSLClientSocket( |
| 110 scoped_ptr<ClientSocketHandle>, | 111 scoped_ptr<ClientSocketHandle>, |
| 111 const HostPortPair&, | 112 const HostPortPair&, |
| 112 const SSLConfig&, | 113 const SSLConfig&, |
| 114 SSLHostInfo* ssl_host_info, |
| 113 const SSLClientSocketContext&) OVERRIDE { | 115 const SSLClientSocketContext&) OVERRIDE { |
| 114 NOTIMPLEMENTED(); | 116 NOTIMPLEMENTED(); |
| 117 delete ssl_host_info; |
| 115 return scoped_ptr<SSLClientSocket>(); | 118 return scoped_ptr<SSLClientSocket>(); |
| 116 } | 119 } |
| 117 virtual void ClearSSLSessionCache() OVERRIDE { | 120 virtual void ClearSSLSessionCache() OVERRIDE { |
| 118 NOTIMPLEMENTED(); | 121 NOTIMPLEMENTED(); |
| 119 } | 122 } |
| 120 | 123 |
| 121 void AddMapping(const IPAddressNumber& dst, const IPAddressNumber& src) { | 124 void AddMapping(const IPAddressNumber& dst, const IPAddressNumber& src) { |
| 122 mapping_[dst] = src; | 125 mapping_[dst] = src; |
| 123 } | 126 } |
| 124 | 127 |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 AddMapping("4000::1", "4000::10"); // global unicast | 321 AddMapping("4000::1", "4000::10"); // global unicast |
| 319 AddMapping("ff32::2", "fe81::20"); // deprecated link-local multicast | 322 AddMapping("ff32::2", "fe81::20"); // deprecated link-local multicast |
| 320 GetSourceInfo("fe81::20")->deprecated = true; | 323 GetSourceInfo("fe81::20")->deprecated = true; |
| 321 const char* addresses[] = { "ff3e::1", "ff32::2", "4000::1", "ff32::1", "::1", | 324 const char* addresses[] = { "ff3e::1", "ff32::2", "4000::1", "ff32::1", "::1", |
| 322 "8.0.0.1", NULL }; | 325 "8.0.0.1", NULL }; |
| 323 const int order[] = { 4, 3, 0, 2, 1, -1 }; | 326 const int order[] = { 4, 3, 0, 2, 1, -1 }; |
| 324 Verify(addresses, order); | 327 Verify(addresses, order); |
| 325 } | 328 } |
| 326 | 329 |
| 327 } // namespace net | 330 } // namespace net |
| OLD | NEW |