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 "content/common/url_schemes.h" | 11 #include "content/common/url_schemes.h" |
12 #include "content/public/common/content_client.h" | 12 #include "content/public/common/content_client.h" |
13 #include "content/public/common/content_paths.h" | 13 #include "content/public/common/content_paths.h" |
14 #include "media/base/media.h" | 14 #include "media/base/media.h" |
15 #include "ui/base/ui_base_paths.h" | 15 #include "ui/base/ui_base_paths.h" |
16 #include "ui/compositor/compositor_setup.h" | 16 #include "ui/compositor/compositor_setup.h" |
17 | 17 |
18 #if defined(OS_ANDROID) | |
19 #include "base/android/jni_android.h" | |
20 #include "content/browser/android/browser_jni_registrar.h" | |
21 #include "content/common/android/common_jni_registrar.h" | |
22 #include "net/android/net_jni_registrar.h" | |
23 #include "ui/android/ui_jni_registrar.h" | |
24 #endif | |
25 | |
26 namespace content { | 18 namespace content { |
27 | 19 |
28 ContentTestSuiteBase::ContentTestSuiteBase(int argc, char** argv) | 20 ContentTestSuiteBase::ContentTestSuiteBase(int argc, char** argv) |
29 : base::TestSuite(argc, argv), | 21 : base::TestSuite(argc, argv), |
30 external_libraries_enabled_(true) { | 22 external_libraries_enabled_(true) { |
31 } | 23 } |
32 | 24 |
33 void ContentTestSuiteBase::Initialize() { | 25 void ContentTestSuiteBase::Initialize() { |
34 base::TestSuite::Initialize(); | 26 base::TestSuite::Initialize(); |
35 | 27 |
36 #if defined(OS_ANDROID) | |
37 // Register JNI bindings for android. | |
38 JNIEnv* env = base::android::AttachCurrentThread(); | |
39 content::android::RegisterCommonJni(env); | |
40 content::android::RegisterBrowserJni(env); | |
41 net::android::RegisterJni(env); | |
42 ui::android::RegisterJni(env); | |
43 #endif | |
44 | |
45 if (external_libraries_enabled_) | 28 if (external_libraries_enabled_) |
46 media::InitializeMediaLibraryForTesting(); | 29 media::InitializeMediaLibraryForTesting(); |
47 | 30 |
48 scoped_ptr<ContentClient> client_for_init(CreateClientForInitialization()); | 31 scoped_ptr<ContentClient> client_for_init(CreateClientForInitialization()); |
49 SetContentClient(client_for_init.get()); | 32 SetContentClient(client_for_init.get()); |
50 RegisterContentSchemes(false); | 33 RegisterContentSchemes(false); |
51 SetContentClient(NULL); | 34 SetContentClient(NULL); |
52 | 35 |
53 RegisterPathProvider(); | 36 RegisterPathProvider(); |
54 ui::RegisterPathProvider(); | 37 ui::RegisterPathProvider(); |
55 | 38 |
56 // Mock out the compositor on platforms that use it. | 39 // Mock out the compositor on platforms that use it. |
57 ui::SetupTestCompositor(); | 40 ui::SetupTestCompositor(); |
58 } | 41 } |
59 | 42 |
60 } // namespace content | 43 } // namespace content |
OLD | NEW |