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/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 | 525 |
526 client_session_->GetTransportChannelFactory()->CreateChannel( | 526 client_session_->GetTransportChannelFactory()->CreateChannel( |
527 kChannelName, base::Bind(&JingleSessionTest::OnClientChannelCreated, | 527 kChannelName, base::Bind(&JingleSessionTest::OnClientChannelCreated, |
528 base::Unretained(this))); | 528 base::Unretained(this))); |
529 client_session_->GetTransportChannelFactory()->CancelChannelCreation( | 529 client_session_->GetTransportChannelFactory()->CancelChannelCreation( |
530 kChannelName); | 530 kChannelName); |
531 | 531 |
532 EXPECT_TRUE(!client_socket_.get()); | 532 EXPECT_TRUE(!client_socket_.get()); |
533 } | 533 } |
534 | 534 |
| 535 // Verify that we can still connect even when there is a delay in signaling |
| 536 // messages delivery. |
| 537 TEST_F(JingleSessionTest, TestDelayedSignaling) { |
| 538 CreateSessionManagers(1, FakeAuthenticator::ACCEPT); |
| 539 ASSERT_NO_FATAL_FAILURE( |
| 540 InitiateConnection(1, FakeAuthenticator::ACCEPT, false)); |
| 541 |
| 542 host_signal_strategy_->set_send_delay( |
| 543 base::TimeDelta::FromMilliseconds(100)); |
| 544 |
| 545 ASSERT_NO_FATAL_FAILURE(CreateChannel()); |
| 546 |
| 547 StreamConnectionTester tester(host_socket_.get(), client_socket_.get(), |
| 548 kMessageSize, 1); |
| 549 tester.Start(); |
| 550 message_loop_->Run(); |
| 551 tester.CheckResults(); |
| 552 } |
| 553 |
535 } // namespace protocol | 554 } // namespace protocol |
536 } // namespace remoting | 555 } // namespace remoting |
OLD | NEW |