| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <memory> |
| 6 |
| 5 #include "base/bind.h" | 7 #include "base/bind.h" |
| 6 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 7 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "base/metrics/statistics_recorder.h" | 11 #include "base/metrics/statistics_recorder.h" |
| 11 #include "base/path_service.h" | 12 #include "base/path_service.h" |
| 12 #include "base/test/launcher/unit_test_launcher.h" | 13 #include "base/test/launcher/unit_test_launcher.h" |
| 13 #include "base/test/test_suite.h" | 14 #include "base/test/test_suite.h" |
| 14 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 15 #include "components/content_settings/core/common/content_settings_pattern.h" | 16 #include "components/content_settings/core/common/content_settings_pattern.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 17 #include "ui/base/resource/resource_bundle.h" | 18 #include "ui/base/resource/resource_bundle.h" |
| 18 #include "ui/base/ui_base_paths.h" | 19 #include "ui/base/ui_base_paths.h" |
| 19 #include "url/url_util.h" | 20 #include "url/url_util.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 } | 127 } |
| 127 | 128 |
| 128 void OnTestEnd(const testing::TestInfo& test_info) override { | 129 void OnTestEnd(const testing::TestInfo& test_info) override { |
| 129 #if !defined(OS_IOS) | 130 #if !defined(OS_IOS) |
| 130 content_initializer_.reset(); | 131 content_initializer_.reset(); |
| 131 #endif | 132 #endif |
| 132 } | 133 } |
| 133 | 134 |
| 134 private: | 135 private: |
| 135 #if !defined(OS_IOS) | 136 #if !defined(OS_IOS) |
| 136 scoped_ptr<content::TestContentClientInitializer> content_initializer_; | 137 std::unique_ptr<content::TestContentClientInitializer> content_initializer_; |
| 137 #endif | 138 #endif |
| 138 | 139 |
| 139 DISALLOW_COPY_AND_ASSIGN(ComponentsUnitTestEventListener); | 140 DISALLOW_COPY_AND_ASSIGN(ComponentsUnitTestEventListener); |
| 140 }; | 141 }; |
| 141 | 142 |
| 142 } // namespace | 143 } // namespace |
| 143 | 144 |
| 144 int main(int argc, char** argv) { | 145 int main(int argc, char** argv) { |
| 145 ComponentsTestSuite test_suite(argc, argv); | 146 ComponentsTestSuite test_suite(argc, argv); |
| 146 | 147 |
| 147 // The listener will set up common test environment for all components unit | 148 // The listener will set up common test environment for all components unit |
| 148 // tests. | 149 // tests. |
| 149 testing::TestEventListeners& listeners = | 150 testing::TestEventListeners& listeners = |
| 150 testing::UnitTest::GetInstance()->listeners(); | 151 testing::UnitTest::GetInstance()->listeners(); |
| 151 listeners.Append(new ComponentsUnitTestEventListener()); | 152 listeners.Append(new ComponentsUnitTestEventListener()); |
| 152 | 153 |
| 153 #if defined(OS_CHROMEOS) | 154 #if defined(OS_CHROMEOS) |
| 154 mojo::edk::Init(); | 155 mojo::edk::Init(); |
| 155 #endif | 156 #endif |
| 156 | 157 |
| 157 return base::LaunchUnitTests( | 158 return base::LaunchUnitTests( |
| 158 argc, argv, base::Bind(&base::TestSuite::Run, | 159 argc, argv, base::Bind(&base::TestSuite::Run, |
| 159 base::Unretained(&test_suite))); | 160 base::Unretained(&test_suite))); |
| 160 } | 161 } |
| OLD | NEW |