Add a JNI boot test to catch ARM dynamic linker regressions.

The peer connection loopback test could catch regressions too, but it's
too slow to run on downstream ARM emulators. I'm adding a test here
that just makes sure we can load the JNI and init audio/video engines
in WebRTC.

This test overlaps in functionality with the existing tests,
but we need it anyway since all existing tests are too timing-sensitive.

Removes resources from the test; they're awkward downstream and we
don't really need them anyway.

BUG=b/32820229

Review-Url: https://codereview.webrtc.org/2506603002
Cr-Commit-Position: refs/heads/master@{#15101}
diff --git a/webrtc/api/BUILD.gn b/webrtc/api/BUILD.gn
index cf3073d..1b10e2d 100644
--- a/webrtc/api/BUILD.gn
+++ b/webrtc/api/BUILD.gn
@@ -482,10 +482,10 @@
         "androidtests/src/org/webrtc/RendererCommonTest.java",
         "androidtests/src/org/webrtc/SurfaceTextureHelperTest.java",
         "androidtests/src/org/webrtc/SurfaceViewRendererOnMeasureTest.java",
+        "androidtests/src/org/webrtc/WebRtcJniBootTest.java",
       ]
 
       deps = [
-        ":libjingle_peerconnection_android_unittest_resources",
         ":libjingle_peerconnection_java",
         "../base:base_java",
         "//base:base_java",
@@ -493,10 +493,5 @@
 
       shared_libraries = [ ":libjingle_peerconnection_so" ]
     }
-
-    android_resources("libjingle_peerconnection_android_unittest_resources") {
-      resource_dirs = [ "androidtests/res" ]
-      custom_package = "org.webrtc"
-    }
   }
 }
diff --git a/webrtc/api/androidtests/AndroidManifest.xml b/webrtc/api/androidtests/AndroidManifest.xml
index 0b3b0b12..90f0aec 100644
--- a/webrtc/api/androidtests/AndroidManifest.xml
+++ b/webrtc/api/androidtests/AndroidManifest.xml
@@ -22,8 +22,7 @@
         android:targetPackage="org.webrtc.test" />
 
     <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
+        android:label="AndroidPeerconnectionTests" >
         <uses-library android:name="android.test.runner" />
     </application>
 
diff --git a/webrtc/api/androidtests/res/drawable-hdpi/ic_launcher.png b/webrtc/api/androidtests/res/drawable-hdpi/ic_launcher.png
deleted file mode 100644
index 96a442e..0000000
--- a/webrtc/api/androidtests/res/drawable-hdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/webrtc/api/androidtests/res/drawable-ldpi/ic_launcher.png b/webrtc/api/androidtests/res/drawable-ldpi/ic_launcher.png
deleted file mode 100644
index 9923872..0000000
--- a/webrtc/api/androidtests/res/drawable-ldpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/webrtc/api/androidtests/res/drawable-mdpi/ic_launcher.png b/webrtc/api/androidtests/res/drawable-mdpi/ic_launcher.png
deleted file mode 100644
index 359047d..0000000
--- a/webrtc/api/androidtests/res/drawable-mdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/webrtc/api/androidtests/res/drawable-xhdpi/ic_launcher.png b/webrtc/api/androidtests/res/drawable-xhdpi/ic_launcher.png
deleted file mode 100644
index 71c6d76..0000000
--- a/webrtc/api/androidtests/res/drawable-xhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/webrtc/api/androidtests/res/values/strings.xml b/webrtc/api/androidtests/res/values/strings.xml
deleted file mode 100644
index dfe63f8..0000000
--- a/webrtc/api/androidtests/res/values/strings.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
-    <string name="app_name">AndroidPeerConnectionTests</string>
-
-</resources>
diff --git a/webrtc/api/androidtests/src/org/webrtc/WebRtcJniBootTest.java b/webrtc/api/androidtests/src/org/webrtc/WebRtcJniBootTest.java
new file mode 100644
index 0000000..2f04f15
--- /dev/null
+++ b/webrtc/api/androidtests/src/org/webrtc/WebRtcJniBootTest.java
@@ -0,0 +1,31 @@
+/*
+ *  Copyright 2016 The WebRTC Project Authors. All rights reserved.
+ *
+ *  Use of this source code is governed by a BSD-style license
+ *  that can be found in the LICENSE file in the root of the source
+ *  tree. An additional intellectual property rights grant can be found
+ *  in the file PATENTS.  All contributing project authors may
+ *  be found in the AUTHORS file in the root of the source tree.
+ */
+
+package org.appspot.apprtc.test;
+
+import android.test.InstrumentationTestCase;
+import android.test.suitebuilder.annotation.SmallTest;
+
+import org.webrtc.PeerConnectionFactory;
+
+// This test is intended to run on ARM and catch LoadLibrary errors when we load the WebRTC
+// JNI. It can't really be setting up calls since ARM emulators are too slow, but instantiating
+// a peer connection isn't timing-sensitive, so we can at least do that.
+public class WebRtcJniBootTest extends InstrumentationTestCase {
+  @SmallTest
+  public void testJniLoadsWithoutError() throws InterruptedException {
+    PeerConnectionFactory.initializeAndroidGlobals(getInstrumentation().getTargetContext(),
+        true /* initializeAudio */, true /* initializeVideo */,
+        false /* videoCodecHwAcceleration */);
+
+    PeerConnectionFactory.Options options = new PeerConnectionFactory.Options();
+    new PeerConnectionFactory(options);
+  }
+}