| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 void DesktopProcessTest::RunDesktopProcess() { | 178 void DesktopProcessTest::RunDesktopProcess() { |
| 179 base::RunLoop run_loop; | 179 base::RunLoop run_loop; |
| 180 base::Closure quit_ui_task_runner = base::Bind( | 180 base::Closure quit_ui_task_runner = base::Bind( |
| 181 base::IgnoreResult(&base::SingleThreadTaskRunner::PostTask), | 181 base::IgnoreResult(&base::SingleThreadTaskRunner::PostTask), |
| 182 message_loop_.message_loop_proxy(), | 182 message_loop_.message_loop_proxy(), |
| 183 FROM_HERE, run_loop.QuitClosure()); | 183 FROM_HERE, run_loop.QuitClosure()); |
| 184 scoped_refptr<AutoThreadTaskRunner> ui_task_runner = new AutoThreadTaskRunner( | 184 scoped_refptr<AutoThreadTaskRunner> ui_task_runner = new AutoThreadTaskRunner( |
| 185 message_loop_.message_loop_proxy(), quit_ui_task_runner); | 185 message_loop_.message_loop_proxy(), quit_ui_task_runner); |
| 186 | 186 |
| 187 io_task_runner_ = AutoThread::CreateWithType("IPC thread", ui_task_runner, | 187 io_task_runner_ = AutoThread::CreateWithType("IPC thread", ui_task_runner, |
| 188 MessageLoop::TYPE_IO); | 188 AutoThread::TYPE_IO); |
| 189 | 189 |
| 190 std::string channel_name = IPC::Channel::GenerateUniqueRandomChannelID(); | 190 std::string channel_name = IPC::Channel::GenerateUniqueRandomChannelID(); |
| 191 daemon_channel_.reset(new IPC::ChannelProxy( | 191 daemon_channel_.reset(new IPC::ChannelProxy( |
| 192 IPC::ChannelHandle(channel_name), | 192 IPC::ChannelHandle(channel_name), |
| 193 IPC::Channel::MODE_SERVER, | 193 IPC::Channel::MODE_SERVER, |
| 194 &daemon_listener_, | 194 &daemon_listener_, |
| 195 io_task_runner_)); | 195 io_task_runner_)); |
| 196 | 196 |
| 197 DesktopProcess desktop_process(ui_task_runner, channel_name); | 197 DesktopProcess desktop_process(ui_task_runner, channel_name); |
| 198 EXPECT_TRUE(desktop_process.Start()); | 198 EXPECT_TRUE(desktop_process.Start()); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 } | 244 } |
| 245 | 245 |
| 246 // Run the desktop process and ask it to crash. | 246 // Run the desktop process and ask it to crash. |
| 247 TEST_F(DesktopProcessTest, DeathTest) { | 247 TEST_F(DesktopProcessTest, DeathTest) { |
| 248 testing::GTEST_FLAG(death_test_style) = "threadsafe"; | 248 testing::GTEST_FLAG(death_test_style) = "threadsafe"; |
| 249 | 249 |
| 250 EXPECT_DEATH(RunDeathTest(), ""); | 250 EXPECT_DEATH(RunDeathTest(), ""); |
| 251 } | 251 } |
| 252 | 252 |
| 253 } // namespace remoting | 253 } // namespace remoting |
| OLD | NEW |