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 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 | 260 |
261 logging::SetLogAssertHandler(CrashHandler); | 261 logging::SetLogAssertHandler(CrashHandler); |
262 logging::SetLogMessageHandler(MessageHandler); | 262 logging::SetLogMessageHandler(MessageHandler); |
263 | 263 |
264 #if defined(OS_WIN) | 264 #if defined(OS_WIN) |
265 logging::LogEventProvider::Initialize(kStressCacheTraceProviderName); | 265 logging::LogEventProvider::Initialize(kStressCacheTraceProviderName); |
266 #else | 266 #else |
267 CommandLine::Init(argc, argv); | 267 CommandLine::Init(argc, argv); |
268 logging::InitLogging(NULL, logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, | 268 logging::InitLogging(NULL, logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, |
269 logging::LOCK_LOG_FILE, logging::DELETE_OLD_LOG_FILE, | 269 logging::LOCK_LOG_FILE, logging::DELETE_OLD_LOG_FILE, |
270 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); | 270 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS, |
| 271 logging::DISABLE_DLOG_FOR_NON_OFFICIAL_RELEASE_BUILDS); |
271 #endif | 272 #endif |
272 | 273 |
273 // Some time for the memory manager to flush stuff. | 274 // Some time for the memory manager to flush stuff. |
274 base::PlatformThread::Sleep(3000); | 275 base::PlatformThread::Sleep(3000); |
275 MessageLoop message_loop(MessageLoop::TYPE_IO); | 276 MessageLoop message_loop(MessageLoop::TYPE_IO); |
276 | 277 |
277 char* end; | 278 char* end; |
278 long int iteration = strtol(argv[1], &end, 0); | 279 long int iteration = strtol(argv[1], &end, 0); |
279 | 280 |
280 if (!StartCrashThread()) { | 281 if (!StartCrashThread()) { |
281 printf("failed to start thread\n"); | 282 printf("failed to start thread\n"); |
282 return kError; | 283 return kError; |
283 } | 284 } |
284 | 285 |
285 StressTheCache(iteration); | 286 StressTheCache(iteration); |
286 return 0; | 287 return 0; |
287 } | 288 } |
OLD | NEW |