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

Unified Diff: build/android/pylib/device/device_utils.py

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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/pylib/device/adb_wrapper.py ('k') | build/android/pylib/device/device_utils_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/device/device_utils.py
diff --git a/build/android/pylib/device/device_utils.py b/build/android/pylib/device/device_utils.py
index f4bce41f2d660d5d1b843fe9b69d126436ebfc60..f6bebcebe98c9b2f6c98b725d27be6da22f1f6c3 100644
--- a/build/android/pylib/device/device_utils.py
+++ b/build/android/pylib/device/device_utils.py
@@ -215,9 +215,6 @@ class DeviceUtils(object):
CommandTimeoutError on timeout.
DeviceUnreachableError on missing device.
"""
- return self._GetExternalStoragePathImpl()
-
- def _GetExternalStoragePathImpl(self):
if 'external_storage' in self._cache:
return self._cache['external_storage']
@@ -285,7 +282,8 @@ class DeviceUtils(object):
return self.GetProp('sys.boot_completed') == '1'
def wifi_enabled():
- return 'Wi-Fi is enabled' in self.RunShellCommand(['dumpsys', 'wifi'])
+ return 'Wi-Fi is enabled' in self.RunShellCommand(['dumpsys', 'wifi'],
+ check_return=False)
self.adb.WaitForDevice()
timeout_retry.WaitFor(sd_card_ready)
@@ -442,7 +440,7 @@ class DeviceUtils(object):
timeout = self._default_timeout
try:
- output = self.adb.Shell(cmd, expect_rc=0)
+ output = self.adb.Shell(cmd)
except device_errors.AdbShellCommandFailedError as e:
if check_return:
raise
@@ -531,6 +529,22 @@ class DeviceUtils(object):
raise device_errors.CommandFailedError(l, device=str(self))
@decorators.WithTimeoutAndRetriesFromInstance()
+ def StartInstrumentation(self, component, finish=True, raw=False,
+ extras=None, timeout=None, retries=None):
+ if extras is None:
+ extras = {}
+
+ cmd = ['am', 'instrument']
+ if finish:
+ cmd.append('-w')
+ if raw:
+ cmd.append('-r')
+ for k, v in extras.iteritems():
+ cmd.extend(['-e', k, v])
+ cmd.append(component)
+ return self.RunShellCommand(cmd, check_return=True)
+
+ @decorators.WithTimeoutAndRetriesFromInstance()
def BroadcastIntent(self, intent, timeout=None, retries=None):
"""Send a broadcast intent.
@@ -768,7 +782,7 @@ class DeviceUtils(object):
zip_proc.start()
zip_proc.join()
- zip_on_device = '%s/tmp.zip' % self._GetExternalStoragePathImpl()
+ zip_on_device = '%s/tmp.zip' % self.GetExternalStoragePath()
try:
self.adb.Push(zip_file.name, zip_on_device)
self.RunShellCommand(
« no previous file with comments | « build/android/pylib/device/adb_wrapper.py ('k') | build/android/pylib/device/device_utils_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698