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

Unified Diff: tools/android/loading/sandwich_runner.py

Issue 1872313002: sandwich: Implement SandwichTaskBuilder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addresses pasko's comments Created 4 years, 8 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: tools/android/loading/sandwich_runner.py
diff --git a/tools/android/loading/sandwich_runner.py b/tools/android/loading/sandwich_runner.py
index ebef772004e3683deb39d49bde2062d3a0b23a7c..bbe685822e01498d3da1bf20dbdcfead8a95c583 100644
--- a/tools/android/loading/sandwich_runner.py
+++ b/tools/android/loading/sandwich_runner.py
@@ -20,9 +20,23 @@ import controller
import devtools_monitor
import device_setup
import loading_trace
-import sandwich_metrics
+# Standard filenames in the sandwich runner's output directory.
+TRACE_FILENAME = 'trace.json'
+VIDEO_FILENAME = 'video.mp4'
+
+# List of selected trace event categories when running chrome.
+CATEGORIES = [
+ # Need blink network trace events for prefetch_view.PrefetchSimulationView
+ 'blink.net',
+
+ # Need to get mark trace events for _GetWebPageTrackedEvents()
+ 'blink.user_timing',
+
+ # Need to memory dump trace event for _GetBrowserDumpEvents()
+ 'disabled-by-default-memory-infra']
+
_JOB_SEARCH_PATH = 'sandwich_jobs'
# Devtools timeout of 1 minute to avoid websocket timeout on slow
@@ -197,24 +211,24 @@ class SandwichRunner(object):
if run_path is not None and self.record_video:
device = self._chrome_ctl.GetDevice()
assert device, 'Can only record video on a remote device.'
- video_recording_path = os.path.join(run_path, 'video.mp4')
+ video_recording_path = os.path.join(run_path, VIDEO_FILENAME)
with device_setup.RemoteSpeedIndexRecorder(device, connection,
video_recording_path):
trace = loading_trace.LoadingTrace.RecordUrlNavigation(
url=url,
connection=connection,
chrome_metadata=self._chrome_ctl.ChromeMetadata(),
- categories=sandwich_metrics.CATEGORIES,
+ categories=CATEGORIES,
timeout_seconds=_DEVTOOLS_TIMEOUT)
else:
trace = loading_trace.LoadingTrace.RecordUrlNavigation(
url=url,
connection=connection,
chrome_metadata=self._chrome_ctl.ChromeMetadata(),
- categories=sandwich_metrics.CATEGORIES,
+ categories=CATEGORIES,
timeout_seconds=_DEVTOOLS_TIMEOUT)
if run_path is not None:
- trace_path = os.path.join(run_path, 'trace.json')
+ trace_path = os.path.join(run_path, TRACE_FILENAME)
trace.ToJsonFile(trace_path)
def _RunUrl(self, url, run_id):

Powered by Google App Engine
This is Rietveld 408576698