#include "components/media_router/common/providers/cast/channel/cast_socket.h"
#include <stdint.h>
#include <memory>
#include <string_view>
#include <utility>
#include <vector>
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/bind.h"
#include "base/timer/mock_timer.h"
#include "build/build_config.h"
#include "components/media_router/common/providers/cast/channel/cast_auth_util.h"
#include "components/media_router/common/providers/cast/channel/cast_framer.h"
#include "components/media_router/common/providers/cast/channel/cast_message_util.h"
#include "components/media_router/common/providers/cast/channel/cast_test_util.h"
#include "components/media_router/common/providers/cast/channel/cast_transport.h"
#include "components/media_router/common/providers/cast/channel/logger.h"
#include "content/public/test/browser_task_environment.h"
#include "crypto/rsa_private_key.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "net/base/address_list.h"
#include "net/base/net_errors.h"
#include "net/socket/client_socket_factory.h"
#include "net/socket/socket_test_util.h"
#include "net/socket/ssl_client_socket.h"
#include "net/socket/ssl_server_socket.h"
#include "net/socket/tcp_client_socket.h"
#include "net/socket/tcp_server_socket.h"
#include "net/ssl/ssl_info.h"
#include "net/ssl/ssl_server_config.h"
#include "net/test/cert_test_util.h"
#include "net/test/test_data_directory.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_builder.h"
#include "net/url_request/url_request_test_util.h"
#include "services/network/network_context.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/boringssl/src/pki/pem.h"
#include "third_party/openscreen/src/cast/common/channel/proto/cast_channel.pb.h"
const int64_t kDistantTimeoutMillis = …;
_;
A;
DoAll;
Invoke;
InvokeArgument;
NotNull;
Return;
SaveArg;
CastMessage;
namespace cast_channel {
namespace {
const char kAuthNamespace[] = …;
CastMessage CreateAuthChallenge() { … }
CastMessage CreateAuthReply() { … }
CastMessage CreateTestMessage() { … }
base::FilePath GetTestCertsDirectory() { … }
class MockTCPSocket : public net::MockTCPClientSocket { … };
class CompleteHandler { … };
class TestCastSocketBase : public CastSocketImpl { … };
class MockTestCastSocket : public TestCastSocketBase { … };
class TestSocketFactory : public net::ClientSocketFactory { … };
class CastSocketTestBase : public testing::Test { … };
class MockCastSocketTest : public CastSocketTestBase { … };
class SslCastSocketTest : public CastSocketTestBase { … };
}
TEST_F(MockCastSocketTest, TestConnectFullSecureFlowAsync) { … }
TEST_F(MockCastSocketTest, TestConnectFullSecureFlowSync) { … }
TEST_F(MockCastSocketTest, TestConnectAuthMessageCorrupted) { … }
TEST_F(MockCastSocketTest, TestConnectTcpConnectErrorAsync) { … }
TEST_F(MockCastSocketTest, TestConnectTcpConnectErrorSync) { … }
TEST_F(MockCastSocketTest, TestConnectTcpTimeoutError) { … }
TEST_F(MockCastSocketTest, TestConnectTcpSocketTimeoutError) { … }
TEST_F(MockCastSocketTest, TestConnectSslConnectErrorAsync) { … }
TEST_F(MockCastSocketTest, TestConnectSslConnectErrorSync) { … }
TEST_F(MockCastSocketTest, TestConnectSslConnectTimeoutSync) { … }
TEST_F(MockCastSocketTest, TestConnectSslConnectTimeoutAsync) { … }
TEST_F(MockCastSocketTest, TestConnectChallengeSendError) { … }
TEST_F(MockCastSocketTest, TestConnectDestroyedAfterChallengeSent) { … }
TEST_F(MockCastSocketTest, TestConnectChallengeReplyReceiveError) { … }
TEST_F(MockCastSocketTest, TestConnectChallengeVerificationFails) { … }
TEST_F(MockCastSocketTest, TestConnectEndToEndWithRealTransportAsync) { … }
TEST_F(MockCastSocketTest, TestConnectEndToEndWithRealTransportSync) { … }
TEST_F(MockCastSocketTest, TestObservers) { … }
TEST_F(MockCastSocketTest, TestOpenChannelConnectingSocket) { … }
TEST_F(MockCastSocketTest, TestOpenChannelConnectedSocket) { … }
TEST_F(MockCastSocketTest, TestOpenChannelClosedSocket) { … }
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FUCHSIA)
#define MAYBE_TestConnectEndToEndWithRealSSL …
#else
#define MAYBE_TestConnectEndToEndWithRealSSL …
#endif
TEST_F(SslCastSocketTest, MAYBE_TestConnectEndToEndWithRealSSL) { … }
TEST_F(SslCastSocketTest, DISABLED_TestMessageEndToEndWithRealSSL) { … }
}