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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 ListValue* list = model->GetModuleList(); | 90 ListValue* list = model->GetModuleList(); |
91 if (!model->confirmed_bad_modules_detected() && | 91 if (!model->confirmed_bad_modules_detected() && |
92 !model->suspected_bad_modules_detected()) { | 92 !model->suspected_bad_modules_detected()) { |
93 RecordSuccess(ASCIIToUTF16("No conflicting modules found")); | 93 RecordSuccess(ASCIIToUTF16("No conflicting modules found")); |
94 return true; | 94 return true; |
95 } | 95 } |
96 | 96 |
97 string16 failures = ASCIIToUTF16("Possibly conflicting modules:"); | 97 string16 failures = ASCIIToUTF16("Possibly conflicting modules:"); |
98 DictionaryValue* dictionary; | 98 DictionaryValue* dictionary; |
99 for (size_t i = 0; i < list->GetSize(); ++i) { | 99 for (size_t i = 0; i < list->GetSize(); ++i) { |
100 list->GetDictionary(i, &dictionary); | 100 if (!list->GetDictionary(i, &dictionary)) |
| 101 RecordFailure(ASCIIToUTF16("Dictionary lookup failed")); |
101 int status; | 102 int status; |
102 string16 location; | 103 string16 location; |
103 string16 name; | 104 string16 name; |
104 if (!dictionary->GetInteger("status", &status)) | 105 if (!dictionary->GetInteger("status", &status)) |
105 RecordFailure(ASCIIToUTF16("No 'status' field found")); | 106 RecordFailure(ASCIIToUTF16("No 'status' field found")); |
106 if (status < ModuleEnumerator::SUSPECTED_BAD) | 107 if (status < ModuleEnumerator::SUSPECTED_BAD) |
107 continue; | 108 continue; |
108 | 109 |
109 if (!dictionary->GetString("location", &location)) { | 110 if (!dictionary->GetString("location", &location)) { |
110 RecordFailure(ASCIIToUTF16("No 'location' field found")); | 111 RecordFailure(ASCIIToUTF16("No 'location' field found")); |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 path = path.Append(chrome::kBookmarksFileName); | 412 path = path.Append(chrome::kBookmarksFileName); |
412 return new JSONTest(path, ASCIIToUTF16("BookMarks JSON"), 2 * kOneMeg); | 413 return new JSONTest(path, ASCIIToUTF16("BookMarks JSON"), 2 * kOneMeg); |
413 } | 414 } |
414 | 415 |
415 DiagnosticTest* MakeLocalStateTest() { | 416 DiagnosticTest* MakeLocalStateTest() { |
416 FilePath path; | 417 FilePath path; |
417 PathService::Get(chrome::DIR_USER_DATA, &path); | 418 PathService::Get(chrome::DIR_USER_DATA, &path); |
418 path = path.Append(chrome::kLocalStateFilename); | 419 path = path.Append(chrome::kLocalStateFilename); |
419 return new JSONTest(path, ASCIIToUTF16("Local State JSON"), 50 * kOneKilo); | 420 return new JSONTest(path, ASCIIToUTF16("Local State JSON"), 50 * kOneKilo); |
420 } | 421 } |
OLD | NEW |