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

Unified Diff: tools/android/adb_profile_chrome/chrome_controller.py

Issue 338353004: [Android] Switch KillAll, StartActivity, and BroadcastIntent to DeviceUtils. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: appeasing windows Created 6 years, 6 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 | « build/android/tombstones.py ('k') | tools/android/adb_profile_chrome/controllers_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/adb_profile_chrome/chrome_controller.py
diff --git a/tools/android/adb_profile_chrome/chrome_controller.py b/tools/android/adb_profile_chrome/chrome_controller.py
index 5457e93dace8315abfc977f59d6fec43fa9988a2..3dc88556eabf69eb855b928738b90ad0d43eb943 100644
--- a/tools/android/adb_profile_chrome/chrome_controller.py
+++ b/tools/android/adb_profile_chrome/chrome_controller.py
@@ -10,6 +10,7 @@ import time
from adb_profile_chrome import controllers
from pylib import pexpect
+from pylib.device import intent
_HEAP_PROFILE_MMAP_PROPERTY = 'heapprof.mmap'
@@ -35,8 +36,8 @@ class ChromeTracingController(controllers.BaseController):
@staticmethod
def GetCategories(device, package_info):
- device.old_interface.BroadcastIntent(
- package_info.package, 'GPU_PROFILER_LIST_CATEGORIES')
+ device.BroadcastIntent(intent.Intent(
+ action='%s.GPU_PROFILER_LIST_CATEGORIES' % self._package_info.package))
try:
json_category_list = device.old_interface.WaitForLogMatch(
re.compile(r'{"traceCategoriesList(.*)'), None, timeout=5).group(0)
@@ -58,10 +59,12 @@ class ChromeTracingController(controllers.BaseController):
def StartTracing(self, interval):
self._trace_interval = interval
self._device.old_interface.SyncLogCat()
- self._device.old_interface.BroadcastIntent(
- self._package_info.package, 'GPU_PROFILER_START',
- '-e categories "%s"' % ','.join(self._categories),
- '-e continuous' if self._ring_buffer else '')
+ start_extras = {'categories': ','.join(self._categories)}
+ if self._ring_buffer:
+ start_extras['continuous'] = None
+ self._device.BroadcastIntent(intent.Intent(
+ action='%s.GPU_PROFILER_START' % self._package_info.package,
+ extras=start_extras))
if self._trace_memory:
self._device.old_interface.EnableAdbRoot()
@@ -83,9 +86,8 @@ class ChromeTracingController(controllers.BaseController):
'of the browser running?')
def StopTracing(self):
- self._device.old_interface.BroadcastIntent(
- self._package_info.package,
- 'GPU_PROFILER_STOP')
+ self._device.BroadcastIntent(intent.Intent(
+ action='%s.GPU_PROFILER_STOP' % self._package_info.package))
self._trace_file = self._device.old_interface.WaitForLogMatch(
self._trace_finish_re, None, timeout=120).group(1)
if self._trace_memory:
« no previous file with comments | « build/android/tombstones.py ('k') | tools/android/adb_profile_chrome/controllers_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698