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 29 matching lines...) Expand all Loading... |
40 NOT_REACHED | 40 NOT_REACHED |
41 }; | 41 }; |
42 | 42 |
43 using disk_cache::RankCrashes; | 43 using disk_cache::RankCrashes; |
44 | 44 |
45 // Starts a new process, to generate the files. | 45 // Starts a new process, to generate the files. |
46 int RunSlave(RankCrashes action) { | 46 int RunSlave(RankCrashes action) { |
47 base::FilePath exe; | 47 base::FilePath exe; |
48 PathService::Get(base::FILE_EXE, &exe); | 48 PathService::Get(base::FILE_EXE, &exe); |
49 | 49 |
50 CommandLine cmdline(exe); | 50 base::CommandLine cmdline(exe); |
51 cmdline.AppendArg(base::IntToString(action)); | 51 cmdline.AppendArg(base::IntToString(action)); |
52 | 52 |
53 base::ProcessHandle handle; | 53 base::ProcessHandle handle; |
54 if (!base::LaunchProcess(cmdline, base::LaunchOptions(), &handle)) { | 54 if (!base::LaunchProcess(cmdline, base::LaunchOptions(), &handle)) { |
55 printf("Unable to run test %d\n", action); | 55 printf("Unable to run test %d\n", action); |
56 return GENERIC; | 56 return GENERIC; |
57 } | 57 } |
58 | 58 |
59 int exit_code; | 59 int exit_code; |
60 | 60 |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 | 373 |
374 base::FilePath path; | 374 base::FilePath path; |
375 PathService::Get(base::DIR_SOURCE_ROOT, &path); | 375 PathService::Get(base::DIR_SOURCE_ROOT, &path); |
376 path = path.AppendASCII("net"); | 376 path = path.AppendASCII("net"); |
377 path = path.AppendASCII("data"); | 377 path = path.AppendASCII("data"); |
378 path = path.AppendASCII("cache_tests"); | 378 path = path.AppendASCII("cache_tests"); |
379 path = path.AppendASCII("new_crashes"); | 379 path = path.AppendASCII("new_crashes"); |
380 | 380 |
381 return SlaveCode(path, action); | 381 return SlaveCode(path, action); |
382 } | 382 } |
OLD | NEW |