Index: chrome/browser/diagnostics/diagnostics_test.cc |
diff --git a/chrome/browser/diagnostics/diagnostics_test.cc b/chrome/browser/diagnostics/diagnostics_test.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..cd36c920fa70af51210a7639e63b8a8b17cc7f5d |
--- /dev/null |
+++ b/chrome/browser/diagnostics/diagnostics_test.cc |
@@ -0,0 +1,53 @@ |
+// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/diagnostics/diagnostics_test.h" |
+ |
+#include "base/file_path.h" |
+#include "base/path_service.h" |
+#include "chrome/common/chrome_constants.h" |
+#include "chrome/common/chrome_paths.h" |
+ |
+DiagnosticTest::DiagnosticTest(const string16& title) |
+ : title_(title), result_(DiagnosticsModel::TEST_NOT_RUN) { |
+} |
+ |
+DiagnosticTest::~DiagnosticTest() { |
+} |
+ |
+bool DiagnosticTest::Execute(DiagnosticsModel::Observer* observer, |
+ DiagnosticsModel* model, |
+ size_t index) { |
+ result_ = DiagnosticsModel::TEST_RUNNING; |
+ observer->OnProgress(index, 0, model); |
+ bool keep_going = ExecuteImpl(observer); |
+ observer->OnFinished(index, model); |
+ return keep_going; |
+} |
+ |
+string16 DiagnosticTest::GetTitle() { |
+ return title_; |
+} |
+ |
+DiagnosticsModel::TestResult DiagnosticTest::GetResult() { |
+ return result_; |
+} |
+ |
+string16 DiagnosticTest::GetAdditionalInfo() { |
+ return additional_info_; |
+} |
+ |
+void DiagnosticTest::RecordOutcome(const string16& additional_info, |
+ DiagnosticsModel::TestResult result) { |
+ additional_info_ = additional_info; |
+ result_ = result; |
+} |
+ |
+// static |
+FilePath DiagnosticTest::GetUserDefaultProfileDir() { |
+ FilePath path; |
+ if (!PathService::Get(chrome::DIR_USER_DATA, &path)) |
+ return FilePath(); |
+ return path.Append(FilePath::FromWStringHack(chrome::kNotSignedInProfile)); |
+} |