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> | 7 #include <stdint.h> |
8 | 8 |
| 9 #include <utility> |
| 10 |
9 #include "base/bind.h" | 11 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
11 #include "base/location.h" | 13 #include "base/location.h" |
12 #include "base/macros.h" | 14 #include "base/macros.h" |
13 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
14 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
15 #include "base/run_loop.h" | 17 #include "base/run_loop.h" |
16 #include "base/single_thread_task_runner.h" | 18 #include "base/single_thread_task_runner.h" |
17 #include "build/build_config.h" | 19 #include "build/build_config.h" |
18 #include "ipc/ipc_channel.h" | 20 #include "ipc/ipc_channel.h" |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 new MockDesktopEnvironmentFactory()); | 259 new MockDesktopEnvironmentFactory()); |
258 EXPECT_CALL(*desktop_environment_factory, CreatePtr()) | 260 EXPECT_CALL(*desktop_environment_factory, CreatePtr()) |
259 .Times(AnyNumber()) | 261 .Times(AnyNumber()) |
260 .WillRepeatedly(Invoke(this, | 262 .WillRepeatedly(Invoke(this, |
261 &DesktopProcessTest::CreateDesktopEnvironment)); | 263 &DesktopProcessTest::CreateDesktopEnvironment)); |
262 EXPECT_CALL(*desktop_environment_factory, SupportsAudioCapture()) | 264 EXPECT_CALL(*desktop_environment_factory, SupportsAudioCapture()) |
263 .Times(AnyNumber()) | 265 .Times(AnyNumber()) |
264 .WillRepeatedly(Return(false)); | 266 .WillRepeatedly(Return(false)); |
265 | 267 |
266 DesktopProcess desktop_process(ui_task_runner, io_task_runner_, channel_name); | 268 DesktopProcess desktop_process(ui_task_runner, io_task_runner_, channel_name); |
267 EXPECT_TRUE(desktop_process.Start(desktop_environment_factory.Pass())); | 269 EXPECT_TRUE(desktop_process.Start(std::move(desktop_environment_factory))); |
268 | 270 |
269 ui_task_runner = nullptr; | 271 ui_task_runner = nullptr; |
270 run_loop.Run(); | 272 run_loop.Run(); |
271 } | 273 } |
272 | 274 |
273 void DesktopProcessTest::RunDeathTest() { | 275 void DesktopProcessTest::RunDeathTest() { |
274 InSequence s; | 276 InSequence s; |
275 EXPECT_CALL(daemon_listener_, OnChannelConnected(_)); | 277 EXPECT_CALL(daemon_listener_, OnChannelConnected(_)); |
276 EXPECT_CALL(daemon_listener_, OnDesktopAttached(_)) | 278 EXPECT_CALL(daemon_listener_, OnDesktopAttached(_)) |
277 .WillOnce(DoAll( | 279 .WillOnce(DoAll( |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 } | 340 } |
339 | 341 |
340 // Run the desktop process and ask it to crash. | 342 // Run the desktop process and ask it to crash. |
341 TEST_F(DesktopProcessTest, DeathTest) { | 343 TEST_F(DesktopProcessTest, DeathTest) { |
342 testing::GTEST_FLAG(death_test_style) = "threadsafe"; | 344 testing::GTEST_FLAG(death_test_style) = "threadsafe"; |
343 | 345 |
344 EXPECT_DEATH(RunDeathTest(), ""); | 346 EXPECT_DEATH(RunDeathTest(), ""); |
345 } | 347 } |
346 | 348 |
347 } // namespace remoting | 349 } // namespace remoting |
OLD | NEW |