#include "remoting/protocol/jingle_session.h"
#include <memory>
#include <utility>
#include <vector>
#include "base/callback_list.h"
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/test/task_environment.h"
#include "base/test/test_timeouts.h"
#include "base/time/time.h"
#include "net/socket/socket.h"
#include "net/socket/stream_socket.h"
#include "net/url_request/url_request_context_getter.h"
#include "remoting/base/constants.h"
#include "remoting/protocol/authenticator.h"
#include "remoting/protocol/channel_authenticator.h"
#include "remoting/protocol/chromium_port_allocator_factory.h"
#include "remoting/protocol/connection_tester.h"
#include "remoting/protocol/errors.h"
#include "remoting/protocol/fake_authenticator.h"
#include "remoting/protocol/jingle_session_manager.h"
#include "remoting/protocol/network_settings.h"
#include "remoting/protocol/protocol_mock_objects.h"
#include "remoting/protocol/session_observer.h"
#include "remoting/protocol/session_plugin.h"
#include "remoting/protocol/transport.h"
#include "remoting/protocol/transport_context.h"
#include "remoting/signaling/fake_signal_strategy.h"
#include "remoting/signaling/xmpp_constants.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
_;
AtLeast;
AtMost;
DeleteArg;
DoAll;
InSequence;
Invoke;
InvokeWithoutArgs;
Return;
SaveArg;
SetArgPointee;
WithArg;
namespace remoting::protocol {
namespace {
const char kHostJid[] = …;
const char kClientJid[] = …;
const char kNormalizedHostJid[] = …;
class MockSessionManagerListener { … };
class MockSessionEventHandler : public Session::EventHandler { … };
class FakeTransport : public Transport { … };
class FakePlugin : public SessionPlugin { … };
std::unique_ptr<jingle_xmpp::XmlElement> CreateTransportInfo(
const std::string& id) { … }
}
class JingleSessionTest : public testing::Test { … };
TEST_F(JingleSessionTest, CreateAndDestoy) { … }
TEST_F(JingleSessionTest, RejectConnection) { … }
TEST_F(JingleSessionTest, Connect) { … }
TEST_F(JingleSessionTest, ConnectWithMultistep) { … }
TEST_F(JingleSessionTest, ConnectWithOutOfOrderIqs) { … }
TEST_F(JingleSessionTest, ConnectWithOutOfOrderIqsDestroyOnFirstMessage) { … }
TEST_F(JingleSessionTest, ConnectWithBadAuth) { … }
TEST_F(JingleSessionTest, ConnectWithBadMultistepAuth) { … }
TEST_F(JingleSessionTest, TestIncompatibleProtocol) { … }
TEST_F(JingleSessionTest, TestLegacyIceConnection) { … }
TEST_F(JingleSessionTest, DeleteSessionOnIncomingConnection) { … }
TEST_F(JingleSessionTest, DeleteSessionOnAuth) { … }
TEST_F(JingleSessionTest, TransportInfoDuringAuthentication) { … }
TEST_F(JingleSessionTest, TestSessionPlugin) { … }
TEST_F(JingleSessionTest, SessionPluginShouldNotBeInvolvedInSessionTerminate) { … }
TEST_F(JingleSessionTest, ImmediatelyCloseSessionAfterConnect) { … }
TEST_F(JingleSessionTest, AuthenticatorRejectedAfterAccepted) { … }
TEST_F(JingleSessionTest, ObserverIsNotified) { … }
TEST_F(JingleSessionTest, ObserverIsNotNotifiedAfterSubscriptionIsDestroyed) { … }
}