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

Side by Side Diff: base/test/launcher/unit_test_launcher.cc

Issue 441333002: Disallow breakaway from job for unit tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « base/test/launcher/test_launcher.cc ('k') | content/public/test/test_launcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/test/launcher/unit_test_launcher.h" 5 #include "base/test/launcher/unit_test_launcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 180
181 GTestCallbackState callback_state; 181 GTestCallbackState callback_state;
182 callback_state.test_launcher = test_launcher; 182 callback_state.test_launcher = test_launcher;
183 callback_state.test_names = current_test_names; 183 callback_state.test_names = current_test_names;
184 callback_state.output_file = output_file; 184 callback_state.output_file = output_file;
185 185
186 test_launcher->LaunchChildGTestProcess( 186 test_launcher->LaunchChildGTestProcess(
187 cmd_line, 187 cmd_line,
188 std::string(), 188 std::string(),
189 TestTimeouts::test_launcher_timeout(), 189 TestTimeouts::test_launcher_timeout(),
190 use_job_objects_, 190 use_job_objects_ ? TestLauncher::USE_JOB_OBJECTS : 0,
191 Bind(&UnitTestLauncherDelegate::SerialGTestCallback, 191 Bind(&UnitTestLauncherDelegate::SerialGTestCallback,
192 Unretained(this), 192 Unretained(this),
193 callback_state, 193 callback_state,
194 new_test_names)); 194 new_test_names));
195 } 195 }
196 196
197 void RunBatch(TestLauncher* test_launcher, 197 void RunBatch(TestLauncher* test_launcher,
198 const std::vector<std::string>& test_names) { 198 const std::vector<std::string>& test_names) {
199 DCHECK(thread_checker_.CalledOnValidThread()); 199 DCHECK(thread_checker_.CalledOnValidThread());
200 200
(...skipping 21 matching lines...) Expand all
222 222
223 GTestCallbackState callback_state; 223 GTestCallbackState callback_state;
224 callback_state.test_launcher = test_launcher; 224 callback_state.test_launcher = test_launcher;
225 callback_state.test_names = test_names; 225 callback_state.test_names = test_names;
226 callback_state.output_file = output_file; 226 callback_state.output_file = output_file;
227 227
228 test_launcher->LaunchChildGTestProcess( 228 test_launcher->LaunchChildGTestProcess(
229 cmd_line, 229 cmd_line,
230 std::string(), 230 std::string(),
231 timeout, 231 timeout,
232 use_job_objects_, 232 use_job_objects_ ? TestLauncher::USE_JOB_OBJECTS : 0,
233 Bind(&UnitTestLauncherDelegate::GTestCallback, 233 Bind(&UnitTestLauncherDelegate::GTestCallback,
234 Unretained(this), 234 Unretained(this),
235 callback_state)); 235 callback_state));
236 } 236 }
237 237
238 void GTestCallback(const GTestCallbackState& callback_state, 238 void GTestCallback(const GTestCallbackState& callback_state,
239 int exit_code, 239 int exit_code,
240 const TimeDelta& elapsed_time, 240 const TimeDelta& elapsed_time,
241 bool was_timeout, 241 bool was_timeout,
242 const std::string& output) { 242 const std::string& output) {
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 CommandLine::Init(argc, NULL); 577 CommandLine::Init(argc, NULL);
578 return LaunchUnitTestsInternal( 578 return LaunchUnitTestsInternal(
579 run_test_suite, 579 run_test_suite,
580 SysInfo::NumberOfProcessors(), 580 SysInfo::NumberOfProcessors(),
581 use_job_objects, 581 use_job_objects,
582 Bind(&InitGoogleTestWChar, &argc, argv)); 582 Bind(&InitGoogleTestWChar, &argc, argv));
583 } 583 }
584 #endif // defined(OS_WIN) 584 #endif // defined(OS_WIN)
585 585
586 } // namespace base 586 } // namespace base
OLDNEW
« no previous file with comments | « base/test/launcher/test_launcher.cc ('k') | content/public/test/test_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698