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

Unified Diff: android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java

Issue 1262393003: [Android WebView] Move browser-side initialization out from Application (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments addressed Created 5 years, 5 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 | « no previous file | android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellApplication.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java
diff --git a/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java b/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java
index d24d813a43b74b4e016c6403e8d7a30bdc1b5b35..7f374b834bbe36fcbdbedf5661c00805b6ade913 100644
--- a/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java
+++ b/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java
@@ -38,7 +38,11 @@ import org.chromium.android_webview.AwDevToolsServer;
import org.chromium.android_webview.AwSettings;
import org.chromium.android_webview.test.AwTestContainerView;
import org.chromium.android_webview.test.NullContentsClient;
+import org.chromium.base.BaseSwitches;
import org.chromium.base.CommandLine;
+import org.chromium.base.Log;
+import org.chromium.base.TraceEvent;
+import org.chromium.content.app.ContentApplication;
import org.chromium.content.browser.SelectActionMode;
import org.chromium.content.browser.SelectActionModeCallback;
import org.chromium.content.browser.SelectActionModeCallback.ActionHandler;
@@ -53,6 +57,7 @@ import java.net.URISyntaxException;
* This is a lightweight activity for tests that only require WebView functionality.
*/
public class AwShellActivity extends Activity {
+ private static final String TAG = "cr.AwShellActivity";
private static final String PREFERENCES_NAME = "AwShellPrefs";
private static final String INITIAL_URL = "about:blank";
private AwBrowserContext mBrowserContext;
@@ -73,6 +78,18 @@ public class AwShellActivity extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ AwShellResourceProvider.registerResources(this);
+
+ ContentApplication.initCommandLine(this);
+ waitForDebuggerIfNeeded();
+
+ AwBrowserProcess.loadLibrary(this);
+
+ if (CommandLine.getInstance().hasSwitch(AwShellSwitches.ENABLE_ATRACE)) {
+ Log.e(TAG, "Enabling Android trace.");
+ TraceEvent.setATraceEnabled(true);
+ }
+
setContentView(R.layout.testshell_activity);
mAwTestContainerView = createAwTestContainerView();
@@ -276,4 +293,12 @@ public class AwShellActivity extends Activity {
return super.onKeyUp(keyCode, event);
}
+
+ private void waitForDebuggerIfNeeded() {
+ if (CommandLine.getInstance().hasSwitch(BaseSwitches.WAIT_FOR_JAVA_DEBUGGER)) {
+ Log.e(TAG, "Waiting for Java debugger to connect...");
+ android.os.Debug.waitForDebugger();
+ Log.e(TAG, "Java debugger connected. Resuming execution.");
+ }
+ }
}
« no previous file with comments | « no previous file | android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellApplication.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698