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}
This commit is contained in:
phoglund
2016-11-16 01:31:20 -08:00
committed by Commit bot
parent a814941e14
commit 613152af11
8 changed files with 33 additions and 14 deletions

View File

@ -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>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">AndroidPeerConnectionTests</string>
</resources>

View File

@ -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);
}
}