summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/test/android
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/libwebrtc/test/android')
-rw-r--r--third_party/libwebrtc/test/android/AndroidManifest.xml47
-rw-r--r--third_party/libwebrtc/test/android/org/webrtc/native_test/RTCNativeUnitTest.java26
-rw-r--r--third_party/libwebrtc/test/android/org/webrtc/native_test/RTCNativeUnitTestActivity.java34
3 files changed, 107 insertions, 0 deletions
diff --git a/third_party/libwebrtc/test/android/AndroidManifest.xml b/third_party/libwebrtc/test/android/AndroidManifest.xml
new file mode 100644
index 0000000000..ad3f434b4f
--- /dev/null
+++ b/third_party/libwebrtc/test/android/AndroidManifest.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Copyright 2017 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.
+-->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="org.webrtc.native_test"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="23" />
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
+ <uses-permission android:name="android.permission.BLUETOOTH"/>
+ <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
+ <uses-permission android:name="android.permission.CAMERA" />
+ <uses-permission android:name="android.permission.INTERNET"/>
+ <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
+ <uses-permission android:name="android.permission.RECORD_AUDIO"/>
+ <uses-permission android:name="android.permission.WAKE_LOCK"/>
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+
+ <application android:label="NativeTests"
+ android:name="org.chromium.native_test.NativeTestApplication">
+ <uses-library android:name="android.test.runner"/>
+ <activity android:name=".RTCNativeUnitTestActivity"
+ android:label="NativeTest"
+ android:configChanges="orientation|keyboardHidden"
+ android:process=":test_process">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+
+ <instrumentation android:name="org.chromium.build.gtest_apk.NativeTestInstrumentationTestRunner"
+ android:targetPackage="org.webrtc.native_test"
+ android:label="Instrumentation entry point for org.webrtc.native_test"
+ chromium-junit3="true"/>
+
+</manifest>
diff --git a/third_party/libwebrtc/test/android/org/webrtc/native_test/RTCNativeUnitTest.java b/third_party/libwebrtc/test/android/org/webrtc/native_test/RTCNativeUnitTest.java
new file mode 100644
index 0000000000..dede7edd1f
--- /dev/null
+++ b/third_party/libwebrtc/test/android/org/webrtc/native_test/RTCNativeUnitTest.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2017 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.webrtc.native_test;
+
+import android.app.Activity;
+import org.chromium.native_test.NativeUnitTest;
+import org.webrtc.ContextUtils;
+
+/**
+ * Native unit test that calls ContextUtils.initialize for WebRTC.
+ */
+public class RTCNativeUnitTest extends NativeUnitTest {
+ @Override
+ public void preCreate(Activity activity) {
+ super.preCreate(activity);
+ ContextUtils.initialize(activity.getApplicationContext());
+ }
+}
diff --git a/third_party/libwebrtc/test/android/org/webrtc/native_test/RTCNativeUnitTestActivity.java b/third_party/libwebrtc/test/android/org/webrtc/native_test/RTCNativeUnitTestActivity.java
new file mode 100644
index 0000000000..2a413682fe
--- /dev/null
+++ b/third_party/libwebrtc/test/android/org/webrtc/native_test/RTCNativeUnitTestActivity.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2017 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.webrtc.native_test;
+
+import android.app.Activity;
+import android.os.Bundle;
+
+/**
+ * Activity that uses RTCNativeUnitTest to run the tests.
+ */
+public class RTCNativeUnitTestActivity extends Activity {
+ private RTCNativeUnitTest mTest = new RTCNativeUnitTest();
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ mTest.preCreate(this);
+ super.onCreate(savedInstanceState);
+ mTest.postCreate(this);
+ }
+
+ @Override
+ public void onStart() {
+ super.onStart();
+ mTest.postStart(this, false);
+ }
+}