| 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 "content/public/test/content_test_suite_base.h" | 5 #include "content/public/test/content_test_suite_base.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/metrics/statistics_recorder.h" | 10 #include "base/metrics/statistics_recorder.h" |
| 11 #include "base/test/test_suite.h" | 11 #include "base/test/test_suite.h" |
| 12 #include "base/threading/sequenced_worker_pool.h" | 12 #include "base/threading/sequenced_worker_pool.h" |
| 13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 14 #include "content/browser/browser_thread_impl.h" | 14 #include "content/browser/browser_thread_impl.h" |
| 15 #include "content/browser/gpu/gpu_process_host.h" | 15 #include "content/browser/gpu/gpu_process_host.h" |
| 16 #include "content/browser/renderer_host/render_process_host_impl.h" | 16 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 17 #include "content/browser/utility_process_host_impl.h" | 17 #include "content/browser/utility_process_host_impl.h" |
| 18 #include "content/common/url_schemes.h" | 18 #include "content/common/url_schemes.h" |
| 19 #include "content/gpu/in_process_gpu_thread.h" | 19 #include "content/gpu/in_process_gpu_thread.h" |
| 20 #include "content/public/common/content_client.h" | 20 #include "content/public/common/content_client.h" |
| 21 #include "content/renderer/in_process_renderer_thread.h" | 21 #include "content/renderer/in_process_renderer_thread.h" |
| 22 #include "content/utility/in_process_utility_thread.h" | 22 #include "content/utility/in_process_utility_thread.h" |
| 23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
| 24 #include "ui/base/material_design/material_design_controller.h" | |
| 25 #include "ui/base/ui_base_paths.h" | 24 #include "ui/base/ui_base_paths.h" |
| 26 | 25 |
| 27 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) | 26 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) |
| 28 #include "gin/v8_initializer.h" | 27 #include "gin/v8_initializer.h" |
| 29 #endif | 28 #endif |
| 30 | 29 |
| 31 #if defined(OS_ANDROID) | 30 #if defined(OS_ANDROID) |
| 32 #include "base/android/jni_android.h" | 31 #include "base/android/jni_android.h" |
| 33 #include "content/browser/android/browser_jni_registrar.h" | 32 #include "content/browser/android/browser_jni_registrar.h" |
| 34 #include "content/common/android/common_jni_registrar.h" | 33 #include "content/common/android/common_jni_registrar.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 content::Compositor::Initialize(); | 99 content::Compositor::Initialize(); |
| 101 #endif | 100 #endif |
| 102 #endif | 101 #endif |
| 103 | 102 |
| 104 #if defined(USE_OZONE) | 103 #if defined(USE_OZONE) |
| 105 ui::OzonePlatform::InitializeForUI(); | 104 ui::OzonePlatform::InitializeForUI(); |
| 106 #endif | 105 #endif |
| 107 | 106 |
| 108 testing::UnitTest::GetInstance()->listeners().Append( | 107 testing::UnitTest::GetInstance()->listeners().Append( |
| 109 new ContentTestSuiteBaseListener); | 108 new ContentTestSuiteBaseListener); |
| 110 ui::MaterialDesignController::Initialize(); | |
| 111 } | 109 } |
| 112 | 110 |
| 113 void ContentTestSuiteBase::RegisterContentSchemes( | 111 void ContentTestSuiteBase::RegisterContentSchemes( |
| 114 ContentClient* content_client) { | 112 ContentClient* content_client) { |
| 115 SetContentClient(content_client); | 113 SetContentClient(content_client); |
| 116 content::RegisterContentSchemes(false); | 114 content::RegisterContentSchemes(false); |
| 117 SetContentClient(NULL); | 115 SetContentClient(NULL); |
| 118 } | 116 } |
| 119 | 117 |
| 120 void ContentTestSuiteBase::RegisterInProcessThreads() { | 118 void ContentTestSuiteBase::RegisterInProcessThreads() { |
| 121 UtilityProcessHostImpl::RegisterUtilityMainThreadFactory( | 119 UtilityProcessHostImpl::RegisterUtilityMainThreadFactory( |
| 122 CreateInProcessUtilityThread); | 120 CreateInProcessUtilityThread); |
| 123 RenderProcessHostImpl::RegisterRendererMainThreadFactory( | 121 RenderProcessHostImpl::RegisterRendererMainThreadFactory( |
| 124 CreateInProcessRendererThread); | 122 CreateInProcessRendererThread); |
| 125 GpuProcessHost::RegisterGpuMainThreadFactory(CreateInProcessGpuThread); | 123 GpuProcessHost::RegisterGpuMainThreadFactory(CreateInProcessGpuThread); |
| 126 } | 124 } |
| 127 | 125 |
| 128 } // namespace content | 126 } // namespace content |
| OLD | NEW |