| 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> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 return new FakeMouseCursorMonitor(); | 241 return new FakeMouseCursorMonitor(); |
| 242 } | 242 } |
| 243 | 243 |
| 244 void DesktopProcessTest::DisconnectChannels() { | 244 void DesktopProcessTest::DisconnectChannels() { |
| 245 daemon_channel_.reset(); | 245 daemon_channel_.reset(); |
| 246 network_channel_.reset(); | 246 network_channel_.reset(); |
| 247 io_task_runner_ = nullptr; | 247 io_task_runner_ = nullptr; |
| 248 } | 248 } |
| 249 | 249 |
| 250 void DesktopProcessTest::PostDisconnectChannels() { | 250 void DesktopProcessTest::PostDisconnectChannels() { |
| 251 message_loop_.PostTask(FROM_HERE, base::Bind( | 251 message_loop_.task_runner()->PostTask( |
| 252 &DesktopProcessTest::DisconnectChannels, base::Unretained(this))); | 252 FROM_HERE, base::Bind(&DesktopProcessTest::DisconnectChannels, |
| 253 base::Unretained(this))); |
| 253 } | 254 } |
| 254 | 255 |
| 255 void DesktopProcessTest::RunDesktopProcess() { | 256 void DesktopProcessTest::RunDesktopProcess() { |
| 256 base::RunLoop run_loop; | 257 base::RunLoop run_loop; |
| 257 base::Closure quit_ui_task_runner = base::Bind( | 258 base::Closure quit_ui_task_runner = base::Bind( |
| 258 base::IgnoreResult(&base::SingleThreadTaskRunner::PostTask), | 259 base::IgnoreResult(&base::SingleThreadTaskRunner::PostTask), |
| 259 message_loop_.task_runner(), | 260 message_loop_.task_runner(), |
| 260 FROM_HERE, run_loop.QuitClosure()); | 261 FROM_HERE, run_loop.QuitClosure()); |
| 261 scoped_refptr<AutoThreadTaskRunner> ui_task_runner = new AutoThreadTaskRunner( | 262 scoped_refptr<AutoThreadTaskRunner> ui_task_runner = new AutoThreadTaskRunner( |
| 262 message_loop_.task_runner(), quit_ui_task_runner); | 263 message_loop_.task_runner(), quit_ui_task_runner); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 } | 355 } |
| 355 | 356 |
| 356 // Run the desktop process and ask it to crash. | 357 // Run the desktop process and ask it to crash. |
| 357 TEST_F(DesktopProcessTest, DeathTest) { | 358 TEST_F(DesktopProcessTest, DeathTest) { |
| 358 testing::GTEST_FLAG(death_test_style) = "threadsafe"; | 359 testing::GTEST_FLAG(death_test_style) = "threadsafe"; |
| 359 | 360 |
| 360 EXPECT_DEATH(RunDeathTest(), ""); | 361 EXPECT_DEATH(RunDeathTest(), ""); |
| 361 } | 362 } |
| 362 | 363 |
| 363 } // namespace remoting | 364 } // namespace remoting |
| OLD | NEW |