| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_bio_adapter.h" | 5 #include "net/socket/socket_bio_adapter.h" |
| 6 | 6 |
| 7 #include <openssl/bio.h> | |
| 8 #include <openssl/err.h> | |
| 9 #include <openssl/ssl.h> | |
| 10 #include <string.h> | 7 #include <string.h> |
| 11 | 8 |
| 12 #include <memory> | 9 #include <memory> |
| 13 | 10 |
| 14 #include "base/location.h" | 11 #include "base/location.h" |
| 15 #include "base/logging.h" | 12 #include "base/logging.h" |
| 16 #include "base/macros.h" | 13 #include "base/macros.h" |
| 17 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
| 18 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
| 19 #include "crypto/openssl_util.h" | 16 #include "crypto/openssl_util.h" |
| 20 #include "net/base/address_list.h" | 17 #include "net/base/address_list.h" |
| 21 #include "net/base/net_errors.h" | 18 #include "net/base/net_errors.h" |
| 22 #include "net/log/net_log_source.h" | 19 #include "net/log/net_log_source.h" |
| 23 #include "net/socket/socket_test_util.h" | 20 #include "net/socket/socket_test_util.h" |
| 24 #include "net/socket/stream_socket.h" | 21 #include "net/socket/stream_socket.h" |
| 25 #include "net/ssl/openssl_ssl_util.h" | 22 #include "net/ssl/openssl_ssl_util.h" |
| 26 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
| 24 #include "third_party/boringssl/src/include/openssl/bio.h" |
| 25 #include "third_party/boringssl/src/include/openssl/err.h" |
| 26 #include "third_party/boringssl/src/include/openssl/ssl.h" |
| 27 | 27 |
| 28 namespace net { | 28 namespace net { |
| 29 | 29 |
| 30 class SocketBIOAdapterTest : public testing::Test, | 30 class SocketBIOAdapterTest : public testing::Test, |
| 31 public SocketBIOAdapter::Delegate { | 31 public SocketBIOAdapter::Delegate { |
| 32 protected: | 32 protected: |
| 33 std::unique_ptr<StreamSocket> MakeTestSocket(SocketDataProvider* data) { | 33 std::unique_ptr<StreamSocket> MakeTestSocket(SocketDataProvider* data) { |
| 34 data->set_connect_data(MockConnect(SYNCHRONOUS, OK)); | 34 data->set_connect_data(MockConnect(SYNCHRONOUS, OK)); |
| 35 factory_.AddSocketDataProvider(data); | 35 factory_.AddSocketDataProvider(data); |
| 36 std::unique_ptr<StreamSocket> socket = factory_.CreateTransportClientSocket( | 36 std::unique_ptr<StreamSocket> socket = factory_.CreateTransportClientSocket( |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 BIO_up_ref(bio.get()); | 608 BIO_up_ref(bio.get()); |
| 609 | 609 |
| 610 // Release the adapter. | 610 // Release the adapter. |
| 611 adapter.reset(); | 611 adapter.reset(); |
| 612 | 612 |
| 613 ExpectReadError(bio.get(), ERR_UNEXPECTED, tracer); | 613 ExpectReadError(bio.get(), ERR_UNEXPECTED, tracer); |
| 614 ExpectWriteError(bio.get(), ERR_UNEXPECTED, tracer); | 614 ExpectWriteError(bio.get(), ERR_UNEXPECTED, tracer); |
| 615 } | 615 } |
| 616 | 616 |
| 617 } // namespace net | 617 } // namespace net |
| OLD | NEW |