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

Unified Diff: components/test/android/browsertests_apk/src/org/chromium/components_browsertests_apk/ComponentsBrowserTestsActivity.java

Issue 1173363008: [Android] Refactor browser test execution. (RELAND) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed. Created 5 years, 6 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: 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..77264b3de60594e30ea2caaae8ea94bcfe9450d9 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
@@ -5,29 +5,16 @@
package org.chromium.components_browsertests_apk;
import android.os.Bundle;
-import android.view.Window;
-import android.view.WindowManager;
-
-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;
+
+import org.chromium.base.PathUtils;
+import org.chromium.content_shell.browsertests.ContentShellBrowserTestActivity;
+
+import java.io.File;
/**
* Android activity for running components browser tests
*/
-public class ComponentsBrowserTestsActivity extends NativeBrowserTestActivity {
- private static final String TAG = Log.makeTag("native_test");
-
- private ShellManager mShellManager;
- private WindowAndroid mWindowAndroid;
-
+public class ComponentsBrowserTestsActivity extends ContentShellBrowserTestActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -36,25 +23,18 @@ public class ComponentsBrowserTestsActivity extends NativeBrowserTestActivity {
}
@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);
- System.exit(-1);
- }
- BrowserStartupController.get(getApplicationContext(), LibraryProcessType.PROCESS_BROWSER)
- .initChromiumBrowserProcessForTests();
-
- setContentView(R.layout.test_activity);
- mShellManager = (ShellManager) findViewById(R.id.shell_container);
- mWindowAndroid = new ActivityWindowAndroid(this);
- mShellManager.setWindow(mWindowAndroid, false);
-
- Window wind = this.getWindow();
- wind.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
- wind.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
- wind.addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
+ protected File getPrivateDataDirectory() {
+ return new File(PathUtils.getExternalStorageDirectory(),
+ ComponentsBrowserTestsApplication.PRIVATE_DATA_DIRECTORY_SUFFIX);
+ }
+
+ @Override
+ protected int getTestActivityViewId() {
+ return R.layout.test_activity;
+ }
+
+ @Override
+ protected int getShellManagerViewId() {
+ return R.id.shell_container;
}
}

Powered by Google App Engine
This is Rietveld 408576698