| 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/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/test/test_suite.h" | 10 #include "base/test/test_suite.h" |
| 11 #include "base/threading/sequenced_worker_pool.h" | 11 #include "base/threading/sequenced_worker_pool.h" |
| 12 #include "content/browser/browser_thread_impl.h" | 12 #include "content/browser/browser_thread_impl.h" |
| 13 #include "content/browser/gpu/gpu_process_host.h" | 13 #include "content/browser/gpu/gpu_process_host.h" |
| 14 #include "content/common/url_schemes.h" | 14 #include "content/common/url_schemes.h" |
| 15 #include "content/gpu/gpu_main_thread.h" | 15 #include "content/gpu/gpu_main_thread.h" |
| 16 #include "content/public/browser/render_process_host.h" | 16 #include "content/public/browser/render_process_host.h" |
| 17 #include "content/public/browser/utility_process_host.h" | 17 #include "content/public/browser/utility_process_host.h" |
| 18 #include "content/public/common/content_client.h" | 18 #include "content/public/common/content_client.h" |
| 19 #include "content/public/common/content_paths.h" | 19 #include "content/public/common/content_paths.h" |
| 20 #include "content/renderer/renderer_main_thread.h" | 20 #include "content/renderer/renderer_main_thread.h" |
| 21 #include "content/utility/utility_main_thread.h" | 21 #include "content/utility/utility_main_thread.h" |
| 22 #include "media/base/media.h" | |
| 23 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 24 #include "ui/base/ui_base_paths.h" | 23 #include "ui/base/ui_base_paths.h" |
| 25 | 24 |
| 26 #if defined(OS_ANDROID) | 25 #if defined(OS_ANDROID) |
| 27 #include "base/android/jni_android.h" | 26 #include "base/android/jni_android.h" |
| 28 #include "content/browser/android/browser_jni_registrar.h" | 27 #include "content/browser/android/browser_jni_registrar.h" |
| 29 #include "content/common/android/common_jni_registrar.h" | 28 #include "content/common/android/common_jni_registrar.h" |
| 30 #include "media/base/android/media_jni_registrar.h" | 29 #include "media/base/android/media_jni_registrar.h" |
| 31 #include "net/android/net_jni_registrar.h" | 30 #include "net/android/net_jni_registrar.h" |
| 32 #include "ui/android/ui_jni_registrar.h" | 31 #include "ui/android/ui_jni_registrar.h" |
| 33 #include "ui/gl/android/gl_jni_registrar.h" | 32 #include "ui/gl/android/gl_jni_registrar.h" |
| 34 #include "ui/shell_dialogs/android/shell_dialogs_jni_registrar.h" | 33 #include "ui/shell_dialogs/android/shell_dialogs_jni_registrar.h" |
| 35 #endif | 34 #endif |
| 36 | 35 |
| 36 #if !defined(OS_IOS) |
| 37 #include "media/base/media.h" |
| 38 #endif |
| 39 |
| 37 namespace content { | 40 namespace content { |
| 38 | 41 |
| 39 class ContentTestSuiteBaseListener : public testing::EmptyTestEventListener { | 42 class ContentTestSuiteBaseListener : public testing::EmptyTestEventListener { |
| 40 public: | 43 public: |
| 41 ContentTestSuiteBaseListener() { | 44 ContentTestSuiteBaseListener() { |
| 42 } | 45 } |
| 43 virtual void OnTestEnd(const testing::TestInfo& test_info) OVERRIDE { | 46 virtual void OnTestEnd(const testing::TestInfo& test_info) OVERRIDE { |
| 44 BrowserThreadImpl::FlushThreadPoolHelper(); | 47 BrowserThreadImpl::FlushThreadPoolHelper(); |
| 45 } | 48 } |
| 46 private: | 49 private: |
| (...skipping 17 matching lines...) Expand all Loading... |
| 64 net::android::RegisterJni(env); | 67 net::android::RegisterJni(env); |
| 65 ui::android::RegisterJni(env); | 68 ui::android::RegisterJni(env); |
| 66 ui::shell_dialogs::RegisterJni(env); | 69 ui::shell_dialogs::RegisterJni(env); |
| 67 #endif | 70 #endif |
| 68 | 71 |
| 69 #if !defined(OS_IOS) | 72 #if !defined(OS_IOS) |
| 70 UtilityProcessHost::RegisterUtilityMainThreadFactory(CreateUtilityMainThread); | 73 UtilityProcessHost::RegisterUtilityMainThreadFactory(CreateUtilityMainThread); |
| 71 RenderProcessHost::RegisterRendererMainThreadFactory( | 74 RenderProcessHost::RegisterRendererMainThreadFactory( |
| 72 CreateRendererMainThread); | 75 CreateRendererMainThread); |
| 73 GpuProcessHost::RegisterGpuMainThreadFactory(CreateGpuMainThread); | 76 GpuProcessHost::RegisterGpuMainThreadFactory(CreateGpuMainThread); |
| 74 #endif | |
| 75 | |
| 76 if (external_libraries_enabled_) | 77 if (external_libraries_enabled_) |
| 77 media::InitializeMediaLibraryForTesting(); | 78 media::InitializeMediaLibraryForTesting(); |
| 79 #endif |
| 78 | 80 |
| 79 scoped_ptr<ContentClient> client_for_init(CreateClientForInitialization()); | 81 scoped_ptr<ContentClient> client_for_init(CreateClientForInitialization()); |
| 80 SetContentClient(client_for_init.get()); | 82 SetContentClient(client_for_init.get()); |
| 81 RegisterContentSchemes(false); | 83 RegisterContentSchemes(false); |
| 82 SetContentClient(NULL); | 84 SetContentClient(NULL); |
| 83 | 85 |
| 84 RegisterPathProvider(); | 86 RegisterPathProvider(); |
| 85 ui::RegisterPathProvider(); | 87 ui::RegisterPathProvider(); |
| 86 | 88 |
| 87 testing::UnitTest::GetInstance()->listeners().Append( | 89 testing::UnitTest::GetInstance()->listeners().Append( |
| 88 new ContentTestSuiteBaseListener); | 90 new ContentTestSuiteBaseListener); |
| 89 } | 91 } |
| 90 | 92 |
| 91 } // namespace content | 93 } // namespace content |
| OLD | NEW |