summaryrefslogtreecommitdiffstats
path: root/testing/android
diff options
context:
space:
mode:
Diffstat (limited to 'testing/android')
-rw-r--r--testing/android/java/src/org/chromium/native_test/ChromeNativeTestActivity.java26
-rw-r--r--testing/android/native_test.gyp44
2 files changed, 10 insertions, 60 deletions
diff --git a/testing/android/java/src/org/chromium/native_test/ChromeNativeTestActivity.java b/testing/android/java/src/org/chromium/native_test/ChromeNativeTestActivity.java
index d15d04e..6486a14 100644
--- a/testing/android/java/src/org/chromium/native_test/ChromeNativeTestActivity.java
+++ b/testing/android/java/src/org/chromium/native_test/ChromeNativeTestActivity.java
@@ -15,6 +15,9 @@ import org.chromium.base.ChromiumActivity;
import org.chromium.base.PathUtils;
import org.chromium.base.PowerMonitor;
+// TODO(cjhopman): This should not refer to content. NativeLibraries should be moved to base.
+import org.chromium.content.app.NativeLibraries;
+
import java.io.File;
// Android's NativeActivity is mostly useful for pure-native code.
@@ -26,27 +29,16 @@ public class ChromeNativeTestActivity extends ChromiumActivity {
// We post a delayed task to run tests so that we do not block onCreate().
private static final long RUN_TESTS_DELAY_IN_MS = 300;
- // Name of our shlib as obtained from a string resource.
- private String mLibrary;
-
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
-
- mLibrary = getResources().getString(R.string.native_library);
- if ((mLibrary == null) || mLibrary.startsWith("replace")) {
- nativeTestFailed();
- return;
- }
-
// Needed by path_utils_unittest.cc
PathUtils.setPrivateDataDirectorySuffix("chrome");
// Needed by system_monitor_unittest.cc
PowerMonitor.createForTests(this);
-
- loadLibrary();
+ loadLibraries();
Bundle extras = this.getIntent().getExtras();
if (extras != null && extras.containsKey(EXTRA_RUN_IN_SUB_THREAD)) {
// Create a new thread and run tests on it.
@@ -80,10 +72,12 @@ public class ChromeNativeTestActivity extends ChromiumActivity {
Log.e(TAG, "[ RUNNER_FAILED ] could not load native library");
}
- private void loadLibrary() {
- Log.i(TAG, "loading: " + mLibrary);
- System.loadLibrary(mLibrary);
- Log.i(TAG, "loaded: " + mLibrary);
+ private void loadLibraries() {
+ for (String library: NativeLibraries.libraries) {
+ Log.i(TAG, "loading: " + library);
+ System.loadLibrary(library);
+ Log.i(TAG, "loaded: " + library);
+ }
}
private native void nativeRunTests(String filesDir, Context appContext);
diff --git a/testing/android/native_test.gyp b/testing/android/native_test.gyp
index bbed98a..4a3cc4d 100644
--- a/testing/android/native_test.gyp
+++ b/testing/android/native_test.gyp
@@ -7,50 +7,6 @@
['OS=="android"', {
'targets': [
{
- 'target_name': 'native_test_apk',
- 'message': 'building native test apk',
- 'type': 'none',
- 'dependencies': [
- 'native_test_native_code',
- '<(DEPTH)/base/base.gyp:base_java',
- ],
- 'actions': [
- {
- 'action_name': 'native_test_apk',
- 'inputs': [
- '<(DEPTH)/testing/android/native_test_apk.xml',
- '<!@(find <(DEPTH)/testing/android -name "*.java")',
- '>@(input_jars_paths)',
- 'native_test_launcher.cc'
- ],
- 'outputs': [
- # Awkwardly, we build a Debug APK even when gyp is in
- # Release mode. I don't think it matters (e.g. we're
- # probably happy to not codesign) but naming should be
- # fixed. The -debug name is an aspect of the android
- # SDK antfiles (e.g. ${sdk.dir}/tools/ant/build.xml)
- '<(PRODUCT_DIR)/replaceme_apk/replaceme-debug.apk',
- ],
- 'action': [
- 'ant', '-q',
- # TODO: All of these paths are absolute paths right now, while
- # we really should be using relative paths for anything that is
- # checked in to the Chromium tree (among which the SDK).
- '-DPRODUCT_DIR=<(ant_build_out)',
- '-DANDROID_SDK=<(android_sdk)',
- '-DANDROID_SDK_ROOT=<(android_sdk_root)',
- '-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
- '-DANDROID_SDK_VERSION=<(android_sdk_version)',
- '-DANDROID_GDBSERVER=<(android_gdbserver)',
- '-DCHROMIUM_SRC=<(ant_build_out)/../..',
- '-DINPUT_JARS_PATHS=>(input_jars_paths)',
- '-buildfile',
- '<(DEPTH)/testing/android/native_test_apk.xml',
- ]
- }
- ],
- },
- {
'target_name': 'native_test_native_code',
'message': 'building native pieces of native test package',
'type': 'static_library',