| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 // ATL headers have to go first. | 5 // ATL headers have to go first. |
| 6 #include <atlbase.h> | 6 #include <atlbase.h> |
| 7 #include <atlhost.h> | 7 #include <atlhost.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 void TearDown() override; | 86 void TearDown() override; |
| 87 | 87 |
| 88 // Caaled when an RDP connection is established. | 88 // Caaled when an RDP connection is established. |
| 89 void OnRdpConnected(); | 89 void OnRdpConnected(); |
| 90 | 90 |
| 91 // Tears down |rdp_client_|. | 91 // Tears down |rdp_client_|. |
| 92 void CloseRdpClient(); | 92 void CloseRdpClient(); |
| 93 | 93 |
| 94 protected: | 94 protected: |
| 95 // The ATL module instance required by the ATL code. | 95 // The ATL module instance required by the ATL code. |
| 96 scoped_ptr<RdpClientModule> module_; | 96 std::unique_ptr<RdpClientModule> module_; |
| 97 | 97 |
| 98 // The UI message loop used by RdpClient. The loop is stopped once there is no | 98 // The UI message loop used by RdpClient. The loop is stopped once there is no |
| 99 // more references to |task_runner_|. | 99 // more references to |task_runner_|. |
| 100 base::MessageLoopForUI message_loop_; | 100 base::MessageLoopForUI message_loop_; |
| 101 base::RunLoop run_loop_; | 101 base::RunLoop run_loop_; |
| 102 scoped_refptr<AutoThreadTaskRunner> task_runner_; | 102 scoped_refptr<AutoThreadTaskRunner> task_runner_; |
| 103 | 103 |
| 104 // Mocks RdpClient::EventHandler for testing. | 104 // Mocks RdpClient::EventHandler for testing. |
| 105 MockRdpClientEventHandler event_handler_; | 105 MockRdpClientEventHandler event_handler_; |
| 106 | 106 |
| 107 // Points to the object being tested. | 107 // Points to the object being tested. |
| 108 scoped_ptr<RdpClient> rdp_client_; | 108 std::unique_ptr<RdpClient> rdp_client_; |
| 109 | 109 |
| 110 // Unique terminal identifier passed to RdpClient. | 110 // Unique terminal identifier passed to RdpClient. |
| 111 std::string terminal_id_; | 111 std::string terminal_id_; |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 RdpClientTest::RdpClientTest() { | 114 RdpClientTest::RdpClientTest() { |
| 115 } | 115 } |
| 116 | 116 |
| 117 RdpClientTest::~RdpClientTest() { | 117 RdpClientTest::~RdpClientTest() { |
| 118 } | 118 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 rdp_client_.reset(new RdpClient( | 165 rdp_client_.reset(new RdpClient( |
| 166 task_runner_, task_runner_, | 166 task_runner_, task_runner_, |
| 167 webrtc::DesktopSize(kDefaultWidth, kDefaultHeight), | 167 webrtc::DesktopSize(kDefaultWidth, kDefaultHeight), |
| 168 terminal_id_, &event_handler_)); | 168 terminal_id_, &event_handler_)); |
| 169 task_runner_ = nullptr; | 169 task_runner_ = nullptr; |
| 170 | 170 |
| 171 run_loop_.Run(); | 171 run_loop_.Run(); |
| 172 } | 172 } |
| 173 | 173 |
| 174 } // namespace remoting | 174 } // namespace remoting |
| OLD | NEW |