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" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
23 #include "ui/base/ui_base_paths.h" | 23 #include "ui/base/ui_base_paths.h" |
24 | 24 |
25 #if defined(OS_ANDROID) | 25 #if defined(OS_ANDROID) |
26 #include "base/android/jni_android.h" | 26 #include "base/android/jni_android.h" |
27 #include "content/browser/android/browser_jni_registrar.h" | 27 #include "content/browser/android/browser_jni_registrar.h" |
28 #include "content/common/android/common_jni_registrar.h" | 28 #include "content/common/android/common_jni_registrar.h" |
29 #include "media/base/android/media_jni_registrar.h" | 29 #include "media/base/android/media_jni_registrar.h" |
30 #include "net/android/net_jni_registrar.h" | 30 #include "net/android/net_jni_registrar.h" |
31 #include "ui/android/ui_jni_registrar.h" | 31 #include "ui/android/ui_jni_registrar.h" |
| 32 #include "ui/gfx/android/gfx_jni_registrar.h" |
32 #include "ui/gl/android/gl_jni_registrar.h" | 33 #include "ui/gl/android/gl_jni_registrar.h" |
33 #include "ui/shell_dialogs/android/shell_dialogs_jni_registrar.h" | 34 #include "ui/shell_dialogs/android/shell_dialogs_jni_registrar.h" |
34 #endif | 35 #endif |
35 | 36 |
36 #if !defined(OS_IOS) | 37 #if !defined(OS_IOS) |
37 #include "media/base/media.h" | 38 #include "media/base/media.h" |
38 #endif | 39 #endif |
39 | 40 |
40 namespace content { | 41 namespace content { |
41 | 42 |
(...skipping 14 matching lines...) Expand all Loading... |
56 } | 57 } |
57 | 58 |
58 void ContentTestSuiteBase::Initialize() { | 59 void ContentTestSuiteBase::Initialize() { |
59 base::TestSuite::Initialize(); | 60 base::TestSuite::Initialize(); |
60 | 61 |
61 #if defined(OS_ANDROID) | 62 #if defined(OS_ANDROID) |
62 // Register JNI bindings for android. | 63 // Register JNI bindings for android. |
63 JNIEnv* env = base::android::AttachCurrentThread(); | 64 JNIEnv* env = base::android::AttachCurrentThread(); |
64 content::android::RegisterCommonJni(env); | 65 content::android::RegisterCommonJni(env); |
65 content::android::RegisterBrowserJni(env); | 66 content::android::RegisterBrowserJni(env); |
| 67 gfx::android::RegisterJni(env); |
66 media::RegisterJni(env); | 68 media::RegisterJni(env); |
67 net::android::RegisterJni(env); | 69 net::android::RegisterJni(env); |
68 ui::android::RegisterJni(env); | 70 ui::android::RegisterJni(env); |
69 ui::shell_dialogs::RegisterJni(env); | 71 ui::shell_dialogs::RegisterJni(env); |
70 #endif | 72 #endif |
71 | 73 |
72 #if !defined(OS_IOS) | 74 #if !defined(OS_IOS) |
73 UtilityProcessHost::RegisterUtilityMainThreadFactory( | 75 UtilityProcessHost::RegisterUtilityMainThreadFactory( |
74 CreateInProcessUtilityThread); | 76 CreateInProcessUtilityThread); |
75 RenderProcessHost::RegisterRendererMainThreadFactory( | 77 RenderProcessHost::RegisterRendererMainThreadFactory( |
76 CreateInProcessRendererThread); | 78 CreateInProcessRendererThread); |
77 GpuProcessHost::RegisterGpuMainThreadFactory(CreateInProcessGpuThread); | 79 GpuProcessHost::RegisterGpuMainThreadFactory(CreateInProcessGpuThread); |
78 if (external_libraries_enabled_) | 80 if (external_libraries_enabled_) |
79 media::InitializeMediaLibraryForTesting(); | 81 media::InitializeMediaLibraryForTesting(); |
80 #endif | 82 #endif |
81 | 83 |
82 scoped_ptr<ContentClient> client_for_init(CreateClientForInitialization()); | 84 scoped_ptr<ContentClient> client_for_init(CreateClientForInitialization()); |
83 SetContentClient(client_for_init.get()); | 85 SetContentClient(client_for_init.get()); |
84 RegisterContentSchemes(false); | 86 RegisterContentSchemes(false); |
85 SetContentClient(NULL); | 87 SetContentClient(NULL); |
86 | 88 |
87 RegisterPathProvider(); | 89 RegisterPathProvider(); |
88 ui::RegisterPathProvider(); | 90 ui::RegisterPathProvider(); |
89 | 91 |
90 testing::UnitTest::GetInstance()->listeners().Append( | 92 testing::UnitTest::GetInstance()->listeners().Append( |
91 new ContentTestSuiteBaseListener); | 93 new ContentTestSuiteBaseListener); |
92 } | 94 } |
93 | 95 |
94 } // namespace content | 96 } // namespace content |
OLD | NEW |