OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 18 matching lines...) Expand all Loading... |
29 #include "base/process/launch.h" | 29 #include "base/process/launch.h" |
30 #include "base/process/process_handle.h" | 30 #include "base/process/process_handle.h" |
31 #include "base/strings/string_number_conversions.h" | 31 #include "base/strings/string_number_conversions.h" |
32 #include "base/strings/string_util.h" | 32 #include "base/strings/string_util.h" |
33 #include "base/strings/utf_string_conversions.h" | 33 #include "base/strings/utf_string_conversions.h" |
34 #include "base/threading/platform_thread.h" | 34 #include "base/threading/platform_thread.h" |
35 #include "base/threading/thread.h" | 35 #include "base/threading/thread.h" |
36 #include "net/base/io_buffer.h" | 36 #include "net/base/io_buffer.h" |
37 #include "net/base/net_errors.h" | 37 #include "net/base/net_errors.h" |
38 #include "net/base/test_completion_callback.h" | 38 #include "net/base/test_completion_callback.h" |
39 #include "net/disk_cache/backend_impl.h" | 39 #include "net/disk_cache/blockfile/backend_impl.h" |
| 40 #include "net/disk_cache/blockfile/stress_support.h" |
| 41 #include "net/disk_cache/blockfile/trace.h" |
40 #include "net/disk_cache/disk_cache.h" | 42 #include "net/disk_cache/disk_cache.h" |
41 #include "net/disk_cache/disk_cache_test_util.h" | 43 #include "net/disk_cache/disk_cache_test_util.h" |
42 #include "net/disk_cache/stress_support.h" | |
43 #include "net/disk_cache/trace.h" | |
44 | 44 |
45 #if defined(OS_WIN) | 45 #if defined(OS_WIN) |
46 #include "base/logging_win.h" | 46 #include "base/logging_win.h" |
47 #endif | 47 #endif |
48 | 48 |
49 using base::Time; | 49 using base::Time; |
50 | 50 |
51 const int kError = -1; | 51 const int kError = -1; |
52 const int kExpectedCrash = 100; | 52 const int kExpectedCrash = 100; |
53 | 53 |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 long int iteration = strtol(argv[1], &end, 0); | 285 long int iteration = strtol(argv[1], &end, 0); |
286 | 286 |
287 if (!StartCrashThread()) { | 287 if (!StartCrashThread()) { |
288 printf("failed to start thread\n"); | 288 printf("failed to start thread\n"); |
289 return kError; | 289 return kError; |
290 } | 290 } |
291 | 291 |
292 StressTheCache(iteration); | 292 StressTheCache(iteration); |
293 return 0; | 293 return 0; |
294 } | 294 } |
OLD | NEW |