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 #include "chrome/browser/diagnostics/sqlite_diagnostics.h" | 5 #include "chrome/browser/diagnostics/sqlite_diagnostics.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 virtual bool ExecuteImpl(DiagnosticsModel::Observer* observer) OVERRIDE { | 57 virtual bool ExecuteImpl(DiagnosticsModel::Observer* observer) OVERRIDE { |
58 // If we're given an absolute path, use it. If not, then assume it's under | 58 // If we're given an absolute path, use it. If not, then assume it's under |
59 // the profile directory. | 59 // the profile directory. |
60 base::FilePath path; | 60 base::FilePath path; |
61 if (!db_path_.IsAbsolute()) | 61 if (!db_path_.IsAbsolute()) |
62 path = GetUserDefaultProfileDir().Append(db_path_); | 62 path = GetUserDefaultProfileDir().Append(db_path_); |
63 else | 63 else |
64 path = db_path_; | 64 path = db_path_; |
65 | 65 |
66 if (!file_util::PathExists(path)) { | 66 if (!base::PathExists(path)) { |
67 if (critical_) { | 67 if (critical_) { |
68 RecordOutcome(DIAG_SQLITE_FILE_NOT_FOUND, | 68 RecordOutcome(DIAG_SQLITE_FILE_NOT_FOUND, |
69 "File not found", | 69 "File not found", |
70 DiagnosticsModel::TEST_FAIL_CONTINUE); | 70 DiagnosticsModel::TEST_FAIL_CONTINUE); |
71 } else { | 71 } else { |
72 RecordOutcome(DIAG_SQLITE_FILE_NOT_FOUND_OK, | 72 RecordOutcome(DIAG_SQLITE_FILE_NOT_FOUND_OK, |
73 "File not found (but that is OK)", | 73 "File not found (but that is OK)", |
74 DiagnosticsModel::TEST_OK); | 74 DiagnosticsModel::TEST_OK); |
75 } | 75 } |
76 return true; | 76 return true; |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 | 252 |
253 DiagnosticsTest* MakeSqliteNssKeyDbTest() { | 253 DiagnosticsTest* MakeSqliteNssKeyDbTest() { |
254 base::FilePath home_dir = file_util::GetHomeDir(); | 254 base::FilePath home_dir = file_util::GetHomeDir(); |
255 return new SqliteIntegrityTest(false, | 255 return new SqliteIntegrityTest(false, |
256 kSQLiteIntegrityNSSKeyTest, | 256 kSQLiteIntegrityNSSKeyTest, |
257 "NSS Key Database", | 257 "NSS Key Database", |
258 home_dir.Append(chromeos::kNssKeyDbPath)); | 258 home_dir.Append(chromeos::kNssKeyDbPath)); |
259 } | 259 } |
260 #endif // defined(OS_CHROMEOS) | 260 #endif // defined(OS_CHROMEOS) |
261 } // namespace diagnostics | 261 } // namespace diagnostics |
OLD | NEW |