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/socket/socket_test_util.h" | 5 #include "net/socket/socket_test_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
16 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
18 #include "net/base/address_family.h" | 18 #include "net/base/address_family.h" |
19 #include "net/base/address_list.h" | 19 #include "net/base/address_list.h" |
20 #include "net/base/auth.h" | 20 #include "net/base/auth.h" |
21 #include "net/base/load_timing_info.h" | 21 #include "net/base/load_timing_info.h" |
22 #include "net/http/http_network_session.h" | 22 #include "net/http/http_network_session.h" |
23 #include "net/http/http_request_headers.h" | 23 #include "net/http/http_request_headers.h" |
24 #include "net/http/http_response_headers.h" | 24 #include "net/http/http_response_headers.h" |
25 #include "net/socket/socket.h" | 25 #include "net/socket/socket.h" |
26 #include "net/socket/websocket_endpoint_lock_manager.h" | 26 #include "net/socket/websocket_endpoint_lock_manager.h" |
27 #include "net/ssl/ssl_cert_request_info.h" | 27 #include "net/ssl/ssl_cert_request_info.h" |
28 #include "net/ssl/ssl_connection_status_flags.h" | 28 #include "net/ssl/ssl_connection_status_flags.h" |
| 29 #include "net/ssl/ssl_failure_state.h" |
29 #include "net/ssl/ssl_info.h" | 30 #include "net/ssl/ssl_info.h" |
30 #include "testing/gtest/include/gtest/gtest.h" | 31 #include "testing/gtest/include/gtest/gtest.h" |
31 | 32 |
32 #define NET_TRACE(level, s) VLOG(level) << s << __FUNCTION__ << "() " | 33 #define NET_TRACE(level, s) VLOG(level) << s << __FUNCTION__ << "() " |
33 | 34 |
34 namespace net { | 35 namespace net { |
35 | 36 |
36 namespace { | 37 namespace { |
37 | 38 |
38 inline char AsciifyHigh(char x) { | 39 inline char AsciifyHigh(char x) { |
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1022 int MockClientSocket::GetTLSUniqueChannelBinding(std::string* out) { | 1023 int MockClientSocket::GetTLSUniqueChannelBinding(std::string* out) { |
1023 out->assign(MockClientSocket::kTlsUnique); | 1024 out->assign(MockClientSocket::kTlsUnique); |
1024 return OK; | 1025 return OK; |
1025 } | 1026 } |
1026 | 1027 |
1027 ChannelIDService* MockClientSocket::GetChannelIDService() const { | 1028 ChannelIDService* MockClientSocket::GetChannelIDService() const { |
1028 NOTREACHED(); | 1029 NOTREACHED(); |
1029 return NULL; | 1030 return NULL; |
1030 } | 1031 } |
1031 | 1032 |
| 1033 SSLFailureState MockClientSocket::GetSSLFailureState() const { |
| 1034 return IsConnected() ? SSL_FAILURE_NONE : SSL_FAILURE_UNKNOWN; |
| 1035 } |
| 1036 |
1032 SSLClientSocket::NextProtoStatus MockClientSocket::GetNextProto( | 1037 SSLClientSocket::NextProtoStatus MockClientSocket::GetNextProto( |
1033 std::string* proto) const { | 1038 std::string* proto) const { |
1034 proto->clear(); | 1039 proto->clear(); |
1035 return SSLClientSocket::kNextProtoUnsupported; | 1040 return SSLClientSocket::kNextProtoUnsupported; |
1036 } | 1041 } |
1037 | 1042 |
1038 scoped_refptr<X509Certificate> | 1043 scoped_refptr<X509Certificate> |
1039 MockClientSocket::GetUnverifiedServerCertificateChain() const { | 1044 MockClientSocket::GetUnverifiedServerCertificateChain() const { |
1040 NOTREACHED(); | 1045 NOTREACHED(); |
1041 return NULL; | 1046 return NULL; |
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2179 | 2184 |
2180 const char kSOCKS5OkRequest[] = | 2185 const char kSOCKS5OkRequest[] = |
2181 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; | 2186 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; |
2182 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); | 2187 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); |
2183 | 2188 |
2184 const char kSOCKS5OkResponse[] = | 2189 const char kSOCKS5OkResponse[] = |
2185 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; | 2190 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; |
2186 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); | 2191 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); |
2187 | 2192 |
2188 } // namespace net | 2193 } // namespace net |
OLD | NEW |