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

Unified Diff: remoting/protocol/jingle_session_unittest.cc

Issue 8774031: Multi-step authentication support in JingleSession. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years 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.cc ('k') | remoting/protocol/v1_authenticator.cc » ('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 8ca7dcf133b483635e76a7104672928ef9c9af19..6c1fdfb8d281b0485309d2fbfce9d12c036aac8e 100644
--- a/remoting/protocol/jingle_session_unittest.cc
+++ b/remoting/protocol/jingle_session_unittest.cc
@@ -171,15 +171,15 @@ class JingleSessionTest : public testing::Test {
{
InSequence dummy;
+ EXPECT_CALL(host_connection_callback_,
+ OnStateChange(Session::CONNECTED))
+ .Times(AtMost(1));
if (expect_fail) {
EXPECT_CALL(host_connection_callback_,
OnStateChange(Session::FAILED))
.Times(1);
} else {
EXPECT_CALL(host_connection_callback_,
- OnStateChange(Session::CONNECTED))
- .Times(1);
- EXPECT_CALL(host_connection_callback_,
OnStateChange(Session::AUTHENTICATED))
.Times(1);
}
@@ -191,15 +191,15 @@ class JingleSessionTest : public testing::Test {
EXPECT_CALL(client_connection_callback_,
OnStateChange(Session::CONNECTING))
.Times(1);
+ EXPECT_CALL(client_connection_callback_,
+ OnStateChange(Session::CONNECTED))
+ .Times(AtMost(1));
if (expect_fail) {
EXPECT_CALL(client_connection_callback_,
OnStateChange(Session::FAILED))
.Times(1);
} else {
EXPECT_CALL(client_connection_callback_,
- OnStateChange(Session::CONNECTED))
- .Times(1);
- EXPECT_CALL(client_connection_callback_,
OnStateChange(Session::AUTHENTICATED))
.Times(1);
}
@@ -326,12 +326,24 @@ TEST_F(JingleSessionTest, Connect) {
InitiateConnection(1, FakeAuthenticator::ACCEPT, false);
}
-// Verify that we can't connect two endpoints with mismatched secrets.
+// Verify that we can connect two endpoints with multi-step authentication.
+TEST_F(JingleSessionTest, ConnectMultistep) {
+ CreateServerPair(3, FakeAuthenticator::ACCEPT);
+ InitiateConnection(3, FakeAuthenticator::ACCEPT, false);
+}
+
+// Verify that connection is terminated when auth fails.
TEST_F(JingleSessionTest, ConnectBadAuth) {
CreateServerPair(1, FakeAuthenticator::REJECT);
InitiateConnection(1, FakeAuthenticator::ACCEPT, true);
}
+// Verify that connection is terminted when multi-step auth fails.
+TEST_F(JingleSessionTest, ConnectBadMultistepAuth) {
+ CreateServerPair(3, FakeAuthenticator::REJECT);
+ InitiateConnection(3, FakeAuthenticator::ACCEPT, true);
+}
+
TEST_F(JingleSessionTest, ConnectBadChannelAuth) {
CreateServerPair(1, FakeAuthenticator::REJECT_CHANNEL);
ASSERT_NO_FATAL_FAILURE(
@@ -374,6 +386,21 @@ TEST_F(JingleSessionTest, TestTcpChannel) {
tester.CheckResults();
}
+// Verify that we can connect channels with multistep auth.
+TEST_F(JingleSessionTest, TestMultistepAuthTcpChannel) {
+ CreateServerPair(3, FakeAuthenticator::ACCEPT);
+ ASSERT_NO_FATAL_FAILURE(
+ InitiateConnection(3, FakeAuthenticator::ACCEPT, false));
+
+ ASSERT_NO_FATAL_FAILURE(CreateChannel());
+
+ StreamConnectionTester tester(host_socket_.get(), client_socket_.get(),
+ kMessageSize, kMessages);
+ tester.Start();
+ message_loop_.Run();
+ tester.CheckResults();
+}
+
// Verify that data can be transmitted over the video RTP channel.
TEST_F(JingleSessionTest, TestUdpChannel) {
CreateServerPair(1, FakeAuthenticator::ACCEPT);
« no previous file with comments | « remoting/protocol/jingle_session.cc ('k') | remoting/protocol/v1_authenticator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698