| 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 #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 29 matching lines...) Expand all Loading... |
| 40 InstallTypeTest* g_install_type = 0; | 40 InstallTypeTest* g_install_type = 0; |
| 41 | 41 |
| 42 // Check that the flavor of the operating system is supported. | 42 // Check that the flavor of the operating system is supported. |
| 43 class OperatingSystemTest : public DiagnosticTest { | 43 class OperatingSystemTest : public DiagnosticTest { |
| 44 public: | 44 public: |
| 45 OperatingSystemTest() : DiagnosticTest(ASCIIToUTF16("Operating System")) {} | 45 OperatingSystemTest() : DiagnosticTest(ASCIIToUTF16("Operating System")) {} |
| 46 | 46 |
| 47 virtual int GetId() { return 0; } | 47 virtual int GetId() { return 0; } |
| 48 | 48 |
| 49 virtual bool ExecuteImpl(DiagnosticsModel::Observer* observer) { | 49 virtual bool ExecuteImpl(DiagnosticsModel::Observer* observer) { |
| 50 int version = 0; |
| 51 int major = 0; |
| 52 int minor = 0; |
| 50 #if defined(OS_WIN) | 53 #if defined(OS_WIN) |
| 51 base::win::Version version = base::win::GetVersion(); | 54 version = base::win::GetVersion(); |
| 52 if ((version < base::win::VERSION_XP) || | 55 if (version < base::win::VERSION_XP) { |
| 53 ((version == base::win::VERSION_XP) && | 56 RecordFailure(ASCIIToUTF16("Windows 2000 or earlier")); |
| 54 (base::win::OSInfo::GetInstance()->service_pack().major < 2))) { | 57 return false; |
| 55 RecordFailure(ASCIIToUTF16("Must have Windows XP SP2 or later")); | 58 } |
| 59 base::win::GetServicePackLevel(&major, &minor); |
| 60 if ((version == base::win::VERSION_XP) && (major < 2)) { |
| 61 RecordFailure(ASCIIToUTF16("XP Service Pack 1 or earlier")); |
| 56 return false; | 62 return false; |
| 57 } | 63 } |
| 58 #else | 64 #else |
| 59 // TODO(port): define the OS criteria for Linux and Mac. | 65 // TODO(port): define the OS criteria for Linux and Mac. |
| 60 #endif // defined(OS_WIN) | 66 #endif // defined(OS_WIN) |
| 61 RecordSuccess(ASCIIToUTF16(StringPrintf("%s %s", | 67 RecordSuccess(ASCIIToUTF16(StringPrintf("%s %s (%d [%d:%d])", |
| 62 base::SysInfo::OperatingSystemName().c_str(), | 68 base::SysInfo::OperatingSystemName().c_str(), |
| 63 base::SysInfo::OperatingSystemVersion().c_str()))); | 69 base::SysInfo::OperatingSystemVersion().c_str(), |
| 70 version, major, minor))); |
| 64 return true; | 71 return true; |
| 65 } | 72 } |
| 66 | 73 |
| 67 private: | 74 private: |
| 68 DISALLOW_COPY_AND_ASSIGN(OperatingSystemTest); | 75 DISALLOW_COPY_AND_ASSIGN(OperatingSystemTest); |
| 69 }; | 76 }; |
| 70 | 77 |
| 71 // Check if any conflicting DLLs are loaded. | 78 // Check if any conflicting DLLs are loaded. |
| 72 class ConflictingDllsTest : public DiagnosticTest { | 79 class ConflictingDllsTest : public DiagnosticTest { |
| 73 public: | 80 public: |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 path = path.Append(chrome::kBookmarksFileName); | 421 path = path.Append(chrome::kBookmarksFileName); |
| 415 return new JSONTest(path, ASCIIToUTF16("BookMarks JSON"), 2 * kOneMeg); | 422 return new JSONTest(path, ASCIIToUTF16("BookMarks JSON"), 2 * kOneMeg); |
| 416 } | 423 } |
| 417 | 424 |
| 418 DiagnosticTest* MakeLocalStateTest() { | 425 DiagnosticTest* MakeLocalStateTest() { |
| 419 FilePath path; | 426 FilePath path; |
| 420 PathService::Get(chrome::DIR_USER_DATA, &path); | 427 PathService::Get(chrome::DIR_USER_DATA, &path); |
| 421 path = path.Append(chrome::kLocalStateFilename); | 428 path = path.Append(chrome::kLocalStateFilename); |
| 422 return new JSONTest(path, ASCIIToUTF16("Local State JSON"), 50 * kOneKilo); | 429 return new JSONTest(path, ASCIIToUTF16("Local State JSON"), 50 * kOneKilo); |
| 423 } | 430 } |
| OLD | NEW |