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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
13 #include "base/guid.h" | 13 #include "base/guid.h" |
14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
15 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
16 #include "base/win/scoped_com_initializer.h" | 16 #include "base/win/scoped_com_initializer.h" |
17 #include "remoting/base/auto_thread_task_runner.h" | 17 #include "remoting/base/auto_thread_task_runner.h" |
18 #include "remoting/host/win/rdp_client.h" | 18 #include "remoting/host/win/rdp_client.h" |
19 #include "remoting/host/win/wts_terminal_monitor.h" | 19 #include "remoting/host/win/wts_terminal_monitor.h" |
20 #include "testing/gmock/include/gmock/gmock.h" | 20 #include "testing/gmock/include/gmock/gmock.h" |
21 #include "testing/gmock_mutant.h" | 21 #include "testing/gmock_mutant.h" |
22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 23 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
23 | 24 |
24 using testing::_; | 25 using testing::_; |
25 using testing::AtMost; | 26 using testing::AtMost; |
26 using testing::InvokeWithoutArgs; | 27 using testing::InvokeWithoutArgs; |
27 | 28 |
28 namespace remoting { | 29 namespace remoting { |
29 | 30 |
30 namespace { | 31 namespace { |
31 | 32 |
32 // Default width and hight of the RDP client window. | 33 // Default width and hight of the RDP client window. |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // An ability to establish a loopback RDP connection depends on many factors | 155 // An ability to establish a loopback RDP connection depends on many factors |
155 // including OS SKU and having RDP enabled. Accept both successful connection | 156 // including OS SKU and having RDP enabled. Accept both successful connection |
156 // and a connection error as a successful outcome. | 157 // and a connection error as a successful outcome. |
157 EXPECT_CALL(event_handler_, OnRdpConnected()) | 158 EXPECT_CALL(event_handler_, OnRdpConnected()) |
158 .Times(AtMost(1)) | 159 .Times(AtMost(1)) |
159 .WillOnce(Invoke(this, &RdpClientTest::OnRdpConnected)); | 160 .WillOnce(Invoke(this, &RdpClientTest::OnRdpConnected)); |
160 EXPECT_CALL(event_handler_, OnRdpClosed()) | 161 EXPECT_CALL(event_handler_, OnRdpClosed()) |
161 .Times(AtMost(1)) | 162 .Times(AtMost(1)) |
162 .WillOnce(InvokeWithoutArgs(this, &RdpClientTest::CloseRdpClient)); | 163 .WillOnce(InvokeWithoutArgs(this, &RdpClientTest::CloseRdpClient)); |
163 | 164 |
164 rdp_client_.reset(new RdpClient(task_runner_, task_runner_, | 165 rdp_client_.reset(new RdpClient( |
165 SkISize::Make(kDefaultWidth, kDefaultHeight), | 166 task_runner_, task_runner_, |
166 terminal_id_, &event_handler_)); | 167 webrtc::DesktopSize(kDefaultWidth, kDefaultHeight), |
| 168 terminal_id_, &event_handler_)); |
167 task_runner_ = NULL; | 169 task_runner_ = NULL; |
168 | 170 |
169 run_loop_.Run(); | 171 run_loop_.Run(); |
170 } | 172 } |
171 | 173 |
172 } // namespace remoting | 174 } // namespace remoting |
OLD | NEW |