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

Side by Side Diff: net/disk_cache/stress_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 | « media/audio/win/audio_manager_win.cc ('k') | net/test/test_server_posix.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 is a simple application that stress-tests the crash recovery of the disk 5 // This is a simple application that stress-tests the crash recovery of the disk
6 // cache. The main application starts a copy of itself on a loop, checking the 6 // cache. The main application starts a copy of itself on a loop, checking the
7 // exit code of the child process. When the child dies in an unexpected way, 7 // exit code of the child process. When the child dies in an unexpected way,
8 // the main application quits. 8 // the main application quits.
9 9
10 // The child application has two threads: one to exercise the cache in an 10 // The child application has two threads: one to exercise the cache in an
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 // Starts a new process. 53 // Starts a new process.
54 int RunSlave(int iteration) { 54 int RunSlave(int iteration) {
55 FilePath exe; 55 FilePath exe;
56 PathService::Get(base::FILE_EXE, &exe); 56 PathService::Get(base::FILE_EXE, &exe);
57 57
58 CommandLine cmdline(exe); 58 CommandLine cmdline(exe);
59 cmdline.AppendArg(base::IntToString(iteration)); 59 cmdline.AppendArg(base::IntToString(iteration));
60 60
61 base::ProcessHandle handle; 61 base::ProcessHandle handle;
62 base::LaunchOptions options; 62 if (!base::LaunchProcess(cmdline, base::LaunchOptions(), &handle)) {
63 options.process_handle = &handle;
64 if (!base::LaunchProcess(cmdline, options)) {
65 printf("Unable to run test\n"); 63 printf("Unable to run test\n");
66 return kError; 64 return kError;
67 } 65 }
68 66
69 int exit_code; 67 int exit_code;
70 if (!base::WaitForExitCode(handle, &exit_code)) { 68 if (!base::WaitForExitCode(handle, &exit_code)) {
71 printf("Unable to get return code\n"); 69 printf("Unable to get return code\n");
72 return kError; 70 return kError;
73 } 71 }
74 return exit_code; 72 return exit_code;
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 long int iteration = strtol(argv[1], &end, 0); 235 long int iteration = strtol(argv[1], &end, 0);
238 236
239 if (!StartCrashThread()) { 237 if (!StartCrashThread()) {
240 printf("failed to start thread\n"); 238 printf("failed to start thread\n");
241 return kError; 239 return kError;
242 } 240 }
243 241
244 StressTheCache(iteration); 242 StressTheCache(iteration);
245 return 0; 243 return 0;
246 } 244 }
OLDNEW
« no previous file with comments | « media/audio/win/audio_manager_win.cc ('k') | net/test/test_server_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698