| 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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 const SSLClientSocketContext& context) { | 679 const SSLClientSocketContext& context) { |
| 680 MockSSLClientSocket* socket = | 680 MockSSLClientSocket* socket = |
| 681 new MockSSLClientSocket(transport_socket, host_and_port, ssl_config, | 681 new MockSSLClientSocket(transport_socket, host_and_port, ssl_config, |
| 682 mock_ssl_data_.GetNext()); | 682 mock_ssl_data_.GetNext()); |
| 683 return socket; | 683 return socket; |
| 684 } | 684 } |
| 685 | 685 |
| 686 void MockClientSocketFactory::ClearSSLSessionCache() { | 686 void MockClientSocketFactory::ClearSSLSessionCache() { |
| 687 } | 687 } |
| 688 | 688 |
| 689 const char MockClientSocket::kTlsUnique[] = "MOCK_TLSUNIQ"; |
| 690 |
| 689 MockClientSocket::MockClientSocket(net::NetLog* net_log) | 691 MockClientSocket::MockClientSocket(net::NetLog* net_log) |
| 690 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), | 692 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), |
| 691 connected_(false), | 693 connected_(false), |
| 692 net_log_(BoundNetLog::Make(net_log, net::NetLog::SOURCE_NONE)) { | 694 net_log_(BoundNetLog::Make(net_log, net::NetLog::SOURCE_NONE)) { |
| 693 IPAddressNumber ip; | 695 IPAddressNumber ip; |
| 694 CHECK(ParseIPLiteralToNumber("192.0.2.33", &ip)); | 696 CHECK(ParseIPLiteralToNumber("192.0.2.33", &ip)); |
| 695 peer_addr_ = IPEndPoint(ip, 0); | 697 peer_addr_ = IPEndPoint(ip, 0); |
| 696 } | 698 } |
| 697 | 699 |
| 698 bool MockClientSocket::SetReceiveBufferSize(int32 size) { | 700 bool MockClientSocket::SetReceiveBufferSize(int32 size) { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 int MockClientSocket::ExportKeyingMaterial(const base::StringPiece& label, | 741 int MockClientSocket::ExportKeyingMaterial(const base::StringPiece& label, |
| 740 bool has_context, | 742 bool has_context, |
| 741 const base::StringPiece& context, | 743 const base::StringPiece& context, |
| 742 unsigned char* out, | 744 unsigned char* out, |
| 743 unsigned int outlen) { | 745 unsigned int outlen) { |
| 744 memset(out, 'A', outlen); | 746 memset(out, 'A', outlen); |
| 745 return OK; | 747 return OK; |
| 746 } | 748 } |
| 747 | 749 |
| 748 int MockClientSocket::GetTLSUniqueChannelBinding(std::string* out) { | 750 int MockClientSocket::GetTLSUniqueChannelBinding(std::string* out) { |
| 749 out->assign("MOCK_TLSUNIQ"); | 751 out->assign(MockClientSocket::kTlsUnique); |
| 750 return OK; | 752 return OK; |
| 751 } | 753 } |
| 752 | 754 |
| 753 ServerBoundCertService* MockClientSocket::GetServerBoundCertService() const { | 755 ServerBoundCertService* MockClientSocket::GetServerBoundCertService() const { |
| 754 NOTREACHED(); | 756 NOTREACHED(); |
| 755 return NULL; | 757 return NULL; |
| 756 } | 758 } |
| 757 | 759 |
| 758 SSLClientSocket::NextProtoStatus | 760 SSLClientSocket::NextProtoStatus |
| 759 MockClientSocket::GetNextProto(std::string* proto, std::string* server_protos) { | 761 MockClientSocket::GetNextProto(std::string* proto, std::string* server_protos) { |
| (...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1689 | 1691 |
| 1690 const char kSOCKS5OkRequest[] = | 1692 const char kSOCKS5OkRequest[] = |
| 1691 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; | 1693 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; |
| 1692 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); | 1694 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); |
| 1693 | 1695 |
| 1694 const char kSOCKS5OkResponse[] = | 1696 const char kSOCKS5OkResponse[] = |
| 1695 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; | 1697 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; |
| 1696 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); | 1698 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); |
| 1697 | 1699 |
| 1698 } // namespace net | 1700 } // namespace net |
| OLD | NEW |