OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |