| 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 // This test suite uses SSLClientSocket to test the implementation of | 5 // This test suite uses SSLClientSocket to test the implementation of |
| 6 // SSLServerSocket. In order to establish connections between the sockets | 6 // SSLServerSocket. In order to establish connections between the sockets |
| 7 // we need two additional classes: | 7 // we need two additional classes: |
| 8 // 1. FakeSocket | 8 // 1. FakeSocket |
| 9 // Connects SSL socket to FakeDataChannel. This class is just a stub. | 9 // Connects SSL socket to FakeDataChannel. This class is just a stub. |
| 10 // | 10 // |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 const CompletionCallback& callback) override { | 265 const CompletionCallback& callback) override { |
| 266 // Write random number of bytes. | 266 // Write random number of bytes. |
| 267 buf_len = rand() % buf_len + 1; | 267 buf_len = rand() % buf_len + 1; |
| 268 return outgoing_->Write(buf, buf_len, callback); | 268 return outgoing_->Write(buf, buf_len, callback); |
| 269 } | 269 } |
| 270 | 270 |
| 271 int SetReceiveBufferSize(int32_t size) override { return OK; } | 271 int SetReceiveBufferSize(int32_t size) override { return OK; } |
| 272 | 272 |
| 273 int SetSendBufferSize(int32_t size) override { return OK; } | 273 int SetSendBufferSize(int32_t size) override { return OK; } |
| 274 | 274 |
| 275 int SetDoNotFragment(bool do_not_fragment) override { return OK; } |
| 276 |
| 275 int Connect(const CompletionCallback& callback) override { return OK; } | 277 int Connect(const CompletionCallback& callback) override { return OK; } |
| 276 | 278 |
| 277 void Disconnect() override { | 279 void Disconnect() override { |
| 278 incoming_->Close(); | 280 incoming_->Close(); |
| 279 outgoing_->Close(); | 281 outgoing_->Close(); |
| 280 } | 282 } |
| 281 | 283 |
| 282 bool IsConnected() const override { return true; } | 284 bool IsConnected() const override { return true; } |
| 283 | 285 |
| 284 bool IsConnectedAndIdle() const override { return true; } | 286 bool IsConnectedAndIdle() const override { return true; } |
| (...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1118 int server_ret = server_socket_->Handshake(handshake_callback.callback()); | 1120 int server_ret = server_socket_->Handshake(handshake_callback.callback()); |
| 1119 | 1121 |
| 1120 client_ret = connect_callback.GetResult(client_ret); | 1122 client_ret = connect_callback.GetResult(client_ret); |
| 1121 server_ret = handshake_callback.GetResult(server_ret); | 1123 server_ret = handshake_callback.GetResult(server_ret); |
| 1122 | 1124 |
| 1123 ASSERT_THAT(client_ret, IsError(ERR_SSL_VERSION_OR_CIPHER_MISMATCH)); | 1125 ASSERT_THAT(client_ret, IsError(ERR_SSL_VERSION_OR_CIPHER_MISMATCH)); |
| 1124 ASSERT_THAT(server_ret, IsError(ERR_SSL_VERSION_OR_CIPHER_MISMATCH)); | 1126 ASSERT_THAT(server_ret, IsError(ERR_SSL_VERSION_OR_CIPHER_MISMATCH)); |
| 1125 } | 1127 } |
| 1126 | 1128 |
| 1127 } // namespace net | 1129 } // namespace net |
| OLD | NEW |