| 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/host/chromoting_host.h" | 5 #include "remoting/host/chromoting_host.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 13 #include "base/run_loop.h" |
| 13 #include "remoting/base/auto_thread_task_runner.h" | 14 #include "remoting/base/auto_thread_task_runner.h" |
| 14 #include "remoting/host/audio_capturer.h" | 15 #include "remoting/host/audio_capturer.h" |
| 15 #include "remoting/host/chromoting_host_context.h" | 16 #include "remoting/host/chromoting_host_context.h" |
| 16 #include "remoting/host/fake_desktop_environment.h" | 17 #include "remoting/host/fake_desktop_environment.h" |
| 17 #include "remoting/host/fake_mouse_cursor_monitor.h" | 18 #include "remoting/host/fake_mouse_cursor_monitor.h" |
| 18 #include "remoting/host/host_mock_objects.h" | 19 #include "remoting/host/host_mock_objects.h" |
| 19 #include "remoting/proto/video.pb.h" | 20 #include "remoting/proto/video.pb.h" |
| 20 #include "remoting/protocol/errors.h" | 21 #include "remoting/protocol/errors.h" |
| 21 #include "remoting/protocol/fake_connection_to_client.h" | 22 #include "remoting/protocol/fake_connection_to_client.h" |
| 22 #include "remoting/protocol/fake_desktop_capturer.h" | 23 #include "remoting/protocol/fake_desktop_capturer.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 client_ptr->OnConnectionClosed(connection_ptr, | 146 client_ptr->OnConnectionClosed(connection_ptr, |
| 146 protocol::AUTHENTICATION_FAILED); | 147 protocol::AUTHENTICATION_FAILED); |
| 147 } | 148 } |
| 148 } | 149 } |
| 149 | 150 |
| 150 void TearDown() override { | 151 void TearDown() override { |
| 151 if (host_) | 152 if (host_) |
| 152 ShutdownHost(); | 153 ShutdownHost(); |
| 153 task_runner_ = nullptr; | 154 task_runner_ = nullptr; |
| 154 | 155 |
| 155 message_loop_.RunUntilIdle(); | 156 base::RunLoop().RunUntilIdle(); |
| 156 } | 157 } |
| 157 | 158 |
| 158 void DisconnectAllClients() { | 159 void DisconnectAllClients() { |
| 159 host_->DisconnectAllClients(); | 160 host_->DisconnectAllClients(); |
| 160 } | 161 } |
| 161 | 162 |
| 162 void NotifyConnectionClosed1() { | 163 void NotifyConnectionClosed1() { |
| 163 if (session_unowned1_event_handler_) { | 164 if (session_unowned1_event_handler_) { |
| 164 session_unowned1_event_handler_->OnSessionStateChange(Session::CLOSED); | 165 session_unowned1_event_handler_->OnSessionStateChange(Session::CLOSED); |
| 165 } | 166 } |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 | 391 |
| 391 ExpectClientConnected(0); | 392 ExpectClientConnected(0); |
| 392 SimulateClientConnection(0, true, false); | 393 SimulateClientConnection(0, true, false); |
| 393 | 394 |
| 394 ExpectClientDisconnected(0); | 395 ExpectClientDisconnected(0); |
| 395 DisconnectAllClients(); | 396 DisconnectAllClients(); |
| 396 testing::Mock::VerifyAndClearExpectations(&host_status_observer_); | 397 testing::Mock::VerifyAndClearExpectations(&host_status_observer_); |
| 397 } | 398 } |
| 398 | 399 |
| 399 } // namespace remoting | 400 } // namespace remoting |
| OLD | NEW |