Index: testing/android/native_test/java/src/org/chromium/native_test/NativeUnitTest.java |
diff --git a/testing/android/native_test/java/src/org/chromium/native_test/NativeUnitTestActivity.java b/testing/android/native_test/java/src/org/chromium/native_test/NativeUnitTest.java |
similarity index 59% |
copy from testing/android/native_test/java/src/org/chromium/native_test/NativeUnitTestActivity.java |
copy to testing/android/native_test/java/src/org/chromium/native_test/NativeUnitTest.java |
index 84115838972fbedbc8e6b056cfc1ded075cdfca5..d7209ba836e58757d4b9e6a9f1634c2080ab8fca 100644 |
--- a/testing/android/native_test/java/src/org/chromium/native_test/NativeUnitTestActivity.java |
+++ b/testing/android/native_test/java/src/org/chromium/native_test/NativeUnitTest.java |
@@ -4,7 +4,7 @@ |
package org.chromium.native_test; |
-import android.os.Bundle; |
+import android.app.Activity; |
import org.chromium.base.ContextUtils; |
import org.chromium.base.Log; |
@@ -13,24 +13,25 @@ import org.chromium.base.PowerMonitor; |
import org.chromium.base.library_loader.NativeLibraries; |
/** |
- * An {@link android.app.Activity} for running native unit tests. |
- * (i.e., not browser tests) |
+ * A helper for running native unit tests (i.e., not browser tests) |
*/ |
-public class NativeUnitTestActivity extends NativeTestActivity { |
- |
+public class NativeUnitTest extends NativeTest { |
private static final String TAG = "cr_NativeTest"; |
@Override |
- public void onCreate(Bundle savedInstanceState) { |
- super.onCreate(savedInstanceState); |
+ public void preCreate(Activity activity) { |
+ super.preCreate(activity); |
// Needed by path_utils_unittest.cc |
- PathUtils.setPrivateDataDirectorySuffix("chrome", getApplicationContext()); |
+ PathUtils.setPrivateDataDirectorySuffix("chrome", activity.getApplicationContext()); |
// Needed by system_monitor_unittest.cc |
- PowerMonitor.createForTests(this); |
+ PowerMonitor.createForTests(activity); |
- ContextUtils.initApplicationContext(getApplicationContext()); |
+ ContextUtils.initApplicationContext(activity.getApplicationContext()); |
+ // For NativeActivity based tests, |
+ // dependency libraries must be loaded before NativeActivity::OnCreate, |
+ // otherwise loading android.app.lib_name will fail |
loadLibraries(); |
} |