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

Side by Side Diff: ipc/ipc_test_base.cc

Issue 938453002: Remove base::WaitForSingleProcess (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: check exit code Created 5 years, 10 months 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
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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include "ipc/ipc_test_base.h" 7 #include "ipc/ipc_test_base.h"
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/process/kill.h" 10 #include "base/process/kill.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 DCHECK(!client_process_.IsValid()); 135 DCHECK(!client_process_.IsValid());
136 client_process_ = SpawnChild(GetTestMainName()); 136 client_process_ = SpawnChild(GetTestMainName());
137 return DidStartClient(); 137 return DidStartClient();
138 } 138 }
139 139
140 #endif 140 #endif
141 141
142 bool IPCTestBase::WaitForClientShutdown() { 142 bool IPCTestBase::WaitForClientShutdown() {
143 DCHECK(client_process_.IsValid()); 143 DCHECK(client_process_.IsValid());
144 144
145 bool rv = base::WaitForSingleProcess(client_process_.Handle(), 145 int exit_code;
Tom Sepez 2015/02/18 23:49:53 do we want to set exit_code to some impossible val
rvargas (doing something else) 2015/02/19 02:01:04 I have no idea what an impossible (or reasonable)
146 base::TimeDelta::FromSeconds(5)); 146 bool rv = client_process_.WaitForExitWithTimeout(
147 base::TimeDelta::FromSeconds(5), &exit_code);
147 client_process_.Close(); 148 client_process_.Close();
148 return rv; 149 return rv;
149 } 150 }
150 151
151 IPC::ChannelHandle IPCTestBase::GetTestChannelHandle() { 152 IPC::ChannelHandle IPCTestBase::GetTestChannelHandle() {
152 return GetChannelName(test_client_name_); 153 return GetChannelName(test_client_name_);
153 } 154 }
154 155
155 scoped_refptr<base::TaskRunner> IPCTestBase::task_runner() { 156 scoped_refptr<base::TaskRunner> IPCTestBase::task_runner() {
156 return message_loop_->message_loop_proxy(); 157 return message_loop_->message_loop_proxy();
157 } 158 }
158 159
159 scoped_ptr<IPC::ChannelFactory> IPCTestBase::CreateChannelFactory( 160 scoped_ptr<IPC::ChannelFactory> IPCTestBase::CreateChannelFactory(
160 const IPC::ChannelHandle& handle, 161 const IPC::ChannelHandle& handle,
161 base::TaskRunner* runner) { 162 base::TaskRunner* runner) {
162 return IPC::ChannelFactory::Create(handle, IPC::Channel::MODE_SERVER); 163 return IPC::ChannelFactory::Create(handle, IPC::Channel::MODE_SERVER);
163 } 164 }
OLDNEW
« no previous file with comments | « chrome/utility/importer/firefox_importer_unittest_utils_mac.cc ('k') | net/test/spawned_test_server/local_test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698