Chromium Code Reviews| Index: chrome/browser/diagnostics/recon_diagnostics.cc |
| diff --git a/chrome/browser/diagnostics/recon_diagnostics.cc b/chrome/browser/diagnostics/recon_diagnostics.cc |
| index 059d6fc0009ccd47fc514b3c3fef9f85687a7f95..06132ebcdae0d7a197f6d4da2429cce6cedc5fb9 100644 |
| --- a/chrome/browser/diagnostics/recon_diagnostics.cc |
| +++ b/chrome/browser/diagnostics/recon_diagnostics.cc |
| @@ -328,12 +328,24 @@ class JSONTest : public DiagnosticsTest { |
| JSONTest(const base::FilePath& path, |
| const std::string& id, |
| const std::string& name, |
| - int64 max_file_size) |
| - : DiagnosticsTest(id, name), path_(path), max_file_size_(max_file_size) {} |
| + int64 max_file_size, |
| + bool critical) |
| + : DiagnosticsTest(id, name), |
| + path_(path), |
| + max_file_size_(max_file_size), |
| + critical_(critical) {} |
| virtual bool ExecuteImpl(DiagnosticsModel::Observer* observer) OVERRIDE { |
| if (!base::PathExists(path_)) { |
| - RecordFailure(DIAG_RECON_FILE_NOT_FOUND, "File not found"); |
| + if (critical_) { |
| + RecordOutcome(DIAG_RECON_FILE_NOT_FOUND, |
| + "File not found", |
| + DiagnosticsModel::TEST_FAIL_CONTINUE); |
| + } else { |
| + RecordOutcome(DIAG_RECON_FILE_NOT_FOUND_OK, |
| + "File not found (but that is OK)", |
| + DiagnosticsModel::TEST_OK); |
| + } |
| return true; |
| } |
| int64 file_size; |
| @@ -374,6 +386,7 @@ class JSONTest : public DiagnosticsTest { |
| private: |
| base::FilePath path_; |
| int64 max_file_size_; |
| + bool critical_; // Is it required that the file exist? |
| DISALLOW_COPY_AND_ASSIGN(JSONTest); |
| }; |
| @@ -406,23 +419,32 @@ DiagnosticsTest* MakeInstallTypeTest() { return new InstallTypeTest(); } |
| DiagnosticsTest* MakePreferencesTest() { |
| base::FilePath path = DiagnosticsTest::GetUserDefaultProfileDir(); |
| path = path.Append(chrome::kPreferencesFilename); |
| - return new JSONTest( |
| - path, kJSONProfileTest, "Profile JSON", 100 * kOneKilobyte); |
| + return new JSONTest(path, |
| + kJSONProfileTest, |
| + "Profile JSON", |
| + 100 * kOneKilobyte, |
| + true /* critical */); |
|
cpu_(ooo_6.6-7.5)
2013/07/25 19:40:56
please remove /* critical */ and everywhere or use
Greg Spencer (Chromium)
2013/07/26 18:51:30
Done.
|
| } |
| DiagnosticsTest* MakeBookMarksTest() { |
| base::FilePath path = DiagnosticsTest::GetUserDefaultProfileDir(); |
| path = path.Append(chrome::kBookmarksFileName); |
| - return new JSONTest( |
| - path, kJSONBookmarksTest, "Bookmarks JSON", 2 * kOneMegabyte); |
| + return new JSONTest(path, |
| + kJSONBookmarksTest, |
| + "Bookmarks JSON", |
| + 2 * kOneMegabyte, |
| + false /* critical */); |
| } |
| DiagnosticsTest* MakeLocalStateTest() { |
| base::FilePath path; |
| PathService::Get(chrome::DIR_USER_DATA, &path); |
| path = path.Append(chrome::kLocalStateFilename); |
| - return new JSONTest( |
| - path, kJSONLocalStateTest, "Local State JSON", 50 * kOneKilobyte); |
| + return new JSONTest(path, |
| + kJSONLocalStateTest, |
| + "Local State JSON", |
| + 50 * kOneKilobyte, |
| + true /* critical */); |
| } |
| } // namespace diagnostics |