Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Unified Diff: remoting/protocol/jingle_session_unittest.cc

Issue 2798393007: Use SignalingAddress in SignalStrategy insterface. (Closed)
Patch Set: header Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/protocol/jingle_session_manager.cc ('k') | remoting/protocol/protocol_mock_objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/jingle_session_unittest.cc
diff --git a/remoting/protocol/jingle_session_unittest.cc b/remoting/protocol/jingle_session_unittest.cc
index 4575e6e1fdc184237bb33cae31c8599a254c2497..39c5ca2a5990f523c55ed8e183de2c6a70e5dc99 100644
--- a/remoting/protocol/jingle_session_unittest.cc
+++ b/remoting/protocol/jingle_session_unittest.cc
@@ -184,10 +184,14 @@ class JingleSessionTest : public testing::Test {
void CreateSessionManagers(int auth_round_trips, int messages_till_start,
FakeAuthenticator::Action auth_action) {
- if (!host_signal_strategy_)
- host_signal_strategy_.reset(new FakeSignalStrategy(kHostJid));
- if (!client_signal_strategy_)
- client_signal_strategy_.reset(new FakeSignalStrategy(kClientJid));
+ if (!host_signal_strategy_) {
+ host_signal_strategy_.reset(
+ new FakeSignalStrategy(SignalingAddress(kHostJid)));
+ }
+ if (!client_signal_strategy_) {
+ client_signal_strategy_.reset(
+ new FakeSignalStrategy(SignalingAddress(kClientJid)));
+ }
FakeSignalStrategy::Connect(host_signal_strategy_.get(),
client_signal_strategy_.get());
@@ -273,8 +277,8 @@ class JingleSessionTest : public testing::Test {
}
void ConnectClient(std::unique_ptr<Authenticator> authenticator) {
- client_session_ =
- client_server_->Connect(host_jid_, std::move(authenticator));
+ client_session_ = client_server_->Connect(SignalingAddress(host_jid_),
+ std::move(authenticator));
client_session_->SetEventHandler(&client_session_event_handler_);
client_session_->SetTransport(&client_transport_);
client_session_->AddPlugin(&client_plugin_);
@@ -364,7 +368,8 @@ TEST_F(JingleSessionTest, RejectConnection) {
std::unique_ptr<Authenticator> authenticator(new FakeAuthenticator(
FakeAuthenticator::CLIENT, 1, FakeAuthenticator::ACCEPT, true));
- client_session_ = client_server_->Connect(kHostJid, std::move(authenticator));
+ client_session_ = client_server_->Connect(SignalingAddress(kHostJid),
+ std::move(authenticator));
client_session_->SetEventHandler(&client_session_event_handler_);
base::RunLoop().RunUntilIdle();
@@ -388,7 +393,8 @@ TEST_F(JingleSessionTest, Connect) {
TEST_F(JingleSessionTest, MixedCaseHostJid) {
std::string host_jid = std::string("A") + kHostJid;
- host_signal_strategy_.reset(new FakeSignalStrategy(host_jid));
+ host_signal_strategy_.reset(
+ new FakeSignalStrategy(SignalingAddress(host_jid)));
// Imitate host JID being lower-cased when stored in the directory.
host_jid_ = base::ToLowerASCII(host_jid);
@@ -399,7 +405,7 @@ TEST_F(JingleSessionTest, MixedCaseHostJid) {
TEST_F(JingleSessionTest, MixedCaseClientJid) {
client_signal_strategy_.reset(
- new FakeSignalStrategy(std::string("A") + kClientJid));
+ new FakeSignalStrategy(SignalingAddress(std::string("A") + kClientJid)));
CreateSessionManagers(1, FakeAuthenticator::ACCEPT);
InitiateConnection(1, FakeAuthenticator::ACCEPT, false);
}
@@ -476,7 +482,8 @@ TEST_F(JingleSessionTest, TestIncompatibleProtocol) {
// Disable all video codecs so the host will reject connection.
config->mutable_video_configs()->clear();
client_server_->set_protocol_config(std::move(config));
- client_session_ = client_server_->Connect(kHostJid, std::move(authenticator));
+ client_session_ = client_server_->Connect(SignalingAddress(kHostJid),
+ std::move(authenticator));
client_session_->SetEventHandler(&client_session_event_handler_);
base::RunLoop().RunUntilIdle();
@@ -502,7 +509,8 @@ TEST_F(JingleSessionTest, TestLegacyIceConnection) {
CandidateSessionConfig::CreateDefault();
config->set_ice_supported(false);
client_server_->set_protocol_config(std::move(config));
- client_session_ = client_server_->Connect(kHostJid, std::move(authenticator));
+ client_session_ = client_server_->Connect(SignalingAddress(kHostJid),
+ std::move(authenticator));
client_session_->SetEventHandler(&client_session_event_handler_);
base::RunLoop().RunUntilIdle();
@@ -530,7 +538,8 @@ TEST_F(JingleSessionTest, DeleteSessionOnIncomingConnection) {
std::unique_ptr<Authenticator> authenticator(new FakeAuthenticator(
FakeAuthenticator::CLIENT, 3, FakeAuthenticator::ACCEPT, true));
- client_session_ = client_server_->Connect(kHostJid, std::move(authenticator));
+ client_session_ = client_server_->Connect(SignalingAddress(kHostJid),
+ std::move(authenticator));
base::RunLoop().RunUntilIdle();
}
@@ -557,7 +566,8 @@ TEST_F(JingleSessionTest, DeleteSessionOnAuth) {
std::unique_ptr<Authenticator> authenticator(new FakeAuthenticator(
FakeAuthenticator::CLIENT, 3, FakeAuthenticator::ACCEPT, true));
- client_session_ = client_server_->Connect(kHostJid, std::move(authenticator));
+ client_session_ = client_server_->Connect(SignalingAddress(kHostJid),
+ std::move(authenticator));
base::RunLoop().RunUntilIdle();
}
@@ -638,9 +648,10 @@ TEST_F(JingleSessionTest, SessionPluginShouldNotBeInvolvedInSessionTerminate) {
TEST_F(JingleSessionTest, ImmediatelyCloseSessionAfterConnect) {
CreateSessionManagers(3, FakeAuthenticator::ACCEPT);
- client_session_ = client_server_->Connect(host_jid_,
- base::MakeUnique<FakeAuthenticator>(
- FakeAuthenticator::CLIENT, 3, FakeAuthenticator::ACCEPT, true));
+ client_session_ = client_server_->Connect(
+ SignalingAddress(host_jid_),
+ base::MakeUnique<FakeAuthenticator>(FakeAuthenticator::CLIENT, 3,
+ FakeAuthenticator::ACCEPT, true));
client_session_->Close(HOST_OVERLOAD);
base::RunLoop().RunUntilIdle();
// We should only send a SESSION_TERMINATE message if the session has been
« no previous file with comments | « remoting/protocol/jingle_session_manager.cc ('k') | remoting/protocol/protocol_mock_objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698