OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 10 |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
685 | 685 |
686 int MockClientSocket::ExportKeyingMaterial(const base::StringPiece& label, | 686 int MockClientSocket::ExportKeyingMaterial(const base::StringPiece& label, |
687 const base::StringPiece& context, | 687 const base::StringPiece& context, |
688 unsigned char *out, | 688 unsigned char *out, |
689 unsigned int outlen) { | 689 unsigned int outlen) { |
690 NOTREACHED(); | 690 NOTREACHED(); |
691 return ERR_NOT_IMPLEMENTED; | 691 return ERR_NOT_IMPLEMENTED; |
692 } | 692 } |
693 | 693 |
694 SSLClientSocket::NextProtoStatus | 694 SSLClientSocket::NextProtoStatus |
695 MockClientSocket::GetNextProto(std::string* proto) { | 695 MockClientSocket::GetNextProto(std::string* proto, std::string* server_proto) { |
696 proto->clear(); | 696 proto->clear(); |
697 server_proto->clear(); | |
697 return SSLClientSocket::kNextProtoUnsupported; | 698 return SSLClientSocket::kNextProtoUnsupported; |
698 } | 699 } |
699 | 700 |
700 MockClientSocket::~MockClientSocket() {} | 701 MockClientSocket::~MockClientSocket() {} |
701 | 702 |
702 void MockClientSocket::RunCallbackAsync(net::OldCompletionCallback* callback, | 703 void MockClientSocket::RunCallbackAsync(net::OldCompletionCallback* callback, |
703 int result) { | 704 int result) { |
704 MessageLoop::current()->PostTask(FROM_HERE, | 705 MessageLoop::current()->PostTask(FROM_HERE, |
705 method_factory_.NewRunnableMethod( | 706 method_factory_.NewRunnableMethod( |
706 &MockClientSocket::RunCallback, callback, result)); | 707 &MockClientSocket::RunCallback, callback, result)); |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1147 if (data_->cert_request_info) { | 1148 if (data_->cert_request_info) { |
1148 cert_request_info->host_and_port = | 1149 cert_request_info->host_and_port = |
1149 data_->cert_request_info->host_and_port; | 1150 data_->cert_request_info->host_and_port; |
1150 cert_request_info->client_certs = data_->cert_request_info->client_certs; | 1151 cert_request_info->client_certs = data_->cert_request_info->client_certs; |
1151 } else { | 1152 } else { |
1152 cert_request_info->Reset(); | 1153 cert_request_info->Reset(); |
1153 } | 1154 } |
1154 } | 1155 } |
1155 | 1156 |
1156 SSLClientSocket::NextProtoStatus MockSSLClientSocket::GetNextProto( | 1157 SSLClientSocket::NextProtoStatus MockSSLClientSocket::GetNextProto( |
1157 std::string* proto) { | 1158 std::string* proto, std::string* server_proto) { |
agl
2011/12/05 16:38:10
s
ramant (doing other things)
2011/12/05 19:03:28
Done.
| |
1158 *proto = data_->next_proto; | 1159 *proto = data_->next_proto; |
1160 *server_proto = data_->protos; | |
agl
2011/12/05 16:38:10
s
ramant (doing other things)
2011/12/05 19:03:28
Done.
| |
1159 return data_->next_proto_status; | 1161 return data_->next_proto_status; |
1160 } | 1162 } |
1161 | 1163 |
1162 bool MockSSLClientSocket::was_npn_negotiated() const { | 1164 bool MockSSLClientSocket::was_npn_negotiated() const { |
1163 if (is_npn_state_set_) | 1165 if (is_npn_state_set_) |
1164 return new_npn_value_; | 1166 return new_npn_value_; |
1165 return data_->was_npn_negotiated; | 1167 return data_->was_npn_negotiated; |
1166 } | 1168 } |
1167 | 1169 |
1168 bool MockSSLClientSocket::set_was_npn_negotiated(bool negotiated) { | 1170 bool MockSSLClientSocket::set_was_npn_negotiated(bool negotiated) { |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1606 | 1608 |
1607 const char kSOCKS5OkRequest[] = | 1609 const char kSOCKS5OkRequest[] = |
1608 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; | 1610 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; |
1609 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); | 1611 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); |
1610 | 1612 |
1611 const char kSOCKS5OkResponse[] = | 1613 const char kSOCKS5OkResponse[] = |
1612 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; | 1614 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; |
1613 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); | 1615 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); |
1614 | 1616 |
1615 } // namespace net | 1617 } // namespace net |
OLD | NEW |