| 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 new MockDesktopEnvironmentFactory()); | 255 new MockDesktopEnvironmentFactory()); |
| 256 EXPECT_CALL(*desktop_environment_factory, CreatePtr()) | 256 EXPECT_CALL(*desktop_environment_factory, CreatePtr()) |
| 257 .Times(AnyNumber()) | 257 .Times(AnyNumber()) |
| 258 .WillRepeatedly(Invoke(this, | 258 .WillRepeatedly(Invoke(this, |
| 259 &DesktopProcessTest::CreateDesktopEnvironment)); | 259 &DesktopProcessTest::CreateDesktopEnvironment)); |
| 260 EXPECT_CALL(*desktop_environment_factory, SupportsAudioCapture()) | 260 EXPECT_CALL(*desktop_environment_factory, SupportsAudioCapture()) |
| 261 .Times(AnyNumber()) | 261 .Times(AnyNumber()) |
| 262 .WillRepeatedly(Return(false)); | 262 .WillRepeatedly(Return(false)); |
| 263 | 263 |
| 264 DesktopProcess desktop_process(ui_task_runner, io_task_runner_, channel_name); | 264 DesktopProcess desktop_process(ui_task_runner, io_task_runner_, channel_name); |
| 265 EXPECT_TRUE(desktop_process.Start( | 265 EXPECT_TRUE(desktop_process.Start(desktop_environment_factory.Pass())); |
| 266 desktop_environment_factory.PassAs<DesktopEnvironmentFactory>())); | |
| 267 | 266 |
| 268 ui_task_runner = NULL; | 267 ui_task_runner = NULL; |
| 269 run_loop.Run(); | 268 run_loop.Run(); |
| 270 } | 269 } |
| 271 | 270 |
| 272 void DesktopProcessTest::RunDeathTest() { | 271 void DesktopProcessTest::RunDeathTest() { |
| 273 InSequence s; | 272 InSequence s; |
| 274 EXPECT_CALL(daemon_listener_, OnChannelConnected(_)); | 273 EXPECT_CALL(daemon_listener_, OnChannelConnected(_)); |
| 275 EXPECT_CALL(daemon_listener_, OnDesktopAttached(_)) | 274 EXPECT_CALL(daemon_listener_, OnDesktopAttached(_)) |
| 276 .WillOnce(DoAll( | 275 .WillOnce(DoAll( |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 } | 336 } |
| 338 | 337 |
| 339 // Run the desktop process and ask it to crash. | 338 // Run the desktop process and ask it to crash. |
| 340 TEST_F(DesktopProcessTest, DeathTest) { | 339 TEST_F(DesktopProcessTest, DeathTest) { |
| 341 testing::GTEST_FLAG(death_test_style) = "threadsafe"; | 340 testing::GTEST_FLAG(death_test_style) = "threadsafe"; |
| 342 | 341 |
| 343 EXPECT_DEATH(RunDeathTest(), ""); | 342 EXPECT_DEATH(RunDeathTest(), ""); |
| 344 } | 343 } |
| 345 | 344 |
| 346 } // namespace remoting | 345 } // namespace remoting |
| OLD | NEW |