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

Unified Diff: tools/profile_chrome/chrome_startup_controller.py

Issue 896503002: [Android] Add LogcatMonitor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « tools/profile_chrome/chrome_controller.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/profile_chrome/chrome_startup_controller.py
diff --git a/tools/profile_chrome/chrome_startup_controller.py b/tools/profile_chrome/chrome_startup_controller.py
index 8852cfe622ce9da5fd1426651d484ed416fc14d1..d685502eb50d53f3e1f9963ffeb4ba7d7479f44c 100644
--- a/tools/profile_chrome/chrome_startup_controller.py
+++ b/tools/profile_chrome/chrome_startup_controller.py
@@ -16,10 +16,10 @@ class ChromeStartupTracingController(controllers.BaseController):
self._device = device
self._package_info = package_info
self._cold = cold
+ self._logcat_monitor = self._device.GetLogcatMonitor()
self._url = url
self._trace_file = None
self._trace_finish_re = re.compile(r' Completed startup tracing to (.*)')
- self._device.old_interface.StartMonitoringLogcat(clear=False)
def __repr__(self):
return 'Browser Startup Trace'
@@ -30,15 +30,16 @@ class ChromeStartupTracingController(controllers.BaseController):
changer = flag_changer.FlagChanger(
self._device, self._package_info.cmdline_file)
changer.AddFlags(['--trace-startup'])
- self._device.old_interface.CloseApplication(self._package_info.package)
+ self._device.ForceStop(self._package_info.package)
if self._cold:
- self._device.old_interface.EnableAdbRoot()
+ self._device.EnableRoot()
cache_control.CacheControl(self._device).DropRamCaches()
- self._device.old_interface.StartActivity(
- package=self._package_info.package,
- activity=self._package_info.activity,
- data=self._url,
- extras={'create_new_tab' : True})
+ self._device.StartActivity(
+ intent.Intent(
+ package=self._package_info.package,
+ activity=self._package_info.activity,
+ data=self._url,
+ extras={'create_new_tab' : True}))
def _TearDownTracing(self):
changer = flag_changer.FlagChanger(
@@ -47,12 +48,12 @@ class ChromeStartupTracingController(controllers.BaseController):
def StartTracing(self, interval):
self._SetupTracing()
- self._device.old_interface.SyncLogCat()
+ self._logcat_monitor.Start()
def StopTracing(self):
try:
- self._trace_file = self._device.old_interface.WaitForLogMatch(
- self._trace_finish_re, None, timeout=10).group(1)
+ self._trace_file = self._logcat_monitor.WaitFor(
+ self._trace_finish_re).group(1)
finally:
self._TearDownTracing()
« no previous file with comments | « tools/profile_chrome/chrome_controller.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698