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

Unified Diff: content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java

Issue 1143903002: [Android] Refactor the native test wrappers. (RELAND) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 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
« no previous file with comments | « content/shell/android/browsertests_apk/content_browser_tests_jni_onload.cc ('k') | content/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java
diff --git a/content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java b/content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java
index bc95f1cbe83fe9223dfe025aee6b8e8747b7d581..d10b719cfe885073e400fccabbad4c069311473e 100644
--- a/content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java
+++ b/content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java
@@ -4,43 +4,44 @@
package org.chromium.content_browsertests_apk;
-import android.app.Activity;
-import android.content.Context;
import android.os.Bundle;
-import android.os.Handler;
-import android.util.Log;
import android.view.Window;
import android.view.WindowManager;
-import org.chromium.base.JNINamespace;
+import org.chromium.base.Log;
import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.base.library_loader.LibraryLoader;
import org.chromium.base.library_loader.LibraryProcessType;
import org.chromium.base.library_loader.ProcessInitException;
import org.chromium.content.browser.BrowserStartupController;
import org.chromium.content_shell.ShellManager;
+import org.chromium.native_test.NativeBrowserTestActivity;
import org.chromium.ui.base.ActivityWindowAndroid;
import org.chromium.ui.base.WindowAndroid;
/**
* Android activity for running content browser tests
*/
-@JNINamespace("content")
-public class ContentBrowserTestsActivity extends Activity {
- private static final String TAG = "ChromeBrowserTestsActivity";
+public class ContentBrowserTestsActivity extends NativeBrowserTestActivity {
+ private static final String TAG = Log.makeTag("native_test");
private ShellManager mShellManager;
private WindowAndroid mWindowAndroid;
@Override
- @SuppressFBWarnings("DM_EXIT")
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ appendCommandLineFlags(
+ "--remote-debugging-socket-name content_browsertests_devtools_remote");
+ }
+ @Override
+ @SuppressFBWarnings("DM_EXIT")
+ protected void initializeBrowserProcess() {
try {
LibraryLoader.get(LibraryProcessType.PROCESS_BROWSER).ensureInitialized();
} catch (ProcessInitException e) {
- Log.i(TAG, "Cannot load content_browsertests:" + e);
+ Log.e(TAG, "Cannot load content_browsertests.", e);
System.exit(-1);
}
BrowserStartupController.get(getApplicationContext(), LibraryProcessType.PROCESS_BROWSER)
@@ -55,21 +56,5 @@ public class ContentBrowserTestsActivity extends Activity {
wind.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
wind.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
wind.addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
-
- new Handler().post(new Runnable() {
- @Override
- public void run() {
- Log.i(TAG, "Running tests");
- runTests();
- Log.i(TAG, "Tests finished.");
- finish();
- }
- });
- }
-
- private void runTests() {
- nativeRunTests(getFilesDir().getAbsolutePath(), getApplicationContext());
}
-
- private native void nativeRunTests(String filesDir, Context appContext);
}
« no previous file with comments | « content/shell/android/browsertests_apk/content_browser_tests_jni_onload.cc ('k') | content/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698