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

Unified Diff: tools/telemetry/telemetry/core/backends/android_app_backend.py

Issue 811703007: Create AndroidCommandLineBackend to handle setting up cmdline args (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add context manager for command line backend Created 5 years, 11 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 | tools/telemetry/telemetry/core/backends/android_browser_backend_settings.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/backends/android_app_backend.py
diff --git a/tools/telemetry/telemetry/core/backends/android_app_backend.py b/tools/telemetry/telemetry/core/backends/android_app_backend.py
index 196d855d75de903f650fcaac64fbc9b41723eb67..adcf69b33962cd97c648f0f7407647bbcb9d3e48 100644
--- a/tools/telemetry/telemetry/core/backends/android_app_backend.py
+++ b/tools/telemetry/telemetry/core/backends/android_app_backend.py
@@ -10,9 +10,12 @@ from telemetry.core import util
from telemetry.core import web_contents
from telemetry.core.backends import adb_commands
from telemetry.core.backends import app_backend
+from telemetry.core.backends import android_browser_backend_settings
+from telemetry.core.backends import android_command_line_backend
class AndroidAppBackend(app_backend.AppBackend):
+
def __init__(self, android_platform_backend, start_intent,
is_app_ready_predicate=None):
super(AndroidAppBackend, self).__init__(
@@ -36,10 +39,15 @@ class AndroidAppBackend(app_backend.AppBackend):
AppStory derivations can customize the wait-for-ready-state to wait
for a more specific event if needed.
"""
- # TODO(slamm): check if can use "blocking=True" instead of needing to sleep.
- # If "blocking=True" does not work, switch sleep to "ps" check.
- self._adb.device().StartActivity(self._start_intent, blocking=False)
- util.WaitFor(self._IsAppReady, timeout=60)
+ webview_startup_args = self.GetWebviewStartupArgs()
+ backend_settings = android_browser_backend_settings.WebviewBackendSettings(
+ 'android-webview')
+ with android_command_line_backend.SetUpCommandLineFlags(
+ self._adb, backend_settings, webview_startup_args):
+ # TODO(slamm): check if can use "blocking=True" instead of needing to
+ # sleep. If "blocking=True" does not work, switch sleep to "ps" check.
+ self._adb.device().StartActivity(self._start_intent, blocking=False)
+ util.WaitFor(self._IsAppReady, timeout=60)
self._is_running = True
def Close(self):
@@ -81,3 +89,15 @@ class AndroidAppBackend(app_backend.AppBackend):
for process in self.GetProcesses():
webviews.update(process.GetWebViews())
return webviews
+
+ def GetWebviewStartupArgs(self):
+ args = []
+
+ # Turn on GPU benchmarking extension for all runs. The only side effect of
+ # the extension being on is that render stats are tracked. This is believed
+ # to be effectively free. And, by doing so here, it avoids us having to
+ # programmatically inspect a pageset's actions in order to determine if it
+ # might eventually scroll.
+ args.append('--enable-gpu-benchmarking')
+
+ return args
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/backends/android_browser_backend_settings.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698