Android: Add testonly to test generate_jni() targets.

Previously this wasn't supported because there wasn't a separate
native library for test targets, and the non-test native library
wasn't allowed to depend on testonly targets.

TBR=agrieve # Trivial build refactor

Bug: 929661
Change-Id: I86d392758ffdfd4b30a3b94963d30f691731e326
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1841759
Commit-Queue: Eric Stevenson <[email protected]>
Commit-Queue: Andrew Grieve <[email protected]>
Auto-Submit: Eric Stevenson <[email protected]>
Reviewed-by: Andrew Grieve <[email protected]>
Cr-Commit-Position: refs/heads/master@{#703006}
diff --git a/components/gcm_driver/instance_id/android/BUILD.gn b/components/gcm_driver/instance_id/android/BUILD.gn
index 1d9ee84..2f17143 100644
--- a/components/gcm_driver/instance_id/android/BUILD.gn
+++ b/components/gcm_driver/instance_id/android/BUILD.gn
@@ -11,6 +11,7 @@
 }
 
 generate_jni("test_support_jni_headers") {
+  testonly = true
   sources = [
     "javatests/src/org/chromium/components/gcm_driver/instance_id/FakeInstanceIDWithSubtype.java",
   ]