Index: content/public/test/content_test_suite_base.cc |
diff --git a/content/public/test/content_test_suite_base.cc b/content/public/test/content_test_suite_base.cc |
index 0c328589abebf03e91e1c802c3dcb8811130c2ff..7c8c4d33f56a9cb3bfbf114ed0176da96a81019a 100644 |
--- a/content/public/test/content_test_suite_base.cc |
+++ b/content/public/test/content_test_suite_base.cc |
@@ -15,6 +15,14 @@ |
#include "ui/base/ui_base_paths.h" |
#include "ui/compositor/compositor_setup.h" |
+#if defined(OS_ANDROID) |
+#include "base/android/jni_android.h" |
+#include "content/browser/android/browser_jni_registrar.h" |
+#include "content/common/android/common_jni_registrar.h" |
+#include "net/android/net_jni_registrar.h" |
+#include "ui/android/ui_jni_registrar.h" |
+#endif |
+ |
namespace content { |
ContentTestSuiteBase::ContentTestSuiteBase(int argc, char** argv) |
@@ -25,6 +33,15 @@ ContentTestSuiteBase::ContentTestSuiteBase(int argc, char** argv) |
void ContentTestSuiteBase::Initialize() { |
base::TestSuite::Initialize(); |
+#if defined(OS_ANDROID) |
+ // Register JNI bindings for android. |
+ JNIEnv* env = base::android::AttachCurrentThread(); |
+ content::android::RegisterCommonJni(env); |
+ content::android::RegisterBrowserJni(env); |
+ net::android::RegisterJni(env); |
+ ui::android::RegisterJni(env); |
+#endif |
+ |
if (external_libraries_enabled_) |
media::InitializeMediaLibraryForTesting(); |