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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 "remove_head2", | 107 "remove_head2", |
108 "remove_head3", | 108 "remove_head3", |
109 "remove_head4", | 109 "remove_head4", |
110 "remove_tail1", | 110 "remove_tail1", |
111 "remove_tail2", | 111 "remove_tail2", |
112 "remove_tail3", | 112 "remove_tail3", |
113 "remove_load1", | 113 "remove_load1", |
114 "remove_load2", | 114 "remove_load2", |
115 "remove_load3" | 115 "remove_load3" |
116 }; | 116 }; |
117 COMPILE_ASSERT(arraysize(folders) == disk_cache::MAX_CRASH, sync_folders); | 117 static_assert(arraysize(folders) == disk_cache::MAX_CRASH, "sync folders"); |
118 DCHECK(action > disk_cache::NO_CRASH && action < disk_cache::MAX_CRASH); | 118 DCHECK(action > disk_cache::NO_CRASH && action < disk_cache::MAX_CRASH); |
119 | 119 |
120 *full_path = path.AppendASCII(folders[action]); | 120 *full_path = path.AppendASCII(folders[action]); |
121 | 121 |
122 if (base::PathExists(*full_path)) | 122 if (base::PathExists(*full_path)) |
123 return false; | 123 return false; |
124 | 124 |
125 return base::CreateDirectory(*full_path); | 125 return base::CreateDirectory(*full_path); |
126 } | 126 } |
127 | 127 |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 | 372 |
373 base::FilePath path; | 373 base::FilePath path; |
374 PathService::Get(base::DIR_SOURCE_ROOT, &path); | 374 PathService::Get(base::DIR_SOURCE_ROOT, &path); |
375 path = path.AppendASCII("net"); | 375 path = path.AppendASCII("net"); |
376 path = path.AppendASCII("data"); | 376 path = path.AppendASCII("data"); |
377 path = path.AppendASCII("cache_tests"); | 377 path = path.AppendASCII("cache_tests"); |
378 path = path.AppendASCII("new_crashes"); | 378 path = path.AppendASCII("new_crashes"); |
379 | 379 |
380 return SlaveCode(path, action); | 380 return SlaveCode(path, action); |
381 } | 381 } |
OLD | NEW |