| 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 <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 void StaticSocketDataProvider::Reset() { | 281 void StaticSocketDataProvider::Reset() { |
| 282 helper_.Reset(); | 282 helper_.Reset(); |
| 283 } | 283 } |
| 284 | 284 |
| 285 SSLSocketDataProvider::SSLSocketDataProvider(IoMode mode, int result) | 285 SSLSocketDataProvider::SSLSocketDataProvider(IoMode mode, int result) |
| 286 : connect(mode, result), | 286 : connect(mode, result), |
| 287 next_proto_status(SSLClientSocket::kNextProtoUnsupported), | 287 next_proto_status(SSLClientSocket::kNextProtoUnsupported), |
| 288 client_cert_sent(false), | 288 client_cert_sent(false), |
| 289 cert_request_info(NULL), | 289 cert_request_info(NULL), |
| 290 channel_id_sent(false), | 290 channel_id_sent(false), |
| 291 connection_status(0) { | 291 connection_status(0), |
| 292 cert_status(0) { |
| 292 SSLConnectionStatusSetVersion(SSL_CONNECTION_VERSION_TLS1_2, | 293 SSLConnectionStatusSetVersion(SSL_CONNECTION_VERSION_TLS1_2, |
| 293 &connection_status); | 294 &connection_status); |
| 294 // Set to TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 | 295 // Set to TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 |
| 295 SSLConnectionStatusSetCipherSuite(0xcc14, &connection_status); | 296 SSLConnectionStatusSetCipherSuite(0xcc14, &connection_status); |
| 296 } | 297 } |
| 297 | 298 |
| 298 SSLSocketDataProvider::~SSLSocketDataProvider() { | 299 SSLSocketDataProvider::~SSLSocketDataProvider() { |
| 299 } | 300 } |
| 300 | 301 |
| 301 void SSLSocketDataProvider::SetNextProto(NextProto proto) { | 302 void SSLSocketDataProvider::SetNextProto(NextProto proto) { |
| (...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1193 int MockSSLClientSocket::GetPeerAddress(IPEndPoint* address) const { | 1194 int MockSSLClientSocket::GetPeerAddress(IPEndPoint* address) const { |
| 1194 return transport_->socket()->GetPeerAddress(address); | 1195 return transport_->socket()->GetPeerAddress(address); |
| 1195 } | 1196 } |
| 1196 | 1197 |
| 1197 bool MockSSLClientSocket::GetSSLInfo(SSLInfo* ssl_info) { | 1198 bool MockSSLClientSocket::GetSSLInfo(SSLInfo* ssl_info) { |
| 1198 ssl_info->Reset(); | 1199 ssl_info->Reset(); |
| 1199 ssl_info->cert = data_->cert; | 1200 ssl_info->cert = data_->cert; |
| 1200 ssl_info->client_cert_sent = data_->client_cert_sent; | 1201 ssl_info->client_cert_sent = data_->client_cert_sent; |
| 1201 ssl_info->channel_id_sent = data_->channel_id_sent; | 1202 ssl_info->channel_id_sent = data_->channel_id_sent; |
| 1202 ssl_info->connection_status = data_->connection_status; | 1203 ssl_info->connection_status = data_->connection_status; |
| 1204 ssl_info->cert_status = data_->cert_status; |
| 1203 return true; | 1205 return true; |
| 1204 } | 1206 } |
| 1205 | 1207 |
| 1206 void MockSSLClientSocket::GetSSLCertRequestInfo( | 1208 void MockSSLClientSocket::GetSSLCertRequestInfo( |
| 1207 SSLCertRequestInfo* cert_request_info) { | 1209 SSLCertRequestInfo* cert_request_info) { |
| 1208 DCHECK(cert_request_info); | 1210 DCHECK(cert_request_info); |
| 1209 if (data_->cert_request_info) { | 1211 if (data_->cert_request_info) { |
| 1210 cert_request_info->host_and_port = | 1212 cert_request_info->host_and_port = |
| 1211 data_->cert_request_info->host_and_port; | 1213 data_->cert_request_info->host_and_port; |
| 1212 cert_request_info->client_certs = data_->cert_request_info->client_certs; | 1214 cert_request_info->client_certs = data_->cert_request_info->client_certs; |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1695 } | 1697 } |
| 1696 | 1698 |
| 1697 int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size) { | 1699 int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size) { |
| 1698 int64_t total = 0; | 1700 int64_t total = 0; |
| 1699 for (const MockWrite* write = writes; write != writes + writes_size; ++write) | 1701 for (const MockWrite* write = writes; write != writes + writes_size; ++write) |
| 1700 total += write->data_len; | 1702 total += write->data_len; |
| 1701 return total; | 1703 return total; |
| 1702 } | 1704 } |
| 1703 | 1705 |
| 1704 } // namespace net | 1706 } // namespace net |
| OLD | NEW |