Chromium Code Reviews| 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 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 770 return NULL; | 770 return NULL; |
| 771 } | 771 } |
| 772 | 772 |
| 773 SSLClientSocket::NextProtoStatus | 773 SSLClientSocket::NextProtoStatus |
| 774 MockClientSocket::GetNextProto(std::string* proto, std::string* server_protos) { | 774 MockClientSocket::GetNextProto(std::string* proto, std::string* server_protos) { |
| 775 proto->clear(); | 775 proto->clear(); |
| 776 server_protos->clear(); | 776 server_protos->clear(); |
| 777 return SSLClientSocket::kNextProtoUnsupported; | 777 return SSLClientSocket::kNextProtoUnsupported; |
| 778 } | 778 } |
| 779 | 779 |
| 780 // Returns the certificate chain as presented by server. | |
|
wtc
2014/03/10 21:45:34
Nit: omit this comment. We just need to document t
haavardm
2014/03/11 18:43:21
Done.
| |
| 781 const scoped_refptr<X509Certificate> | |
| 782 MockClientSocket::GetUnverifiedServerCertificate() const { | |
| 783 NOTREACHED(); | |
| 784 return NULL; | |
| 785 } | |
| 786 | |
| 780 MockClientSocket::~MockClientSocket() {} | 787 MockClientSocket::~MockClientSocket() {} |
| 781 | 788 |
| 782 void MockClientSocket::RunCallbackAsync(const CompletionCallback& callback, | 789 void MockClientSocket::RunCallbackAsync(const CompletionCallback& callback, |
| 783 int result) { | 790 int result) { |
| 784 base::MessageLoop::current()->PostTask( | 791 base::MessageLoop::current()->PostTask( |
| 785 FROM_HERE, | 792 FROM_HERE, |
| 786 base::Bind(&MockClientSocket::RunCallback, | 793 base::Bind(&MockClientSocket::RunCallback, |
| 787 weak_factory_.GetWeakPtr(), | 794 weak_factory_.GetWeakPtr(), |
| 788 callback, | 795 callback, |
| 789 result)); | 796 result)); |
| (...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1888 | 1895 |
| 1889 const char kSOCKS5OkRequest[] = | 1896 const char kSOCKS5OkRequest[] = |
| 1890 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; | 1897 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; |
| 1891 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); | 1898 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); |
| 1892 | 1899 |
| 1893 const char kSOCKS5OkResponse[] = | 1900 const char kSOCKS5OkResponse[] = |
| 1894 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; | 1901 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; |
| 1895 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); | 1902 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); |
| 1896 | 1903 |
| 1897 } // namespace net | 1904 } // namespace net |
| OLD | NEW |