| OLD | NEW |
| 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_controller.h" | 5 #include "chrome/browser/diagnostics/diagnostics_controller.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
| 12 #include "base/files/scoped_temp_dir.h" | 12 #include "base/files/scoped_temp_dir.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 16 #include "chrome/browser/diagnostics/diagnostics_model.h" | 16 #include "chrome/browser/diagnostics/diagnostics_model.h" |
| 17 #include "chrome/browser/diagnostics/diagnostics_writer.h" | 17 #include "chrome/browser/diagnostics/diagnostics_writer.h" |
| 18 #include "chrome/browser/diagnostics/sqlite_diagnostics.h" | 18 #include "chrome/browser/diagnostics/sqlite_diagnostics.h" |
| 19 #include "chrome/common/chrome_paths.h" | 19 #include "chrome/common/chrome_paths.h" |
| 20 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" |
| 22 |
| 23 #if defined(OS_CHROMEOS) |
| 21 #include "chromeos/chromeos_constants.h" | 24 #include "chromeos/chromeos_constants.h" |
| 22 #include "testing/gtest/include/gtest/gtest.h" | 25 #endif // defined(OS_CHROMEOS) |
| 23 | 26 |
| 24 namespace diagnostics { | 27 namespace diagnostics { |
| 25 | 28 |
| 26 // Basic harness to acquire and release the required temporary environment to | 29 // Basic harness to acquire and release the required temporary environment to |
| 27 // run a test in. | 30 // run a test in. |
| 28 class DiagnosticsControllerTest : public testing::Test { | 31 class DiagnosticsControllerTest : public testing::Test { |
| 29 protected: | 32 protected: |
| 30 DiagnosticsControllerTest() : cmdline_(base::CommandLine::NO_PROGRAM) {} | 33 DiagnosticsControllerTest() : cmdline_(base::CommandLine::NO_PROGRAM) {} |
| 31 | 34 |
| 32 ~DiagnosticsControllerTest() override {} | 35 ~DiagnosticsControllerTest() override {} |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 EXPECT_EQ(DiagnosticsModel::TEST_FAIL_CONTINUE, info->GetResult()); | 157 EXPECT_EQ(DiagnosticsModel::TEST_FAIL_CONTINUE, info->GetResult()); |
| 155 EXPECT_EQ(DIAG_SQLITE_ERROR_HANDLER_CALLED, info->GetOutcomeCode()); | 158 EXPECT_EQ(DIAG_SQLITE_ERROR_HANDLER_CALLED, info->GetOutcomeCode()); |
| 156 | 159 |
| 157 DiagnosticsController::GetInstance()->RunRecovery(cmdline_, writer_.get()); | 160 DiagnosticsController::GetInstance()->RunRecovery(cmdline_, writer_.get()); |
| 158 EXPECT_EQ(DiagnosticsModel::RECOVERY_OK, info->GetResult()); | 161 EXPECT_EQ(DiagnosticsModel::RECOVERY_OK, info->GetResult()); |
| 159 EXPECT_FALSE(base::PathExists(db_path)); | 162 EXPECT_FALSE(base::PathExists(db_path)); |
| 160 } | 163 } |
| 161 #endif | 164 #endif |
| 162 | 165 |
| 163 } // namespace diagnostics | 166 } // namespace diagnostics |
| OLD | NEW |