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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 ExpectRouteChange(kChannelName); | 514 ExpectRouteChange(kChannelName); |
515 | 515 |
516 message_loop_->Run(); | 516 message_loop_->Run(); |
517 | 517 |
518 client_session_->GetTransportChannelFactory()->CancelChannelCreation( | 518 client_session_->GetTransportChannelFactory()->CancelChannelCreation( |
519 kChannelName); | 519 kChannelName); |
520 | 520 |
521 EXPECT_TRUE(!host_socket_.get()); | 521 EXPECT_TRUE(!host_socket_.get()); |
522 } | 522 } |
523 | 523 |
| 524 TEST_F(JingleSessionTest, TestCancelChannelCreation) { |
| 525 CreateSessionManagers(1, FakeAuthenticator::REJECT_CHANNEL); |
| 526 ASSERT_NO_FATAL_FAILURE( |
| 527 InitiateConnection(1, FakeAuthenticator::ACCEPT, false)); |
| 528 |
| 529 client_session_->GetTransportChannelFactory()->CreateChannel( |
| 530 kChannelName, base::Bind(&JingleSessionTest::OnClientChannelCreated, |
| 531 base::Unretained(this))); |
| 532 client_session_->GetTransportChannelFactory()->CancelChannelCreation( |
| 533 kChannelName); |
| 534 |
| 535 EXPECT_TRUE(!client_socket_.get()); |
| 536 } |
| 537 |
524 } // namespace protocol | 538 } // namespace protocol |
525 } // namespace remoting | 539 } // namespace remoting |
OLD | NEW |