| 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" |
| (...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 SSLFailureState MockClientSocket::GetSSLFailureState() const { | 893 SSLFailureState MockClientSocket::GetSSLFailureState() const { |
| 894 return IsConnected() ? SSL_FAILURE_NONE : SSL_FAILURE_UNKNOWN; | 894 return IsConnected() ? SSL_FAILURE_NONE : SSL_FAILURE_UNKNOWN; |
| 895 } | 895 } |
| 896 | 896 |
| 897 SSLClientSocket::NextProtoStatus MockClientSocket::GetNextProto( | 897 SSLClientSocket::NextProtoStatus MockClientSocket::GetNextProto( |
| 898 std::string* proto) const { | 898 std::string* proto) const { |
| 899 proto->clear(); | 899 proto->clear(); |
| 900 return SSLClientSocket::kNextProtoUnsupported; | 900 return SSLClientSocket::kNextProtoUnsupported; |
| 901 } | 901 } |
| 902 | 902 |
| 903 scoped_refptr<X509Certificate> | |
| 904 MockClientSocket::GetUnverifiedServerCertificateChain() const { | |
| 905 NOTREACHED(); | |
| 906 return NULL; | |
| 907 } | |
| 908 | |
| 909 MockClientSocket::~MockClientSocket() {} | 903 MockClientSocket::~MockClientSocket() {} |
| 910 | 904 |
| 911 void MockClientSocket::RunCallbackAsync(const CompletionCallback& callback, | 905 void MockClientSocket::RunCallbackAsync(const CompletionCallback& callback, |
| 912 int result) { | 906 int result) { |
| 913 base::MessageLoop::current()->PostTask( | 907 base::MessageLoop::current()->PostTask( |
| 914 FROM_HERE, | 908 FROM_HERE, |
| 915 base::Bind(&MockClientSocket::RunCallback, | 909 base::Bind(&MockClientSocket::RunCallback, |
| 916 weak_factory_.GetWeakPtr(), | 910 weak_factory_.GetWeakPtr(), |
| 917 callback, | 911 callback, |
| 918 result)); | 912 result)); |
| (...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2042 | 2036 |
| 2043 const char kSOCKS5OkRequest[] = | 2037 const char kSOCKS5OkRequest[] = |
| 2044 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; | 2038 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; |
| 2045 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); | 2039 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); |
| 2046 | 2040 |
| 2047 const char kSOCKS5OkResponse[] = | 2041 const char kSOCKS5OkResponse[] = |
| 2048 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; | 2042 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; |
| 2049 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); | 2043 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); |
| 2050 | 2044 |
| 2051 } // namespace net | 2045 } // namespace net |
| OLD | NEW |