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

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

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
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 7e39cda3d369f2f8b02a86e08e4747ea7662ac70..e29bc0cc46d48b8dc82d16f17451514d52db2355 100755
--- a/base/android/jni_generator/jni_generator_tests.py
+++ b/base/android/jni_generator/jni_generator_tests.py
@@ -43,6 +43,7 @@ class TestOptions(object):
self.cpp = 'cpp'
self.javap = 'javap'
self.native_exports = False
+ self.native_exports_optional = False
class TestGenerator(unittest.TestCase):
def assertObjEquals(self, first, second):
@@ -1019,7 +1020,7 @@ class Foo {
test_data, 'org/chromium/example/jni_generator/Test', options)
self.assertGoldenTextEquals(jni_from_java.GetContent())
- def testNativeExportsOption(self):
+ def runNativeExportsOption(self, optional):
test_data = """
package org.chromium.example.jni_generator;
@@ -1054,9 +1055,18 @@ class Foo {
options = TestOptions()
options.jni_init_native_name = 'nativeInitNativeClass'
options.native_exports = True
+ options.native_exports_optional = optional
jni_from_java = jni_generator.JNIFromJavaSource(
test_data, 'org/chromium/example/jni_generator/SampleForTests', options)
- self.assertGoldenTextEquals(jni_from_java.GetContent())
+ return jni_from_java.GetContent()
+
+ def testNativeExportsOption(self):
+ content = self.runNativeExportsOption(False)
+ self.assertGoldenTextEquals(content)
+
+ def testNativeExportsOptionalOption(self):
+ content = self.runNativeExportsOption(True)
+ self.assertGoldenTextEquals(content)
def testOuterInnerRaises(self):
test_data = """
« no previous file with comments | « base/android/jni_generator/jni_generator.py ('k') | base/android/jni_generator/testNativeExportsOptionalOption.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698