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

Unified Diff: telemetry/telemetry/internal/platform/tracing_agent/chrome_tracing_agent.py

Issue 1827323003: [Telemetry] Clear tracing state before browser start (Closed) Base URL: git@github.com:catapult-project/catapult@master
Patch Set: fix test Created 4 years, 9 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: telemetry/telemetry/internal/platform/tracing_agent/chrome_tracing_agent.py
diff --git a/telemetry/telemetry/internal/platform/tracing_agent/chrome_tracing_agent.py b/telemetry/telemetry/internal/platform/tracing_agent/chrome_tracing_agent.py
index d6485212e31c5c872c96612047e94111e007a667..e05ff2ae599ad349534822a35159420377addd45 100644
--- a/telemetry/telemetry/internal/platform/tracing_agent/chrome_tracing_agent.py
+++ b/telemetry/telemetry/internal/platform/tracing_agent/chrome_tracing_agent.py
@@ -24,6 +24,15 @@ _CHROME_TRACE_CONFIG_DIR_ANDROID = '/data/local/'
_CHROME_TRACE_CONFIG_FILE_NAME = 'chrome-trace-config.json'
+def ClearStarupTracingStateIfNeeded(platform_backend):
+ # Trace config file has fixed path on Android and temporary path on desktop.
+ if platform_backend.GetOSName() == 'android':
+ trace_config_file = os.path.join(_CHROME_TRACE_CONFIG_DIR_ANDROID,
+ _CHROME_TRACE_CONFIG_FILE_NAME)
+ platform_backend.device.RunShellCommand(
+ ['rm', '-f', trace_config_file], check_return=True, as_root=True)
+
+
class ChromeTracingStartedError(Exception):
pass

Powered by Google App Engine
This is Rietveld 408576698