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

Issue 10591005: Add a way for JNI registrars to specify methods to be registered for tests. (Closed)

Created:
8 years, 6 months ago by nilesh
Modified:
8 years, 5 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, jochen+watch-content_chromium.org, erikwright (departed), jam, joi+watch-content_chromium.org, darin-cc_chromium.org, brettw-cc_chromium.org
Visibility:
Public.

Description

Add a way for JNI registrars to specify methods to be registered for tests. The Cl adds a macro which allows jni registrars to add methods to a global list. All the methods in the list are registered before APK tests are run. This is loosely based on how MULTIPROCESS_TEST_MAIN macro works. BUG=125059 TEST=

Patch Set 1 #

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+61 lines, -6 lines) Patch
M base/android/base_jni_registrar.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M base/android/jni_registrar.h View 1 2 chunks +18 lines, -2 lines 0 comments Download
M base/android/jni_registrar.cc View 1 chunk +32 lines, -0 lines 0 comments Download
M content/app/android/content_jni_registrar.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M net/android/net_jni_registrar.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M testing/android/native_test_launcher.cc View 2 chunks +2 lines, -4 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
nilesh
8 years, 6 months ago (2012-06-20 21:06:49 UTC) #1
John Grabowski
Let's talk.
8 years, 6 months ago (2012-06-20 22:26:23 UTC) #2
nilesh
8 years, 6 months ago (2012-06-22 15:23:39 UTC) #3
nilesh
On 2012/06/22 15:23:39, nileshagrawal1 wrote: Another options is to define a pre-processor macro in each ...
8 years, 6 months ago (2012-06-25 16:48:06 UTC) #4
bulach
+joth Joth suggested a few times to use some dynamic registration mechanism that's used by ...
8 years, 6 months ago (2012-06-25 16:51:01 UTC) #5
joth
8 years, 6 months ago (2012-06-25 17:07:38 UTC) #6
There's nothing that magic in what skia does, it's just a pattern: have a
static instance of an object per .cc that in its constructor adds the
functions needed for registration from that .cc into a global linked list
of stuff to initialize.

Downside is it adds another static initializer per file, which is very bad
for startup time. Hence why we avoided doing it.


On 25 June 2012 09:51, <bulach@chromium.org> wrote:

> +joth
>
> Joth suggested a few times to use some dynamic registration mechanism
> that's
> used by Skia (I'm not too familiar with it and didn't find any reference..
> joth?).
>
> if that works, maybe we could use the same mechanism for both tests and
> regular
> code, and avoid that single global array of register functions altogether?
> would
> that work?
>
>
http://codereview.chromium.**org/10591005/<http://codereview.chromium.org/105...
>

Powered by Google App Engine
This is Rietveld 408576698