diff options
author | bulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-19 12:24:44 +0000 |
---|---|---|
committer | bulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-19 12:24:44 +0000 |
commit | 21bbc2099f10c46a6ac1c9a9411a015fb50cfd16 (patch) | |
tree | de2563c5d0990b9b9d1acd97f32235a5b733a97f /testing | |
parent | 2cf8a187dd1bff4ad43aa1a8b61d040a1bc982e9 (diff) | |
download | chromium_src-21bbc2099f10c46a6ac1c9a9411a015fb50cfd16.zip chromium_src-21bbc2099f10c46a6ac1c9a9411a015fb50cfd16.tar.gz chromium_src-21bbc2099f10c46a6ac1c9a9411a015fb50cfd16.tar.bz2 |
Android: fix test runners for non-rooted devices.
Move the generated file for GetAllTests() to a public directory in the device.
Adds the necessary permission to the manifest for the test.
BUG=
TEST=run android tests in a non-rooted device.
Review URL: https://chromiumcodereview.appspot.com/10804003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147430 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'testing')
-rw-r--r-- | testing/android/AndroidManifest.xml | 1 | ||||
-rw-r--r-- | testing/android/java/src/org/chromium/native_test/ChromeNativeTestActivity.java | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/testing/android/AndroidManifest.xml b/testing/android/AndroidManifest.xml index 3678c47..9a83125 100644 --- a/testing/android/AndroidManifest.xml +++ b/testing/android/AndroidManifest.xml @@ -26,5 +26,6 @@ found in the LICENSE file. <!-- TODO(jrg): add more permissions as needed by unit tests. --> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.WAKE_LOCK"/> + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> </manifest> 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 ad3bab4..7fec565 100644 --- a/testing/android/java/src/org/chromium/native_test/ChromeNativeTestActivity.java +++ b/testing/android/java/src/org/chromium/native_test/ChromeNativeTestActivity.java @@ -7,11 +7,14 @@ package org.chromium.native_test; import android.app.Activity; import android.content.Context; import android.os.Bundle; +import android.os.Environment; import android.os.Handler; import android.util.Log; import org.chromium.base.PathUtils; +import java.io.File; + // Android's NativeActivity is mostly useful for pure-native code. // Our tests need to go up to our own java classes, which is not possible using // the native activity class loader. @@ -67,7 +70,11 @@ public class ChromeNativeTestActivity extends Activity { private void runTests() { Log.d(TAG, ">>nativeRunTests"); - nativeRunTests(getFilesDir().getAbsolutePath(), getApplicationContext()); + // This directory is used by build/android/pylib/test_package_apk.py. + File filesDir = new File(Environment.getExternalStorageDirectory(), + "native_tests/"); + filesDir.mkdirs(); + nativeRunTests(filesDir.getAbsolutePath(), getApplicationContext()); Log.d(TAG, "<<nativeRunTests"); } |