summaryrefslogtreecommitdiffstats
path: root/testing/android
diff options
context:
space:
mode:
authorcjhopman@chromium.org <cjhopman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-11 01:52:47 +0000
committercjhopman@chromium.org <cjhopman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-11 01:52:47 +0000
commit677ad365c17980f74f03c1992e6e1795723f9cfb (patch)
treea9ac5a2ef53fa95d2e41e152c332400a8082d517 /testing/android
parent07890324ed098994dd336ee00e54074e6b029014 (diff)
downloadchromium_src-677ad365c17980f74f03c1992e6e1795723f9cfb.zip
chromium_src-677ad365c17980f74f03c1992e6e1795723f9cfb.tar.gz
chromium_src-677ad365c17980f74f03c1992e6e1795723f9cfb.tar.bz2
[Android] Use the build-generated list of libraries for gtest APKs
For normal APKs, the build generates a list of libraries to load at build time and this is used at runtime to load libraries. Update our gtest APKs to use this. This makes gtest APKs work in the component build. BUG=158821 Review URL: https://chromiumcodereview.appspot.com/13962003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193536 0039d316-1c4b-4281-b951-d872f2087c98
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',