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 ab566168c1e2e8dd14dd408e19605e794b9e9ea1..6b7c0103a1fbe1f2e8e3dc4640c9ba9a6c04b92e 100755 |
--- a/base/android/jni_generator/jni_generator_tests.py |
+++ b/base/android/jni_generator/jni_generator_tests.py |
@@ -148,6 +148,8 @@ class TestGenerator(unittest.TestCase): |
int nativeDataFetcherImplAndroid, |
double alpha, double beta, double gamma); |
""" |
+ jni_generator.JniParams.SetFullyQualifiedClass( |
+ 'org/chromium/example/jni_generator/SampleForTests') |
qsr
2014/05/23 08:11:38
This is necessary because this test was wrong -> t
|
jni_generator.JniParams.ExtractImportsAndInnerClasses(test_data) |
natives = jni_generator.ExtractNatives(test_data, 'int') |
golden_natives = [ |
@@ -1033,7 +1035,7 @@ class Foo { |
# Ensure it's fine with the import. |
generate('import java.lang.Runnable;') |
- def testJNIAdditionalImport(self): |
+ def testSingleJNIAdditionalImport(self): |
test_data = """ |
package org.chromium.foo; |
@@ -1052,6 +1054,27 @@ class Foo { |
TestOptions()) |
self.assertGoldenTextEquals(jni_from_java.GetContent()) |
+ def testMultipleJNIAdditionalImport(self): |
+ test_data = """ |
+ package org.chromium.foo; |
+ |
+ @JNIAdditionalImport({Bar1.class, Bar2.class}) |
+ class Foo { |
+ |
+ @CalledByNative |
+ private static void calledByNative(Bar1.Callback callback1, |
+ Bar2.Callback callback2) { |
+ } |
+ |
+ private static native void nativeDoSomething(Bar1.Callback callback1, |
+ Bar2.Callback callback2); |
+ } |
+ """ |
+ jni_from_java = jni_generator.JNIFromJavaSource(test_data, |
+ 'org/chromium/foo/Foo', |
+ TestOptions()) |
+ self.assertGoldenTextEquals(jni_from_java.GetContent()) |
+ |
if __name__ == '__main__': |
unittest.main() |