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/desktop_process.h" | 5 #include "remoting/host/desktop_process.h" |
6 | 6 |
| 7 #include <stdint.h> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
9 #include "base/location.h" | 11 #include "base/location.h" |
| 12 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
11 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
12 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
13 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
| 17 #include "build/build_config.h" |
14 #include "ipc/ipc_channel.h" | 18 #include "ipc/ipc_channel.h" |
15 #include "ipc/ipc_channel_proxy.h" | 19 #include "ipc/ipc_channel_proxy.h" |
16 #include "ipc/ipc_listener.h" | 20 #include "ipc/ipc_listener.h" |
17 #include "ipc/ipc_message.h" | 21 #include "ipc/ipc_message.h" |
18 #include "remoting/base/auto_thread.h" | 22 #include "remoting/base/auto_thread.h" |
19 #include "remoting/base/auto_thread_task_runner.h" | 23 #include "remoting/base/auto_thread_task_runner.h" |
20 #include "remoting/host/chromoting_messages.h" | 24 #include "remoting/host/chromoting_messages.h" |
21 #include "remoting/host/desktop_process.h" | 25 #include "remoting/host/desktop_process.h" |
22 #include "remoting/host/host_exit_codes.h" | 26 #include "remoting/host/host_exit_codes.h" |
23 #include "remoting/host/host_mock_objects.h" | 27 #include "remoting/host/host_mock_objects.h" |
(...skipping 15 matching lines...) Expand all Loading... |
39 namespace { | 43 namespace { |
40 | 44 |
41 class MockDaemonListener : public IPC::Listener { | 45 class MockDaemonListener : public IPC::Listener { |
42 public: | 46 public: |
43 MockDaemonListener() {} | 47 MockDaemonListener() {} |
44 ~MockDaemonListener() override {} | 48 ~MockDaemonListener() override {} |
45 | 49 |
46 bool OnMessageReceived(const IPC::Message& message) override; | 50 bool OnMessageReceived(const IPC::Message& message) override; |
47 | 51 |
48 MOCK_METHOD1(OnDesktopAttached, void(IPC::PlatformFileForTransit)); | 52 MOCK_METHOD1(OnDesktopAttached, void(IPC::PlatformFileForTransit)); |
49 MOCK_METHOD1(OnChannelConnected, void(int32)); | 53 MOCK_METHOD1(OnChannelConnected, void(int32_t)); |
50 MOCK_METHOD0(OnChannelError, void()); | 54 MOCK_METHOD0(OnChannelError, void()); |
51 | 55 |
52 private: | 56 private: |
53 DISALLOW_COPY_AND_ASSIGN(MockDaemonListener); | 57 DISALLOW_COPY_AND_ASSIGN(MockDaemonListener); |
54 }; | 58 }; |
55 | 59 |
56 class MockNetworkListener : public IPC::Listener { | 60 class MockNetworkListener : public IPC::Listener { |
57 public: | 61 public: |
58 MockNetworkListener() {} | 62 MockNetworkListener() {} |
59 ~MockNetworkListener() override {} | 63 ~MockNetworkListener() override {} |
60 | 64 |
61 bool OnMessageReceived(const IPC::Message& message) override; | 65 bool OnMessageReceived(const IPC::Message& message) override; |
62 | 66 |
63 MOCK_METHOD1(OnChannelConnected, void(int32)); | 67 MOCK_METHOD1(OnChannelConnected, void(int32_t)); |
64 MOCK_METHOD0(OnChannelError, void()); | 68 MOCK_METHOD0(OnChannelError, void()); |
65 | 69 |
66 MOCK_METHOD0(OnDesktopEnvironmentCreated, void()); | 70 MOCK_METHOD0(OnDesktopEnvironmentCreated, void()); |
67 | 71 |
68 private: | 72 private: |
69 DISALLOW_COPY_AND_ASSIGN(MockNetworkListener); | 73 DISALLOW_COPY_AND_ASSIGN(MockNetworkListener); |
70 }; | 74 }; |
71 | 75 |
72 bool MockDaemonListener::OnMessageReceived(const IPC::Message& message) { | 76 bool MockDaemonListener::OnMessageReceived(const IPC::Message& message) { |
73 bool handled = true; | 77 bool handled = true; |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 } | 338 } |
335 | 339 |
336 // Run the desktop process and ask it to crash. | 340 // Run the desktop process and ask it to crash. |
337 TEST_F(DesktopProcessTest, DeathTest) { | 341 TEST_F(DesktopProcessTest, DeathTest) { |
338 testing::GTEST_FLAG(death_test_style) = "threadsafe"; | 342 testing::GTEST_FLAG(death_test_style) = "threadsafe"; |
339 | 343 |
340 EXPECT_DEATH(RunDeathTest(), ""); | 344 EXPECT_DEATH(RunDeathTest(), ""); |
341 } | 345 } |
342 | 346 |
343 } // namespace remoting | 347 } // namespace remoting |
OLD | NEW |