OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/recon_diagnostics.h" | 5 #include "chrome/browser/diagnostics/recon_diagnostics.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 110 |
111 // Check the version of Chrome. | 111 // Check the version of Chrome. |
112 class VersionTest : public DiagnosticTest { | 112 class VersionTest : public DiagnosticTest { |
113 public: | 113 public: |
114 VersionTest() : DiagnosticTest(ASCIIToUTF16("Browser Version")) {} | 114 VersionTest() : DiagnosticTest(ASCIIToUTF16("Browser Version")) {} |
115 | 115 |
116 virtual int GetId() { return 0; } | 116 virtual int GetId() { return 0; } |
117 | 117 |
118 virtual bool ExecuteImpl(DiagnosticsModel::Observer* observer) { | 118 virtual bool ExecuteImpl(DiagnosticsModel::Observer* observer) { |
119 chrome::VersionInfo version_info; | 119 chrome::VersionInfo version_info; |
120 if (!version_info.is_valid()) { | |
121 RecordFailure(ASCIIToUTF16("No Version")); | |
122 return true; | |
123 } | |
124 std::string current_version = version_info.Version(); | 120 std::string current_version = version_info.Version(); |
125 if (current_version.empty()) { | 121 if (current_version.empty()) { |
126 RecordFailure(ASCIIToUTF16("Empty Version")); | 122 RecordFailure(ASCIIToUTF16("Empty Version")); |
127 return true; | 123 return true; |
128 } | 124 } |
129 std::string version_modifier = platform_util::GetVersionStringModifier(); | 125 std::string version_modifier = platform_util::GetVersionStringModifier(); |
130 if (!version_modifier.empty()) | 126 if (!version_modifier.empty()) |
131 current_version += " " + version_modifier; | 127 current_version += " " + version_modifier; |
132 #if defined(GOOGLE_CHROME_BUILD) | 128 #if defined(GOOGLE_CHROME_BUILD) |
133 current_version += " GCB"; | 129 current_version += " GCB"; |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 path = path.Append(chrome::kBookmarksFileName); | 348 path = path.Append(chrome::kBookmarksFileName); |
353 return new JSONTest(path, ASCIIToUTF16("BookMarks JSON"), 2 * kOneMeg); | 349 return new JSONTest(path, ASCIIToUTF16("BookMarks JSON"), 2 * kOneMeg); |
354 } | 350 } |
355 | 351 |
356 DiagnosticTest* MakeLocalStateTest() { | 352 DiagnosticTest* MakeLocalStateTest() { |
357 FilePath path; | 353 FilePath path; |
358 PathService::Get(chrome::DIR_USER_DATA, &path); | 354 PathService::Get(chrome::DIR_USER_DATA, &path); |
359 path = path.Append(chrome::kLocalStateFilename); | 355 path = path.Append(chrome::kLocalStateFilename); |
360 return new JSONTest(path, ASCIIToUTF16("Local State JSON"), 50 * kOneKilo); | 356 return new JSONTest(path, ASCIIToUTF16("Local State JSON"), 50 * kOneKilo); |
361 } | 357 } |
OLD | NEW |