#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "net/socket/socks5_client_socket.h"
#include <algorithm>
#include <iterator>
#include <map>
#include <memory>
#include <utility>
#include "base/containers/span.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/sys_byteorder.h"
#include "build/build_config.h"
#include "net/base/address_list.h"
#include "net/base/test_completion_callback.h"
#include "net/base/winsock_init.h"
#include "net/log/net_log_event_type.h"
#include "net/log/test_net_log.h"
#include "net/log/test_net_log_util.h"
#include "net/socket/client_socket_factory.h"
#include "net/socket/socket_test_util.h"
#include "net/socket/tcp_client_socket.h"
#include "net/test/gtest_util.h"
#include "net/test/test_with_task_environment.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"
#include "testing/platform_test.h"
IsError;
IsOk;
namespace net {
class NetLog;
namespace {
class SOCKS5ClientSocketTest : public PlatformTest, public WithTaskEnvironment { … };
SOCKS5ClientSocketTest::SOCKS5ClientSocketTest()
: … { … }
void SOCKS5ClientSocketTest::SetUp() { … }
std::unique_ptr<SOCKS5ClientSocket> SOCKS5ClientSocketTest::BuildMockSocket(
base::span<const MockRead> reads,
base::span<const MockWrite> writes,
const std::string& hostname,
int port,
NetLog* net_log) { … }
TEST_F(SOCKS5ClientSocketTest, CompleteHandshake) { … }
TEST_F(SOCKS5ClientSocketTest, ConnectAndDisconnectTwice) { … }
TEST_F(SOCKS5ClientSocketTest, LargeHostNameFails) { … }
TEST_F(SOCKS5ClientSocketTest, PartialReadWrites) { … }
TEST_F(SOCKS5ClientSocketTest, Tag) { … }
}
}