Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Side by Side Diff: chrome/browser/diagnostics/diagnostics_writer.cc

Issue 16948012: This adds a recovery mode to the diagnostics (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Upload after merge Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/diagnostics_writer.h" 5 #include "chrome/browser/diagnostics/diagnostics_writer.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #if defined(OS_POSIX) 9 #if defined(OS_POSIX)
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 return true; 215 return true;
216 } else { 216 } else {
217 if (console_.get()) { 217 if (console_.get()) {
218 console_->SetColor(SimpleConsole::DEFAULT); 218 console_->SetColor(SimpleConsole::DEFAULT);
219 console_->Write(UTF8ToUTF16(info_text + "\n")); 219 console_->Write(UTF8ToUTF16(info_text + "\n"));
220 } 220 }
221 } 221 }
222 return true; 222 return true;
223 } 223 }
224 224
225 void DiagnosticsWriter::OnFinished(int index, DiagnosticsModel* model) { 225 void DiagnosticsWriter::OnTestFinished(int index, DiagnosticsModel* model) {
226 const DiagnosticsModel::TestInfo& test_info = model->GetTest(index); 226 const DiagnosticsModel::TestInfo& test_info = model->GetTest(index);
227 bool success = (DiagnosticsModel::TEST_OK == test_info.GetResult()); 227 bool success = (DiagnosticsModel::TEST_OK == test_info.GetResult());
228 WriteResult(success, 228 WriteResult(success,
229 test_info.GetId(), 229 test_info.GetId(),
230 test_info.GetTitle(), 230 test_info.GetTitle(),
231 test_info.GetOutcomeCode(), 231 test_info.GetOutcomeCode(),
232 test_info.GetAdditionalInfo()); 232 test_info.GetAdditionalInfo());
233 } 233 }
234 234
235 void DiagnosticsWriter::OnDoneAll(DiagnosticsModel* model) { 235 void DiagnosticsWriter::OnAllTestsDone(DiagnosticsModel* model) {
236 WriteInfoLine( 236 WriteInfoLine(
237 base::StringPrintf("Finished %d tests.", model->GetTestRunCount())); 237 base::StringPrintf("Finished %d tests.", model->GetTestRunCount()));
238 } 238 }
239 239
240 void DiagnosticsWriter::OnRecoveryFinished(int index, DiagnosticsModel* model) {
241 const DiagnosticsModel::TestInfo& test_info = model->GetTest(index);
242 WriteInfoLine("Finished Recovery for: " + test_info.GetTitle());
243 }
244
245 void DiagnosticsWriter::OnAllRecoveryDone(DiagnosticsModel* model) {
246 WriteInfoLine("Finished All Recovery operations.");
247 }
248
240 bool DiagnosticsWriter::WriteResult(bool success, 249 bool DiagnosticsWriter::WriteResult(bool success,
241 const std::string& id, 250 const std::string& id,
242 const std::string& name, 251 const std::string& name,
243 int outcome_code, 252 int outcome_code,
244 const std::string& extra) { 253 const std::string& extra) {
245 std::string result; 254 std::string result;
246 SimpleConsole::Color color; 255 SimpleConsole::Color color;
247 256
248 if (success) { 257 if (success) {
249 result = "[PASS] "; 258 result = "[PASS] ";
(...skipping 22 matching lines...) Expand all
272 result.c_str(), 281 result.c_str(),
273 outcome_code, 282 outcome_code,
274 id.c_str(), 283 id.c_str(),
275 extra.c_str())); 284 extra.c_str()));
276 } 285 }
277 } 286 }
278 return true; 287 return true;
279 } 288 }
280 289
281 } // namespace diagnostics 290 } // namespace diagnostics
OLDNEW
« no previous file with comments | « chrome/browser/diagnostics/diagnostics_writer.h ('k') | chrome/browser/diagnostics/recon_diagnostics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698