Chromium Code Reviews| 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/recon_diagnostics.h" | 5 #include "chrome/browser/diagnostics/recon_diagnostics.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 352 DISALLOW_COPY_AND_ASSIGN(PathTest); | 352 DISALLOW_COPY_AND_ASSIGN(PathTest); |
| 353 }; | 353 }; |
| 354 | 354 |
| 355 // Check the version of Chrome. | 355 // Check the version of Chrome. |
| 356 class VersionTest : public DiagnosticsTest { | 356 class VersionTest : public DiagnosticsTest { |
| 357 public: | 357 public: |
| 358 VersionTest() : DiagnosticsTest(DIAGNOSTICS_VERSION_TEST) {} | 358 VersionTest() : DiagnosticsTest(DIAGNOSTICS_VERSION_TEST) {} |
| 359 | 359 |
| 360 virtual bool ExecuteImpl(DiagnosticsModel::Observer* observer) OVERRIDE { | 360 virtual bool ExecuteImpl(DiagnosticsModel::Observer* observer) OVERRIDE { |
| 361 chrome::VersionInfo version_info; | 361 chrome::VersionInfo version_info; |
| 362 if (!version_info.is_valid()) { | |
| 363 RecordFailure(DIAG_RECON_NO_VERSION, "No Version"); | |
|
Lei Zhang
2014/10/06 19:22:52
DIAG_RECON_NO_VERSION is no longer used, but I'm n
cpu_(ooo_6.6-7.5)
2014/10/06 19:27:43
This might be used by CroS. Sad times.
| |
| 364 return true; | |
| 365 } | |
| 366 std::string current_version = version_info.Version(); | 362 std::string current_version = version_info.Version(); |
| 367 if (current_version.empty()) { | 363 if (current_version.empty()) { |
| 368 RecordFailure(DIAG_RECON_EMPTY_VERSION, "Empty Version"); | 364 RecordFailure(DIAG_RECON_EMPTY_VERSION, "Empty Version"); |
| 369 return true; | 365 return true; |
| 370 } | 366 } |
| 371 std::string version_modifier = | 367 std::string version_modifier = |
| 372 chrome::VersionInfo::GetVersionStringModifier(); | 368 chrome::VersionInfo::GetVersionStringModifier(); |
| 373 if (!version_modifier.empty()) | 369 if (!version_modifier.empty()) |
| 374 current_version += " " + version_modifier; | 370 current_version += " " + version_modifier; |
| 375 #if defined(GOOGLE_CHROME_BUILD) | 371 #if defined(GOOGLE_CHROME_BUILD) |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 432 | 428 |
| 433 DiagnosticsTest* MakeResourcesFileTest() { | 429 DiagnosticsTest* MakeResourcesFileTest() { |
| 434 return new PathTest(kPathsToTest[2]); | 430 return new PathTest(kPathsToTest[2]); |
| 435 } | 431 } |
| 436 | 432 |
| 437 DiagnosticsTest* MakeUserDirTest() { return new PathTest(kPathsToTest[3]); } | 433 DiagnosticsTest* MakeUserDirTest() { return new PathTest(kPathsToTest[3]); } |
| 438 | 434 |
| 439 DiagnosticsTest* MakeVersionTest() { return new VersionTest(); } | 435 DiagnosticsTest* MakeVersionTest() { return new VersionTest(); } |
| 440 | 436 |
| 441 } // namespace diagnostics | 437 } // namespace diagnostics |
| OLD | NEW |