| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 client_channel_callback_.OnDone(socket.get()); | 116 client_channel_callback_.OnDone(socket.get()); |
| 117 client_socket_ = socket.Pass(); | 117 client_socket_ = socket.Pass(); |
| 118 } | 118 } |
| 119 | 119 |
| 120 void OnHostChannelCreated(scoped_ptr<net::StreamSocket> socket) { | 120 void OnHostChannelCreated(scoped_ptr<net::StreamSocket> socket) { |
| 121 host_channel_callback_.OnDone(socket.get()); | 121 host_channel_callback_.OnDone(socket.get()); |
| 122 host_socket_ = socket.Pass(); | 122 host_socket_ = socket.Pass(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 protected: | 125 protected: |
| 126 virtual void SetUp() { | 126 void SetUp() override {} |
| 127 } | |
| 128 | 127 |
| 129 virtual void TearDown() { | 128 void TearDown() override { |
| 130 CloseSessions(); | 129 CloseSessions(); |
| 131 CloseSessionManager(); | 130 CloseSessionManager(); |
| 132 base::RunLoop().RunUntilIdle(); | 131 base::RunLoop().RunUntilIdle(); |
| 133 } | 132 } |
| 134 | 133 |
| 135 void CloseSessions() { | 134 void CloseSessions() { |
| 136 host_socket_.reset(); | 135 host_socket_.reset(); |
| 137 host_session_.reset(); | 136 host_session_.reset(); |
| 138 client_socket_.reset(); | 137 client_socket_.reset(); |
| 139 client_session_.reset(); | 138 client_session_.reset(); |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 kChannelName, base::Bind(&JingleSessionTest::OnClientChannelCreated, | 527 kChannelName, base::Bind(&JingleSessionTest::OnClientChannelCreated, |
| 529 base::Unretained(this))); | 528 base::Unretained(this))); |
| 530 client_session_->GetTransportChannelFactory()->CancelChannelCreation( | 529 client_session_->GetTransportChannelFactory()->CancelChannelCreation( |
| 531 kChannelName); | 530 kChannelName); |
| 532 | 531 |
| 533 EXPECT_TRUE(!client_socket_.get()); | 532 EXPECT_TRUE(!client_socket_.get()); |
| 534 } | 533 } |
| 535 | 534 |
| 536 } // namespace protocol | 535 } // namespace protocol |
| 537 } // namespace remoting | 536 } // namespace remoting |
| OLD | NEW |