| 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/metrics/statistics_recorder.h" | 10 #include "base/metrics/statistics_recorder.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "content/browser/android/browser_jni_registrar.h" | 30 #include "content/browser/android/browser_jni_registrar.h" |
| 31 #include "content/common/android/common_jni_registrar.h" | 31 #include "content/common/android/common_jni_registrar.h" |
| 32 #include "media/base/android/media_jni_registrar.h" | 32 #include "media/base/android/media_jni_registrar.h" |
| 33 #include "net/android/net_jni_registrar.h" | 33 #include "net/android/net_jni_registrar.h" |
| 34 #include "ui/base/android/ui_base_jni_registrar.h" | 34 #include "ui/base/android/ui_base_jni_registrar.h" |
| 35 #include "ui/gfx/android/gfx_jni_registrar.h" | 35 #include "ui/gfx/android/gfx_jni_registrar.h" |
| 36 #include "ui/gl/android/gl_jni_registrar.h" | 36 #include "ui/gl/android/gl_jni_registrar.h" |
| 37 #include "ui/shell_dialogs/android/shell_dialogs_jni_registrar.h" | 37 #include "ui/shell_dialogs/android/shell_dialogs_jni_registrar.h" |
| 38 #endif | 38 #endif |
| 39 | 39 |
| 40 #if defined(USE_OZONE) |
| 41 #include "ui/ozone/public/ozone_platform.h" |
| 42 #endif |
| 43 |
| 40 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 44 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 41 #include "gin/public/isolate_holder.h" | 45 #include "gin/public/isolate_holder.h" |
| 42 #endif | 46 #endif |
| 43 | 47 |
| 44 namespace content { | 48 namespace content { |
| 45 | 49 |
| 46 class ContentTestSuiteBaseListener : public testing::EmptyTestEventListener { | 50 class ContentTestSuiteBaseListener : public testing::EmptyTestEventListener { |
| 47 public: | 51 public: |
| 48 ContentTestSuiteBaseListener() { | 52 ContentTestSuiteBaseListener() { |
| 49 } | 53 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 72 | 76 |
| 73 #if defined(OS_ANDROID) | 77 #if defined(OS_ANDROID) |
| 74 // Register JNI bindings for android. | 78 // Register JNI bindings for android. |
| 75 JNIEnv* env = base::android::AttachCurrentThread(); | 79 JNIEnv* env = base::android::AttachCurrentThread(); |
| 76 content::android::RegisterCommonJni(env); | 80 content::android::RegisterCommonJni(env); |
| 77 content::android::RegisterBrowserJni(env); | 81 content::android::RegisterBrowserJni(env); |
| 78 gfx::android::RegisterJni(env); | 82 gfx::android::RegisterJni(env); |
| 79 media::RegisterJni(env); | 83 media::RegisterJni(env); |
| 80 net::android::RegisterJni(env); | 84 net::android::RegisterJni(env); |
| 81 ui::android::RegisterJni(env); | 85 ui::android::RegisterJni(env); |
| 86 ui::gl::android::RegisterJni(env); |
| 82 ui::shell_dialogs::RegisterJni(env); | 87 ui::shell_dialogs::RegisterJni(env); |
| 83 #endif | 88 #endif |
| 84 | 89 |
| 90 #if defined(USE_OZONE) |
| 91 ui::OzonePlatform::InitializeForUI(); |
| 92 #endif |
| 93 |
| 85 testing::UnitTest::GetInstance()->listeners().Append( | 94 testing::UnitTest::GetInstance()->listeners().Append( |
| 86 new ContentTestSuiteBaseListener); | 95 new ContentTestSuiteBaseListener); |
| 87 } | 96 } |
| 88 | 97 |
| 89 void ContentTestSuiteBase::RegisterContentSchemes( | 98 void ContentTestSuiteBase::RegisterContentSchemes( |
| 90 ContentClient* content_client) { | 99 ContentClient* content_client) { |
| 91 SetContentClient(content_client); | 100 SetContentClient(content_client); |
| 92 content::RegisterContentSchemes(false); | 101 content::RegisterContentSchemes(false); |
| 93 SetContentClient(NULL); | 102 SetContentClient(NULL); |
| 94 } | 103 } |
| 95 | 104 |
| 96 void ContentTestSuiteBase::RegisterInProcessThreads() { | 105 void ContentTestSuiteBase::RegisterInProcessThreads() { |
| 97 #if !defined(OS_IOS) | 106 #if !defined(OS_IOS) |
| 98 UtilityProcessHostImpl::RegisterUtilityMainThreadFactory( | 107 UtilityProcessHostImpl::RegisterUtilityMainThreadFactory( |
| 99 CreateInProcessUtilityThread); | 108 CreateInProcessUtilityThread); |
| 100 RenderProcessHostImpl::RegisterRendererMainThreadFactory( | 109 RenderProcessHostImpl::RegisterRendererMainThreadFactory( |
| 101 CreateInProcessRendererThread); | 110 CreateInProcessRendererThread); |
| 102 GpuProcessHost::RegisterGpuMainThreadFactory(CreateInProcessGpuThread); | 111 GpuProcessHost::RegisterGpuMainThreadFactory(CreateInProcessGpuThread); |
| 103 #endif | 112 #endif |
| 104 } | 113 } |
| 105 | 114 |
| 106 } // namespace content | 115 } // namespace content |
| OLD | NEW |