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:
parent
a814941e14
commit
613152af11
@ -482,10 +482,10 @@ if (rtc_include_tests) {
|
||||
"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 @@ if (rtc_include_tests) {
|
||||
|
||||
shared_libraries = [ ":libjingle_peerconnection_so" ]
|
||||
}
|
||||
|
||||
android_resources("libjingle_peerconnection_android_unittest_resources") {
|
||||
resource_dirs = [ "androidtests/res" ]
|
||||
custom_package = "org.webrtc"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 |
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="app_name">AndroidPeerConnectionTests</string>
|
||||
|
||||
</resources>
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user