Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(770)

Unified Diff: testing/android/native_test/java/src/org/chromium/native_test/NativeUnitTestActivity.java

Issue 1975153003: Enable NativeActivity based Android tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: testing/android/native_test/java/src/org/chromium/native_test/NativeUnitTestActivity.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/NativeUnitTestActivity.java
index 84115838972fbedbc8e6b056cfc1ded075cdfca5..bd1a8ca808fdcbfc7df3085bb3800c3dbcf3ae64 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/NativeUnitTestActivity.java
@@ -17,6 +17,11 @@ import org.chromium.base.library_loader.NativeLibraries;
* (i.e., not browser tests)
*/
public class NativeUnitTestActivity extends NativeTestActivity {
+ static {
+ // For NativeActivity based tests
+ // dependency libraries must be loaded before NativeActivity::OnCreate
Yaron 2016/05/20 14:39:54 Can you elaborate (to me, not comments) why this i
agrieve 2016/05/20 15:43:16 I think what's going on here is that NativeActivit
ynovikov 2016/05/20 17:07:38 You are right, but it's a bit more complicated. Na
Yaron 2016/05/20 17:54:42 sure, ok to move to onCreate and before super.oncr
ynovikov 2016/05/26 03:16:15 Done.
+ loadLibraries();
+ }
private static final String TAG = "cr_NativeTest";
@@ -31,15 +36,14 @@ public class NativeUnitTestActivity extends NativeTestActivity {
PowerMonitor.createForTests(this);
ContextUtils.initApplicationContext(getApplicationContext());
- loadLibraries();
+ ContextUtils.initApplicationContextForNative();
}
- private void loadLibraries() {
+ private static void loadLibraries() {
for (String library : NativeLibraries.LIBRARIES) {
Log.i(TAG, "loading: %s", library);
System.loadLibrary(library);
Log.i(TAG, "loaded: %s", library);
}
- ContextUtils.initApplicationContextForNative();
}
}

Powered by Google App Engine
This is Rietveld 408576698