#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/webrtc/fake_ssl_client_socket.h"
#include <stddef.h>
#include <stdint.h>
#include <algorithm>
#include <memory>
#include <string_view>
#include <utility>
#include <vector>
#include "base/memory/ref_counted.h"
#include "base/test/task_environment.h"
#include "net/base/completion_once_callback.h"
#include "net/base/completion_repeating_callback.h"
#include "net/base/io_buffer.h"
#include "net/base/ip_address.h"
#include "net/base/test_completion_callback.h"
#include "net/log/net_log_source.h"
#include "net/log/net_log_with_source.h"
#include "net/socket/socket_tag.h"
#include "net/socket/socket_test_util.h"
#include "net/socket/stream_socket.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace webrtc {
namespace {
Return;
ReturnRef;
enum HandshakeErrorLocation { … };
enum { … };
class MockClientSocket : public net::StreamSocket { … };
template <net::MockReadWriteType type>
void AddChunkedOps(std::string_view data,
size_t chunk_size,
net::IoMode mode,
std::vector<net::MockReadWrite<type>>* ops) { … }
class FakeSSLClientSocketTest : public testing::Test { … };
TEST_F(FakeSSLClientSocketTest, PassThroughMethods) { … }
TEST_F(FakeSSLClientSocketTest, SuccessfulHandshakeSync) { … }
TEST_F(FakeSSLClientSocketTest, SuccessfulHandshakeAsync) { … }
TEST_F(FakeSSLClientSocketTest, ResetSocket) { … }
TEST_F(FakeSSLClientSocketTest, UnsuccessfulHandshakeConnectError) { … }
TEST_F(FakeSSLClientSocketTest, UnsuccessfulHandshakeWriteError) { … }
TEST_F(FakeSSLClientSocketTest, UnsuccessfulHandshakeReadError) { … }
TEST_F(FakeSSLClientSocketTest, PeerClosedDuringHandshake) { … }
TEST_F(FakeSSLClientSocketTest, MalformedServerHello) { … }
}
}