#include "quiche/quic/core/io/event_loop_connecting_client_socket.h"
#include <memory>
#include <optional>
#include <string>
#include <tuple>
#include <utility>
#include "absl/functional/bind_front.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "absl/types/span.h"
#include "quiche/quic/core/connecting_client_socket.h"
#include "quiche/quic/core/io/event_loop_socket_factory.h"
#include "quiche/quic/core/io/quic_default_event_loop.h"
#include "quiche/quic/core/io/quic_event_loop.h"
#include "quiche/quic/core/io/socket.h"
#include "quiche/quic/core/quic_time.h"
#include "quiche/quic/core/quic_types.h"
#include "quiche/quic/platform/api/quic_socket_address.h"
#include "quiche/quic/test_tools/mock_clock.h"
#include "quiche/quic/test_tools/quic_test_utils.h"
#include "quiche/common/platform/api/quiche_logging.h"
#include "quiche/common/platform/api/quiche_mem_slice.h"
#include "quiche/common/platform/api/quiche_mutex.h"
#include "quiche/common/platform/api/quiche_test.h"
#include "quiche/common/platform/api/quiche_test_loopback.h"
#include "quiche/common/platform/api/quiche_thread.h"
#include "quiche/common/quiche_callbacks.h"
#include "quiche/common/simple_buffer_allocator.h"
namespace quic::test {
namespace {
Combine;
Values;
ValuesIn;
class TestServerSocketRunner : public quiche::QuicheThread { … };
class TestTcpServerSocketRunner : public TestServerSocketRunner { … };
class TestUdpServerSocketRunner : public TestServerSocketRunner { … };
class EventLoopConnectingClientSocketTest
: public quiche::test::QuicheTestWithParam<
std::tuple<socket_api::SocketProtocol, QuicEventLoopFactory*>>,
public ConnectingClientSocket::AsyncVisitor { … };
std::string GetTestParamName(
::testing::TestParamInfo<
std::tuple<socket_api::SocketProtocol, QuicEventLoopFactory*>>
info) { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(EventLoopConnectingClientSocketTest, ConnectBlocking) { … }
TEST_P(EventLoopConnectingClientSocketTest, ConnectAsync) { … }
TEST_P(EventLoopConnectingClientSocketTest, ErrorBeforeConnectAsync) { … }
TEST_P(EventLoopConnectingClientSocketTest, ErrorDuringConnectAsync) { … }
TEST_P(EventLoopConnectingClientSocketTest, Disconnect) { … }
TEST_P(EventLoopConnectingClientSocketTest, DisconnectCancelsConnectAsync) { … }
TEST_P(EventLoopConnectingClientSocketTest, ConnectAndReconnect) { … }
TEST_P(EventLoopConnectingClientSocketTest, GetLocalAddress) { … }
void SendDataOnSocket(absl::string_view data, SocketFd connected_socket,
socket_api::SocketProtocol protocol) { … }
TEST_P(EventLoopConnectingClientSocketTest, ReceiveBlocking) { … }
TEST_P(EventLoopConnectingClientSocketTest, ReceiveAsync) { … }
TEST_P(EventLoopConnectingClientSocketTest, DisconnectCancelsReceiveAsync) { … }
void ReceiveDataFromSocket(std::string* out_received, SocketFd connected_socket,
socket_api::SocketProtocol protocol) { … }
TEST_P(EventLoopConnectingClientSocketTest, SendBlocking) { … }
TEST_P(EventLoopConnectingClientSocketTest, SendAsync) { … }
TEST_P(EventLoopConnectingClientSocketTest, DisconnectCancelsSendAsync) { … }
}
}