Index: components/test/android/browsertests_apk/src/org/chromium/components_browsertests_apk/ComponentsBrowserTestsActivity.java |
diff --git a/components/test/android/browsertests_apk/src/org/chromium/components_browsertests_apk/ComponentsBrowserTestsActivity.java b/components/test/android/browsertests_apk/src/org/chromium/components_browsertests_apk/ComponentsBrowserTestsActivity.java |
index ae94edcedde501367581021e056937e67d6d4ab0..bbf2461f158b360f734173c282031b369ebac98f 100644 |
--- a/components/test/android/browsertests_apk/src/org/chromium/components_browsertests_apk/ComponentsBrowserTestsActivity.java |
+++ b/components/test/android/browsertests_apk/src/org/chromium/components_browsertests_apk/ComponentsBrowserTestsActivity.java |
@@ -4,44 +4,43 @@ |
package org.chromium.components_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.Log; |
+import org.chromium.base.JNINamespace; |
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 components browser tests |
*/ |
-public class ComponentsBrowserTestsActivity extends NativeBrowserTestActivity { |
- private static final String TAG = Log.makeTag("native_test"); |
+@JNINamespace("components") |
+public class ComponentsBrowserTestsActivity extends Activity { |
+ private static final String TAG = "ComponentsBrowserTestsActivity"; |
private ShellManager mShellManager; |
private WindowAndroid mWindowAndroid; |
@Override |
+ @SuppressFBWarnings("DM_EXIT") |
public void onCreate(Bundle savedInstanceState) { |
super.onCreate(savedInstanceState); |
- appendCommandLineFlags( |
- "--remote-debugging-socket-name components_browsertests_devtools_remote"); |
- } |
- @Override |
- @SuppressFBWarnings("DM_EXIT") |
- protected void initializeBrowserProcess() { |
try { |
LibraryLoader.get(LibraryProcessType.PROCESS_BROWSER).ensureInitialized(); |
} catch (ProcessInitException e) { |
- Log.e(TAG, "Cannot load components_browsertests.", e); |
+ Log.i(TAG, "Cannot load components_browsertests:" + e); |
System.exit(-1); |
} |
BrowserStartupController.get(getApplicationContext(), LibraryProcessType.PROCESS_BROWSER) |
@@ -56,5 +55,21 @@ |
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); |
} |