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

Unified Diff: base/android/jni_generator/jni_generator_tests.py

Issue 10968009: Android: generates JNI bindings for constructors in system classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: jam comment Created 8 years, 3 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.py ('k') | content/common/android/surface_texture_bridge.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/jni_generator/jni_generator_tests.py
diff --git a/base/android/jni_generator/jni_generator_tests.py b/base/android/jni_generator/jni_generator_tests.py
index 2d1188f7cc00db0d5d1febae687e754bcdb8c072..d83385106032a5eebceeed93f3ab18c2b8a37cc0 100755
--- a/base/android/jni_generator/jni_generator_tests.py
+++ b/base/android/jni_generator/jni_generator_tests.py
@@ -1175,7 +1175,7 @@ public abstract class java.io.InputStream extends java.lang.Object
}
"""
jni_from_javap = jni_generator.JNIFromJavaP(contents.split('\n'), None)
- self.assertEquals(9, len(jni_from_javap.called_by_natives))
+ self.assertEquals(10, len(jni_from_javap.called_by_natives))
golden_content = """\
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -1338,6 +1338,18 @@ static jlong Java_InputStream_skip(JNIEnv* env, jobject obj, jlong p0) {
return ret;
}
+static jmethodID g_InputStream_Constructor = 0;
+static ScopedJavaLocalRef<jobject> Java_InputStream_Constructor(JNIEnv* env) {
+ /* Must call RegisterNativesImpl() */
+ DCHECK(g_InputStream_clazz);
+ DCHECK(g_InputStream_Constructor);
+ jobject ret =
+ env->NewObject(g_InputStream_clazz,
+ g_InputStream_Constructor);
+ base::android::CheckException(env);
+ return ScopedJavaLocalRef<jobject>(env, ret);
+}
+
// Step 3: GetMethodIDs and RegisterNatives.
static void GetMethodIDsImpl(JNIEnv* env) {
g_InputStream_clazz = reinterpret_cast<jclass>(env->NewGlobalRef(
@@ -1429,6 +1441,15 @@ static void GetMethodIDsImpl(JNIEnv* env) {
")"
"J");
+ g_InputStream_Constructor =
+ base::android::GetMethodID(
+ env, g_InputStream_clazz,
+ "<init>",
+
+"("
+")"
+"V");
+
}
static bool RegisterNativesImpl(JNIEnv* env) {
« no previous file with comments | « base/android/jni_generator/jni_generator.py ('k') | content/common/android/surface_texture_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698