summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkosiba@chromium.org <mkosiba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-01 17:01:15 +0000
committermkosiba@chromium.org <mkosiba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-01 17:01:15 +0000
commitef4612c97e2dd450fa05b7a75683ec79b3f467d3 (patch)
treee36a9cc45ccbc73d72ced605e3df85b67bab3c49
parent766483e12157793e94e1f6e83e10c54f22e2e06d (diff)
downloadchromium_src-ef4612c97e2dd450fa05b7a75683ec79b3f467d3.zip
chromium_src-ef4612c97e2dd450fa05b7a75683ec79b3f467d3.tar.gz
chromium_src-ef4612c97e2dd450fa05b7a75683ec79b3f467d3.tar.bz2
[android_webview] Make it possible to enable trace for the shell.
In r265466 we moved initTraceEvent to the glue layer. This makes it impossible to trace from the test shell. BUG=None Review URL: https://codereview.chromium.org/265833005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267546 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellApplication.java9
-rw-r--r--android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellSwitches.java18
2 files changed, 27 insertions, 0 deletions
diff --git a/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellApplication.java b/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellApplication.java
index f6488f4..b019d8a 100644
--- a/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellApplication.java
+++ b/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellApplication.java
@@ -11,8 +11,12 @@ import android.util.Log;
import org.chromium.android_webview.AwBrowserProcess;
import org.chromium.base.BaseSwitches;
import org.chromium.base.CommandLine;
+import org.chromium.base.TraceEvent;
import org.chromium.content.browser.ResourceExtractor;
+/**
+ * The android_webview shell Application subclass.
+ */
public class AwShellApplication extends Application {
private static final String TAG = "AwShellApplication";
@@ -38,5 +42,10 @@ public class AwShellApplication extends Application {
ResourceExtractor.setMandatoryPaksToExtract(MANDATORY_PAKS);
ResourceExtractor.setExtractImplicitLocaleForTesting(false);
AwBrowserProcess.loadLibrary();
+
+ if (CommandLine.getInstance().hasSwitch(AwShellSwitches.ENABLE_ATRACE)) {
+ Log.e(TAG, "Enabling Android trace.");
+ TraceEvent.setATraceEnabled(true);
+ }
}
}
diff --git a/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellSwitches.java b/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellSwitches.java
new file mode 100644
index 0000000..2aceb92
--- /dev/null
+++ b/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellSwitches.java
@@ -0,0 +1,18 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.android_webview.shell;
+
+/**
+ * Contains all of the command line switches that are specific to the test shell of
+ * the android_webview glue layer.
+ */
+public abstract class AwShellSwitches {
+ // Enables Android systrace path for Chrome traces.
+ public static final String ENABLE_ATRACE = "enable-atrace";
+
+ // Prevent instantiation.
+ private AwShellSwitches() {}
+}
+