| 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 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 return MockClientSocket::GetPeerAddress(address); | 1015 return MockClientSocket::GetPeerAddress(address); |
| 1016 | 1016 |
| 1017 *address = addresses_[0]; | 1017 *address = addresses_[0]; |
| 1018 return OK; | 1018 return OK; |
| 1019 } | 1019 } |
| 1020 | 1020 |
| 1021 bool MockTCPClientSocket::WasEverUsed() const { | 1021 bool MockTCPClientSocket::WasEverUsed() const { |
| 1022 return was_used_to_convey_data_; | 1022 return was_used_to_convey_data_; |
| 1023 } | 1023 } |
| 1024 | 1024 |
| 1025 bool MockTCPClientSocket::UsingTCPFastOpen() const { | |
| 1026 return false; | |
| 1027 } | |
| 1028 | |
| 1029 void MockTCPClientSocket::EnableTCPFastOpenIfSupported() { | 1025 void MockTCPClientSocket::EnableTCPFastOpenIfSupported() { |
| 1030 EXPECT_FALSE(IsConnected()) << "Can't enable fast open after connect."; | 1026 EXPECT_FALSE(IsConnected()) << "Can't enable fast open after connect."; |
| 1031 | 1027 |
| 1032 data_->OnEnableTCPFastOpenIfSupported(); | 1028 data_->OnEnableTCPFastOpenIfSupported(); |
| 1033 } | 1029 } |
| 1034 | 1030 |
| 1035 bool MockTCPClientSocket::WasNpnNegotiated() const { | 1031 bool MockTCPClientSocket::WasNpnNegotiated() const { |
| 1036 return false; | 1032 return false; |
| 1037 } | 1033 } |
| 1038 | 1034 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1193 } | 1189 } |
| 1194 | 1190 |
| 1195 bool MockSSLClientSocket::IsConnectedAndIdle() const { | 1191 bool MockSSLClientSocket::IsConnectedAndIdle() const { |
| 1196 return transport_->socket()->IsConnectedAndIdle(); | 1192 return transport_->socket()->IsConnectedAndIdle(); |
| 1197 } | 1193 } |
| 1198 | 1194 |
| 1199 bool MockSSLClientSocket::WasEverUsed() const { | 1195 bool MockSSLClientSocket::WasEverUsed() const { |
| 1200 return transport_->socket()->WasEverUsed(); | 1196 return transport_->socket()->WasEverUsed(); |
| 1201 } | 1197 } |
| 1202 | 1198 |
| 1203 bool MockSSLClientSocket::UsingTCPFastOpen() const { | |
| 1204 return transport_->socket()->UsingTCPFastOpen(); | |
| 1205 } | |
| 1206 | |
| 1207 int MockSSLClientSocket::GetPeerAddress(IPEndPoint* address) const { | 1199 int MockSSLClientSocket::GetPeerAddress(IPEndPoint* address) const { |
| 1208 return transport_->socket()->GetPeerAddress(address); | 1200 return transport_->socket()->GetPeerAddress(address); |
| 1209 } | 1201 } |
| 1210 | 1202 |
| 1211 bool MockSSLClientSocket::GetSSLInfo(SSLInfo* ssl_info) { | 1203 bool MockSSLClientSocket::GetSSLInfo(SSLInfo* ssl_info) { |
| 1212 ssl_info->Reset(); | 1204 ssl_info->Reset(); |
| 1213 ssl_info->cert = data_->cert; | 1205 ssl_info->cert = data_->cert; |
| 1214 ssl_info->client_cert_sent = data_->client_cert_sent; | 1206 ssl_info->client_cert_sent = data_->client_cert_sent; |
| 1215 ssl_info->channel_id_sent = data_->channel_id_sent; | 1207 ssl_info->channel_id_sent = data_->channel_id_sent; |
| 1216 ssl_info->connection_status = data_->connection_status; | 1208 ssl_info->connection_status = data_->connection_status; |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1726 } | 1718 } |
| 1727 | 1719 |
| 1728 int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size) { | 1720 int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size) { |
| 1729 int64_t total = 0; | 1721 int64_t total = 0; |
| 1730 for (const MockWrite* write = writes; write != writes + writes_size; ++write) | 1722 for (const MockWrite* write = writes; write != writes + writes_size; ++write) |
| 1731 total += write->data_len; | 1723 total += write->data_len; |
| 1732 return total; | 1724 return total; |
| 1733 } | 1725 } |
| 1734 | 1726 |
| 1735 } // namespace net | 1727 } // namespace net |
| OLD | NEW |