| 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 |
| 18 namespace content { | 26 namespace content { |
| 19 | 27 |
| 20 ContentTestSuiteBase::ContentTestSuiteBase(int argc, char** argv) | 28 ContentTestSuiteBase::ContentTestSuiteBase(int argc, char** argv) |
| 21 : base::TestSuite(argc, argv), | 29 : base::TestSuite(argc, argv), |
| 22 external_libraries_enabled_(true) { | 30 external_libraries_enabled_(true) { |
| 23 } | 31 } |
| 24 | 32 |
| 25 void ContentTestSuiteBase::Initialize() { | 33 void ContentTestSuiteBase::Initialize() { |
| 26 base::TestSuite::Initialize(); | 34 base::TestSuite::Initialize(); |
| 27 | 35 |
| 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 |
| 28 if (external_libraries_enabled_) | 45 if (external_libraries_enabled_) |
| 29 media::InitializeMediaLibraryForTesting(); | 46 media::InitializeMediaLibraryForTesting(); |
| 30 | 47 |
| 31 scoped_ptr<ContentClient> client_for_init(CreateClientForInitialization()); | 48 scoped_ptr<ContentClient> client_for_init(CreateClientForInitialization()); |
| 32 SetContentClient(client_for_init.get()); | 49 SetContentClient(client_for_init.get()); |
| 33 RegisterContentSchemes(false); | 50 RegisterContentSchemes(false); |
| 34 SetContentClient(NULL); | 51 SetContentClient(NULL); |
| 35 | 52 |
| 36 RegisterPathProvider(); | 53 RegisterPathProvider(); |
| 37 ui::RegisterPathProvider(); | 54 ui::RegisterPathProvider(); |
| 38 | 55 |
| 39 // Mock out the compositor on platforms that use it. | 56 // Mock out the compositor on platforms that use it. |
| 40 ui::SetupTestCompositor(); | 57 ui::SetupTestCompositor(); |
| 41 } | 58 } |
| 42 | 59 |
| 43 } // namespace content | 60 } // namespace content |
| OLD | NEW |