OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 22 matching lines...) Expand all Loading... |
33 NOT_REACHED | 33 NOT_REACHED |
34 }; | 34 }; |
35 | 35 |
36 using disk_cache::RankCrashes; | 36 using disk_cache::RankCrashes; |
37 | 37 |
38 // Starts a new process, to generate the files. | 38 // Starts a new process, to generate the files. |
39 int RunSlave(RankCrashes action) { | 39 int RunSlave(RankCrashes action) { |
40 FilePath exe; | 40 FilePath exe; |
41 PathService::Get(base::FILE_EXE, &exe); | 41 PathService::Get(base::FILE_EXE, &exe); |
42 | 42 |
43 CommandLine cmdline(exe.ToWStringHack()); | 43 CommandLine cmdline(exe); |
44 cmdline.AppendLooseValue(ASCIIToWide(IntToString(action))); | 44 cmdline.AppendLooseValue(ASCIIToWide(IntToString(action))); |
45 | 45 |
46 base::ProcessHandle handle; | 46 base::ProcessHandle handle; |
47 if (!base::LaunchApp(cmdline, false, false, &handle)) { | 47 if (!base::LaunchApp(cmdline, false, false, &handle)) { |
48 printf("Unable to run test %d\n", action); | 48 printf("Unable to run test %d\n", action); |
49 return GENERIC; | 49 return GENERIC; |
50 } | 50 } |
51 | 51 |
52 int exit_code; | 52 int exit_code; |
53 | 53 |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 | 302 |
303 FilePath path; | 303 FilePath path; |
304 PathService::Get(base::DIR_SOURCE_ROOT, &path); | 304 PathService::Get(base::DIR_SOURCE_ROOT, &path); |
305 path = path.AppendASCII("net"); | 305 path = path.AppendASCII("net"); |
306 path = path.AppendASCII("data"); | 306 path = path.AppendASCII("data"); |
307 path = path.AppendASCII("cache_tests"); | 307 path = path.AppendASCII("cache_tests"); |
308 path = path.AppendASCII("new_crashes"); | 308 path = path.AppendASCII("new_crashes"); |
309 | 309 |
310 return SlaveCode(path, action); | 310 return SlaveCode(path, action); |
311 } | 311 } |
OLD | NEW |