| 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 <string> | 9 #include <string> |
| 9 | 10 |
| 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/macros.h" |
| 14 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 15 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
| 16 #include "base/win/scoped_com_initializer.h" | 17 #include "base/win/scoped_com_initializer.h" |
| 17 #include "remoting/base/auto_thread_task_runner.h" | 18 #include "remoting/base/auto_thread_task_runner.h" |
| 18 #include "remoting/host/win/rdp_client.h" | 19 #include "remoting/host/win/rdp_client.h" |
| 19 #include "remoting/host/win/wts_terminal_monitor.h" | 20 #include "remoting/host/win/wts_terminal_monitor.h" |
| 20 #include "testing/gmock/include/gmock/gmock.h" | 21 #include "testing/gmock/include/gmock/gmock.h" |
| 21 #include "testing/gmock_mutant.h" | 22 #include "testing/gmock_mutant.h" |
| 22 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
| 23 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" | 24 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 module_.reset(new RdpClientModule()); | 125 module_.reset(new RdpClientModule()); |
| 125 } | 126 } |
| 126 | 127 |
| 127 void RdpClientTest::TearDown() { | 128 void RdpClientTest::TearDown() { |
| 128 EXPECT_TRUE(!rdp_client_); | 129 EXPECT_TRUE(!rdp_client_); |
| 129 | 130 |
| 130 module_.reset(); | 131 module_.reset(); |
| 131 } | 132 } |
| 132 | 133 |
| 133 void RdpClientTest::OnRdpConnected() { | 134 void RdpClientTest::OnRdpConnected() { |
| 134 uint32 session_id = WtsTerminalMonitor::LookupSessionId(terminal_id_); | 135 uint32_t session_id = WtsTerminalMonitor::LookupSessionId(terminal_id_); |
| 135 | 136 |
| 136 std::string id; | 137 std::string id; |
| 137 EXPECT_TRUE(WtsTerminalMonitor::LookupTerminalId(session_id, &id)); | 138 EXPECT_TRUE(WtsTerminalMonitor::LookupTerminalId(session_id, &id)); |
| 138 EXPECT_EQ(id, terminal_id_); | 139 EXPECT_EQ(id, terminal_id_); |
| 139 | 140 |
| 140 message_loop_.PostTask(FROM_HERE, base::Bind(&RdpClientTest::CloseRdpClient, | 141 message_loop_.PostTask(FROM_HERE, base::Bind(&RdpClientTest::CloseRdpClient, |
| 141 base::Unretained(this))); | 142 base::Unretained(this))); |
| 142 } | 143 } |
| 143 | 144 |
| 144 void RdpClientTest::CloseRdpClient() { | 145 void RdpClientTest::CloseRdpClient() { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 164 rdp_client_.reset(new RdpClient( | 165 rdp_client_.reset(new RdpClient( |
| 165 task_runner_, task_runner_, | 166 task_runner_, task_runner_, |
| 166 webrtc::DesktopSize(kDefaultWidth, kDefaultHeight), | 167 webrtc::DesktopSize(kDefaultWidth, kDefaultHeight), |
| 167 terminal_id_, &event_handler_)); | 168 terminal_id_, &event_handler_)); |
| 168 task_runner_ = nullptr; | 169 task_runner_ = nullptr; |
| 169 | 170 |
| 170 run_loop_.Run(); | 171 run_loop_.Run(); |
| 171 } | 172 } |
| 172 | 173 |
| 173 } // namespace remoting | 174 } // namespace remoting |
| OLD | NEW |