| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 new MockDesktopEnvironmentFactory()); | 253 new MockDesktopEnvironmentFactory()); |
| 254 EXPECT_CALL(*desktop_environment_factory, CreatePtr()) | 254 EXPECT_CALL(*desktop_environment_factory, CreatePtr()) |
| 255 .Times(AnyNumber()) | 255 .Times(AnyNumber()) |
| 256 .WillRepeatedly(Invoke(this, | 256 .WillRepeatedly(Invoke(this, |
| 257 &DesktopProcessTest::CreateDesktopEnvironment)); | 257 &DesktopProcessTest::CreateDesktopEnvironment)); |
| 258 EXPECT_CALL(*desktop_environment_factory, SupportsAudioCapture()) | 258 EXPECT_CALL(*desktop_environment_factory, SupportsAudioCapture()) |
| 259 .Times(AnyNumber()) | 259 .Times(AnyNumber()) |
| 260 .WillRepeatedly(Return(false)); | 260 .WillRepeatedly(Return(false)); |
| 261 | 261 |
| 262 DesktopProcess desktop_process(ui_task_runner, io_task_runner_, channel_name); | 262 DesktopProcess desktop_process(ui_task_runner, io_task_runner_, channel_name); |
| 263 EXPECT_TRUE(desktop_process.Start(desktop_environment_factory.Pass())); | 263 EXPECT_TRUE(desktop_process.Start(std::move(desktop_environment_factory))); |
| 264 | 264 |
| 265 ui_task_runner = nullptr; | 265 ui_task_runner = nullptr; |
| 266 run_loop.Run(); | 266 run_loop.Run(); |
| 267 } | 267 } |
| 268 | 268 |
| 269 void DesktopProcessTest::RunDeathTest() { | 269 void DesktopProcessTest::RunDeathTest() { |
| 270 InSequence s; | 270 InSequence s; |
| 271 EXPECT_CALL(daemon_listener_, OnChannelConnected(_)); | 271 EXPECT_CALL(daemon_listener_, OnChannelConnected(_)); |
| 272 EXPECT_CALL(daemon_listener_, OnDesktopAttached(_)) | 272 EXPECT_CALL(daemon_listener_, OnDesktopAttached(_)) |
| 273 .WillOnce(DoAll( | 273 .WillOnce(DoAll( |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 } | 334 } |
| 335 | 335 |
| 336 // Run the desktop process and ask it to crash. | 336 // Run the desktop process and ask it to crash. |
| 337 TEST_F(DesktopProcessTest, DeathTest) { | 337 TEST_F(DesktopProcessTest, DeathTest) { |
| 338 testing::GTEST_FLAG(death_test_style) = "threadsafe"; | 338 testing::GTEST_FLAG(death_test_style) = "threadsafe"; |
| 339 | 339 |
| 340 EXPECT_DEATH(RunDeathTest(), ""); | 340 EXPECT_DEATH(RunDeathTest(), ""); |
| 341 } | 341 } |
| 342 | 342 |
| 343 } // namespace remoting | 343 } // namespace remoting |
| OLD | NEW |