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

Unified Diff: remoting/host/it2me/it2me_host_unittest.cc

Issue 2724223003: Disconnect all users if too many connection requests are received for It2Me (Closed)
Patch Set: Addressing CR Feedback Created 3 years, 9 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/host/it2me/it2me_host.cc ('k') | remoting/protocol/authenticator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/it2me/it2me_host_unittest.cc
diff --git a/remoting/host/it2me/it2me_host_unittest.cc b/remoting/host/it2me/it2me_host_unittest.cc
index c762631bcc5bcedd8f6ef689b87608fccbef17fc..c316e1de45ea39d0024340bc86130c012405461c 100644
--- a/remoting/host/it2me/it2me_host_unittest.cc
+++ b/remoting/host/it2me/it2me_host_unittest.cc
@@ -37,6 +37,7 @@ typedef It2MeConfirmationDialog::Result DialogResult;
const char kTestClientUserName[] = "ficticious_user@gmail.com";
const char kTestClientJid[] = "ficticious_user@gmail.com/jid_resource";
+const char kTestClientJid2[] = "ficticious_user_2@gmail.com/jid_resource";
const char kTestClientUsernameNoJid[] = "completely_ficticious_user@gmail.com";
const char kTestClientJidWithSlash[] = "fake/user@gmail.com/jid_resource";
const char kResourceOnly[] = "/jid_resource";
@@ -356,4 +357,17 @@ TEST_F(It2MeHostTest, ConnectionValidation_ConfirmationDialog_Reject) {
ASSERT_STREQ(kTestClientUserName, remote_user_email_.c_str());
}
+TEST_F(It2MeHostTest, MultipleConnectionsTriggerDisconnect) {
+ SimulateClientConnection();
+ RunValidationCallback(kTestClientJid);
+ ASSERT_EQ(ValidationResult::SUCCESS, validation_result_);
+ ASSERT_EQ(It2MeHostState::kConnecting, last_host_state_);
+ ASSERT_STREQ(kTestClientUserName, remote_user_email_.c_str());
+
+ RunValidationCallback(kTestClientJid2);
+ ASSERT_EQ(ValidationResult::ERROR_TOO_MANY_CONNECTIONS, validation_result_);
+ RunUntilStateChanged(It2MeHostState::kDisconnected);
+ ASSERT_EQ(It2MeHostState::kDisconnected, last_host_state_);
+}
+
} // namespace remoting
« no previous file with comments | « remoting/host/it2me/it2me_host.cc ('k') | remoting/protocol/authenticator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698