OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/protocol/jingle_session.h" | 5 #include "remoting/protocol/jingle_session.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 InitiateConnection(1, FakeAuthenticator::ACCEPT, false); | 316 InitiateConnection(1, FakeAuthenticator::ACCEPT, false); |
317 | 317 |
318 // Verify that the client specified correct initiator value. | 318 // Verify that the client specified correct initiator value. |
319 ASSERT_GT(host_signal_strategy_->received_messages().size(), 0U); | 319 ASSERT_GT(host_signal_strategy_->received_messages().size(), 0U); |
320 const buzz::XmlElement* initiate_xml = | 320 const buzz::XmlElement* initiate_xml = |
321 host_signal_strategy_->received_messages().front(); | 321 host_signal_strategy_->received_messages().front(); |
322 const buzz::XmlElement* jingle_element = | 322 const buzz::XmlElement* jingle_element = |
323 initiate_xml->FirstNamed(buzz::QName(kJingleNamespace, "jingle")); | 323 initiate_xml->FirstNamed(buzz::QName(kJingleNamespace, "jingle")); |
324 ASSERT_TRUE(jingle_element); | 324 ASSERT_TRUE(jingle_element); |
325 ASSERT_EQ(kClientJid, | 325 ASSERT_EQ(kClientJid, |
326 jingle_element->Attr(buzz::QName("", "initiator"))); | 326 jingle_element->Attr(buzz::QName(std::string(), "initiator"))); |
327 } | 327 } |
328 | 328 |
329 // Verify that we can connect two endpoints with multi-step authentication. | 329 // Verify that we can connect two endpoints with multi-step authentication. |
330 TEST_F(JingleSessionTest, ConnectWithMultistep) { | 330 TEST_F(JingleSessionTest, ConnectWithMultistep) { |
331 CreateSessionManagers(3, FakeAuthenticator::ACCEPT); | 331 CreateSessionManagers(3, FakeAuthenticator::ACCEPT); |
332 InitiateConnection(3, FakeAuthenticator::ACCEPT, false); | 332 InitiateConnection(3, FakeAuthenticator::ACCEPT, false); |
333 } | 333 } |
334 | 334 |
335 // Verify that connection is terminated when single-step auth fails. | 335 // Verify that connection is terminated when single-step auth fails. |
336 TEST_F(JingleSessionTest, ConnectWithBadAuth) { | 336 TEST_F(JingleSessionTest, ConnectWithBadAuth) { |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 .Times(AtMost(1)); | 426 .Times(AtMost(1)); |
427 ExpectRouteChange(kChannelName); | 427 ExpectRouteChange(kChannelName); |
428 | 428 |
429 message_loop_->Run(); | 429 message_loop_->Run(); |
430 | 430 |
431 EXPECT_TRUE(!host_socket_.get()); | 431 EXPECT_TRUE(!host_socket_.get()); |
432 } | 432 } |
433 | 433 |
434 } // namespace protocol | 434 } // namespace protocol |
435 } // namespace remoting | 435 } // namespace remoting |
OLD | NEW |