| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/metrics/statistics_recorder.h" | 9 #include "base/metrics/statistics_recorder.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 11 #include "base/test/launcher/unit_test_launcher.h" | 11 #include "base/test/launcher/unit_test_launcher.h" |
| 12 #include "base/test/test_io_thread.h" |
| 12 #include "base/test/test_suite.h" | 13 #include "base/test/test_suite.h" |
| 13 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 14 #include "components/content_settings/core/common/content_settings_pattern.h" | 15 #include "components/content_settings/core/common/content_settings_pattern.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 16 #include "ui/base/resource/resource_bundle.h" | 17 #include "ui/base/resource/resource_bundle.h" |
| 17 #include "ui/base/ui_base_paths.h" | 18 #include "ui/base/ui_base_paths.h" |
| 18 #include "url/url_util.h" | 19 #include "url/url_util.h" |
| 19 | 20 |
| 20 #if !defined(OS_IOS) | 21 #if !defined(OS_IOS) |
| 21 #include "content/public/test/test_content_client_initializer.h" | 22 #include "content/public/test/test_content_client_initializer.h" |
| 22 #include "ui/gl/test/gl_surface_test_support.h" | 23 #include "ui/gl/test/gl_surface_test_support.h" |
| 23 #endif | 24 #endif |
| 24 | 25 |
| 25 #if defined(OS_ANDROID) | 26 #if defined(OS_ANDROID) |
| 26 #include "base/android/jni_android.h" | 27 #include "base/android/jni_android.h" |
| 27 #include "components/invalidation/impl/android/component_jni_registrar.h" | 28 #include "components/invalidation/impl/android/component_jni_registrar.h" |
| 28 #include "components/policy/core/browser/android/component_jni_registrar.h" | 29 #include "components/policy/core/browser/android/component_jni_registrar.h" |
| 29 #include "components/safe_json/android/component_jni_registrar.h" | 30 #include "components/safe_json/android/component_jni_registrar.h" |
| 30 #include "components/signin/core/browser/android/component_jni_registrar.h" | 31 #include "components/signin/core/browser/android/component_jni_registrar.h" |
| 31 #include "content/public/test/test_utils.h" | 32 #include "content/public/test/test_utils.h" |
| 32 #include "net/android/net_jni_registrar.h" | 33 #include "net/android/net_jni_registrar.h" |
| 33 #include "ui/base/android/ui_base_jni_registrar.h" | 34 #include "ui/base/android/ui_base_jni_registrar.h" |
| 34 #include "ui/gfx/android/gfx_jni_registrar.h" | 35 #include "ui/gfx/android/gfx_jni_registrar.h" |
| 35 #endif | 36 #endif |
| 36 | 37 |
| 37 #if defined(OS_CHROMEOS) | 38 #if defined(OS_CHROMEOS) |
| 38 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" | 39 #include "mojo/edk/embedder/embedder.h" |
| 39 #endif | 40 #endif |
| 40 | 41 |
| 41 namespace { | 42 namespace { |
| 42 | 43 |
| 43 class ComponentsTestSuite : public base::TestSuite { | 44 class ComponentsTestSuite : public base::TestSuite { |
| 44 public: | 45 public: |
| 45 ComponentsTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} | 46 ComponentsTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} |
| 46 | 47 |
| 47 private: | 48 private: |
| 48 void Initialize() override { | 49 void Initialize() override { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 int main(int argc, char** argv) { | 138 int main(int argc, char** argv) { |
| 138 ComponentsTestSuite test_suite(argc, argv); | 139 ComponentsTestSuite test_suite(argc, argv); |
| 139 | 140 |
| 140 // The listener will set up common test environment for all components unit | 141 // The listener will set up common test environment for all components unit |
| 141 // tests. | 142 // tests. |
| 142 testing::TestEventListeners& listeners = | 143 testing::TestEventListeners& listeners = |
| 143 testing::UnitTest::GetInstance()->listeners(); | 144 testing::UnitTest::GetInstance()->listeners(); |
| 144 listeners.Append(new ComponentsUnitTestEventListener()); | 145 listeners.Append(new ComponentsUnitTestEventListener()); |
| 145 | 146 |
| 146 #if defined(OS_CHROMEOS) | 147 #if defined(OS_CHROMEOS) |
| 147 mojo::embedder::Init(); | 148 base::TestIOThread test_io_thread(base::TestIOThread::kAutoStart); |
| 149 mojo::edk::Init(test_io_thread.task_runner()); |
| 148 #endif | 150 #endif |
| 149 | 151 |
| 150 return base::LaunchUnitTests( | 152 return base::LaunchUnitTests( |
| 151 argc, argv, base::Bind(&base::TestSuite::Run, | 153 argc, argv, base::Bind(&base::TestSuite::Run, |
| 152 base::Unretained(&test_suite))); | 154 base::Unretained(&test_suite))); |
| 153 } | 155 } |
| OLD | NEW |