#ifndef NET_SOCKET_SOCKET_TEST_UTIL_H_
#define NET_SOCKET_SOCKET_TEST_UTIL_H_
#include <stddef.h>
#include <stdint.h>
#include <cstring>
#include <memory>
#include <optional>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include "base/check_op.h"
#include "base/containers/span.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/raw_span.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "build/build_config.h"
#include "net/base/address_list.h"
#include "net/base/completion_once_callback.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/base/test_completion_callback.h"
#include "net/http/http_auth_controller.h"
#include "net/log/net_log_with_source.h"
#include "net/socket/client_socket_factory.h"
#include "net/socket/client_socket_handle.h"
#include "net/socket/client_socket_pool.h"
#include "net/socket/datagram_client_socket.h"
#include "net/socket/socket_performance_watcher.h"
#include "net/socket/socket_tag.h"
#include "net/socket/ssl_client_socket.h"
#include "net/socket/transport_client_socket.h"
#include "net/socket/transport_client_socket_pool.h"
#include "net/ssl/ssl_config_service.h"
#include "net/ssl/ssl_info.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
class RunLoop;
}
namespace net {
struct CommonConnectJobParams;
class NetLog;
struct NetworkTrafficAnnotationTag;
class X509Certificate;
const handles::NetworkHandle kDefaultNetworkForTests = …;
const handles::NetworkHandle kNewNetworkForTests = …;
enum { … };
class AsyncSocket;
class MockClientSocket;
class MockTCPClientSocket;
class MockSSLClientSocket;
class SSLClientSocket;
class StreamSocket;
enum IoMode { … };
class MockConnectCompleter { … };
struct MockConnect { … };
struct MockConfirm { … };
enum MockReadWriteType { … };
template <MockReadWriteType type>
struct MockReadWrite { … };
MockRead;
MockWrite;
struct MockWriteResult { … };
class SocketDataPrinter { … };
class SocketDataProvider { … };
class AsyncSocket { … };
class StaticSocketDataHelper { … };
class StaticSocketDataProvider : public SocketDataProvider { … };
struct SSLSocketDataProvider { … };
class SequencedSocketData : public SocketDataProvider { … };
template <typename T>
class SocketDataProviderArray { … };
class MockUDPClientSocket;
class MockTCPClientSocket;
class MockSSLClientSocket;
class MockClientSocketFactory : public ClientSocketFactory { … };
class MockClientSocket : public TransportClientSocket { … };
class MockTCPClientSocket : public MockClientSocket, public AsyncSocket { … };
class MockSSLClientSocket : public AsyncSocket, public SSLClientSocket { … };
class MockUDPClientSocket : public DatagramClientSocket, public AsyncSocket { … };
class TestSocketRequest : public TestCompletionCallbackBase { … };
class ClientSocketPoolTest { … };
class MockTransportSocketParams
: public base::RefCounted<MockTransportSocketParams> { … };
class MockTransportClientSocketPool : public TransportClientSocketPool { … };
class WrappedStreamSocket : public TransportClientSocket { … };
class MockTaggingStreamSocket : public WrappedStreamSocket { … };
class MockTaggingClientSocketFactory : public MockClientSocketFactory { … };
extern const char kSOCKS4TestHost[];
extern const int kSOCKS4TestPort;
extern const char kSOCKS4OkRequestLocalHostPort80[];
extern const int kSOCKS4OkRequestLocalHostPort80Length;
extern const char kSOCKS4OkReply[];
extern const int kSOCKS4OkReplyLength;
extern const char kSOCKS5TestHost[];
extern const int kSOCKS5TestPort;
extern const char kSOCKS5GreetRequest[];
extern const int kSOCKS5GreetRequestLength;
extern const char kSOCKS5GreetResponse[];
extern const int kSOCKS5GreetResponseLength;
extern const char kSOCKS5OkRequest[];
extern const int kSOCKS5OkRequestLength;
extern const char kSOCKS5OkResponse[];
extern const int kSOCKS5OkResponseLength;
int64_t CountReadBytes(base::span<const MockRead> reads);
int64_t CountWriteBytes(base::span<const MockWrite> writes);
#if BUILDFLAG(IS_ANDROID)
bool CanGetTaggedBytes();
uint64_t GetTaggedBytes(int32_t expected_tag);
#endif
}
#endif