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

Side by Side Diff: net/tools/crash_cache/crash_cache.cc

Issue 7377012: Change base::LaunchProcess API slightly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 5 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 | « net/test/test_server_posix.cc ('k') | net/tools/dump_cache/dump_cache.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // This command-line program generates the set of files needed for the crash- 5 // This command-line program generates the set of files needed for the crash-
6 // cache unit tests (DiskCacheTest,CacheBackend_Recover*). This program only 6 // cache unit tests (DiskCacheTest,CacheBackend_Recover*). This program only
7 // works properly on debug mode, because the crash functionality is not compiled 7 // works properly on debug mode, because the crash functionality is not compiled
8 // on release builds of the cache. 8 // on release builds of the cache.
9 9
10 #include <string> 10 #include <string>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 // Starts a new process, to generate the files. 43 // Starts a new process, to generate the files.
44 int RunSlave(RankCrashes action) { 44 int RunSlave(RankCrashes action) {
45 FilePath exe; 45 FilePath exe;
46 PathService::Get(base::FILE_EXE, &exe); 46 PathService::Get(base::FILE_EXE, &exe);
47 47
48 CommandLine cmdline(exe); 48 CommandLine cmdline(exe);
49 cmdline.AppendArg(base::IntToString(action)); 49 cmdline.AppendArg(base::IntToString(action));
50 50
51 base::ProcessHandle handle; 51 base::ProcessHandle handle;
52 base::LaunchOptions options; 52 if (!base::LaunchProcess(cmdline, base::LaunchOptions(), &handle)) {
53 options.process_handle = &handle;
54 if (!base::LaunchProcess(cmdline, options)) {
55 printf("Unable to run test %d\n", action); 53 printf("Unable to run test %d\n", action);
56 return GENERIC; 54 return GENERIC;
57 } 55 }
58 56
59 int exit_code; 57 int exit_code;
60 58
61 if (!base::WaitForExitCode(handle, &exit_code)) { 59 if (!base::WaitForExitCode(handle, &exit_code)) {
62 printf("Unable to get return code, test %d\n", action); 60 printf("Unable to get return code, test %d\n", action);
63 return GENERIC; 61 return GENERIC;
64 } 62 }
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 364
367 FilePath path; 365 FilePath path;
368 PathService::Get(base::DIR_SOURCE_ROOT, &path); 366 PathService::Get(base::DIR_SOURCE_ROOT, &path);
369 path = path.AppendASCII("net"); 367 path = path.AppendASCII("net");
370 path = path.AppendASCII("data"); 368 path = path.AppendASCII("data");
371 path = path.AppendASCII("cache_tests"); 369 path = path.AppendASCII("cache_tests");
372 path = path.AppendASCII("new_crashes"); 370 path = path.AppendASCII("new_crashes");
373 371
374 return SlaveCode(path, action); 372 return SlaveCode(path, action);
375 } 373 }
OLDNEW
« no previous file with comments | « net/test/test_server_posix.cc ('k') | net/tools/dump_cache/dump_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698