Index: base/android/jni_registrar.h |
diff --git a/base/android/jni_registrar.h b/base/android/jni_registrar.h |
index ba8f074704609e051c0df5521ee8f36dd37b2bc1..e36df3a281937b2496ef9fea84c454edea3e296d 100644 |
--- a/base/android/jni_registrar.h |
+++ b/base/android/jni_registrar.h |
@@ -6,13 +6,12 @@ |
#define BASE_ANDROID_JNI_REGISTRAR_H_ |
#include <jni.h> |
+#include "base/android/jni_android.h" |
#include "base/basictypes.h" |
namespace base { |
namespace android { |
-struct RegistrationMethod; |
- |
// Registers the JNI bindings for the specified |method| definition containing |
// |count| elements. Returns whether the registration of the given methods |
// succeeded. |
@@ -20,6 +19,23 @@ bool RegisterNativeMethods(JNIEnv* env, |
const RegistrationMethod* method, |
size_t count); |
+bool RegisterAllNativeMethodsForTest(JNIEnv* env); |
+ |
+// Helper class to append RegistrationMethods to a global list. |
+// Used by the ADD_JNI_REGISTRATION_METHODS_FOR_TESTS macro. |
+class AppendRegistrationMethods { |
+ public: |
+ AppendRegistrationMethods(const RegistrationMethod* methods, size_t count); |
+}; |
+ |
+// This macro creates a AppendMultiProcessTest object whose constructor |
+// does the work of adding to the global registration list. |
+#define ADD_JNI_REGISTRATION_METHODS_FOR_TESTS(methods) \ |
+ namespace { \ |
+ base::android::AppendRegistrationMethods \ |
+ registration_methods(methods, arraysize(methods)); \ |
+ } |
+ |
} // namespace android |
} // namespace base |