Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(615)

Side by Side Diff: remoting/host/desktop_process_unittest.cc

Issue 11348087: Add AutoThread types for Windows that initialize COM. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« remoting/base/auto_thread.h ('K') | « remoting/host/desktop_process.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698