Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Unified Diff: base/android/jni_generator/testNativeExportsOptionalOption.golden

Issue 920883002: Use combined native/manual JNI registration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Factor out common code in test Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/android/jni_generator/jni_generator_tests.py ('k') | build/config/android/rules.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/jni_generator/testNativeExportsOptionalOption.golden
diff --git a/base/android/jni_generator/testNativeExportsOption.golden b/base/android/jni_generator/testNativeExportsOptionalOption.golden
similarity index 76%
copy from base/android/jni_generator/testNativeExportsOption.golden
copy to base/android/jni_generator/testNativeExportsOptionalOption.golden
index a4953cc3ea4a5b4ac2a48b6f7e51ac3be6718f19..2a3b172dc83f13b948ff835c89bb8d5bbd6a2f5e 100644
--- a/base/android/jni_generator/testNativeExportsOption.golden
+++ b/base/android/jni_generator/testNativeExportsOptionalOption.golden
@@ -198,10 +198,79 @@ static_cast<jstring>(env->CallStaticObjectMethod(SampleForTests_clazz(env),
// Step 3: RegisterNatives.
+static const JNINativeMethod kMethodsMyOtherInnerClass[] = {
+ { "nativeInit",
+"("
+")"
+"I",
+ reinterpret_cast<void*>(Java_org_chromium_example_jni_1generator_SampleForTests_00024MyOtherInnerClass_nativeInit)
+ },
+};
+
+static const JNINativeMethod kMethodsMyInnerClass[] = {
+ { "nativeInit",
+"("
+")"
+"I",
+ reinterpret_cast<void*>(Java_org_chromium_example_jni_1generator_SampleForTests_00024MyInnerClass_nativeInit)
+ },
+};
+
+static const JNINativeMethod kMethodsSampleForTests[] = {
+ { "nativeStaticMethod",
+"("
+"J"
+"I"
+")"
+"I",
+ reinterpret_cast<void*>(Java_org_chromium_example_jni_1generator_SampleForTests_nativeStaticMethod)
+ },
+ { "nativeMethod",
+"("
+"J"
+"I"
+")"
+"I",
+ reinterpret_cast<void*>(Java_org_chromium_example_jni_1generator_SampleForTests_nativeMethod)
+ },
+};
+
static bool RegisterNativesImpl(JNIEnv* env, jclass clazz) {
+ if (base::android::IsManualJniRegistrationDisabled()) return true;
base::subtle::Release_Store(&g_SampleForTests_clazz,
static_cast<base::subtle::AtomicWord>(env->NewWeakGlobalRef(clazz));
+ const int kMethodsMyOtherInnerClassSize =
+ arraysize(kMethodsMyOtherInnerClass);
+
+ if (env->RegisterNatives(MyOtherInnerClass_clazz(env),
+ kMethodsMyOtherInnerClass,
+ kMethodsMyOtherInnerClassSize) < 0) {
+ jni_generator::HandleRegistrationError(
+ env, MyOtherInnerClass_clazz(env), __FILE__);
+ return false;
+ }
+
+ const int kMethodsMyInnerClassSize = arraysize(kMethodsMyInnerClass);
+
+ if (env->RegisterNatives(MyInnerClass_clazz(env),
+ kMethodsMyInnerClass,
+ kMethodsMyInnerClassSize) < 0) {
+ jni_generator::HandleRegistrationError(
+ env, MyInnerClass_clazz(env), __FILE__);
+ return false;
+ }
+
+ const int kMethodsSampleForTestsSize = arraysize(kMethodsSampleForTests);
+
+ if (env->RegisterNatives(SampleForTests_clazz(env),
+ kMethodsSampleForTests,
+ kMethodsSampleForTestsSize) < 0) {
+ jni_generator::HandleRegistrationError(
+ env, SampleForTests_clazz(env), __FILE__);
+ return false;
+ }
+
return true;
}
« no previous file with comments | « base/android/jni_generator/jni_generator_tests.py ('k') | build/config/android/rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698