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

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

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 #ifndef CHROME_BROWSER_DIAGNOSTICS_DIAGNOSTICS_WRITER_H_ 5 #ifndef CHROME_BROWSER_DIAGNOSTICS_DIAGNOSTICS_WRITER_H_
6 #define CHROME_BROWSER_DIAGNOSTICS_DIAGNOSTICS_WRITER_H_ 6 #define CHROME_BROWSER_DIAGNOSTICS_DIAGNOSTICS_WRITER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "chrome/browser/diagnostics/diagnostics_model.h" 10 #include "chrome/browser/diagnostics/diagnostics_model.h"
(...skipping 19 matching lines...) Expand all
30 int failures() { return failures_; } 30 int failures() { return failures_; }
31 31
32 // What format are we writing things in. 32 // What format are we writing things in.
33 FormatType format() const { return format_; } 33 FormatType format() const { return format_; }
34 34
35 // Write an informational line of text in white over black. String must be 35 // Write an informational line of text in white over black. String must be
36 // UTF8 encoded. A newline will be added for non-LOG output formats. 36 // UTF8 encoded. A newline will be added for non-LOG output formats.
37 bool WriteInfoLine(const std::string& info_text); 37 bool WriteInfoLine(const std::string& info_text);
38 38
39 // DiagnosticsModel::Observer overrides 39 // DiagnosticsModel::Observer overrides
40 virtual void OnFinished(int id, DiagnosticsModel* model) OVERRIDE; 40 virtual void OnTestFinished(int index, DiagnosticsModel* model) OVERRIDE;
41 virtual void OnDoneAll(DiagnosticsModel* model) OVERRIDE; 41 virtual void OnAllTestsDone(DiagnosticsModel* model) OVERRIDE;
42 virtual void OnRecoveryFinished(int index, DiagnosticsModel* model) OVERRIDE;
43 virtual void OnAllRecoveryDone(DiagnosticsModel* model) OVERRIDE;
42 44
43 private: 45 private:
44 // Write a result block. For humans, it consists of two lines. The first line 46 // Write a result block. For humans, it consists of two lines. The first line
45 // has [PASS] or [FAIL] with |name| and the second line has the text in 47 // has [PASS] or [FAIL] with |name| and the second line has the text in
46 // |extra|. For machine and log formats, we just have [PASS] or [FAIL], 48 // |extra|. For machine and log formats, we just have [PASS] or [FAIL],
47 // followed by the exact error code and the id. Name and extra strings must be 49 // followed by the exact error code and the id. Name and extra strings must be
48 // UTF8 encoded, as they are user-facing strings. 50 // UTF8 encoded, as they are user-facing strings.
49 bool WriteResult(bool success, 51 bool WriteResult(bool success,
50 const std::string& id, 52 const std::string& id,
51 const std::string& name, 53 const std::string& name,
52 int outcome_code, 54 int outcome_code,
53 const std::string& extra); 55 const std::string& extra);
54 56
55 scoped_ptr<SimpleConsole> console_; 57 scoped_ptr<SimpleConsole> console_;
56 58
57 // Keeps track of how many tests reported failure. 59 // Keeps track of how many tests reported failure.
58 int failures_; 60 int failures_;
59 FormatType format_; 61 FormatType format_;
60 62
61 DISALLOW_COPY_AND_ASSIGN(DiagnosticsWriter); 63 DISALLOW_COPY_AND_ASSIGN(DiagnosticsWriter);
62 }; 64 };
63 65
64 } // namespace diagnostics 66 } // namespace diagnostics
65 67
66 #endif // CHROME_BROWSER_DIAGNOSTICS_DIAGNOSTICS_WRITER_H_ 68 #endif // CHROME_BROWSER_DIAGNOSTICS_DIAGNOSTICS_WRITER_H_
OLDNEW
« no previous file with comments | « chrome/browser/diagnostics/diagnostics_test.cc ('k') | chrome/browser/diagnostics/diagnostics_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698