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

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

Issue 351603002: [Android] Unit tests for DeviceUtils. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/pylib/device/decorators.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 0fee10a7fb0c701551179ae6f057ce2729318053..27e3d418d1d5f5aa960adadd81d6912076da691c 100644
--- a/build/android/pylib/device/device_utils.py
+++ b/build/android/pylib/device/device_utils.py
@@ -183,10 +183,14 @@ class DeviceUtils(object):
if wifi:
while not 'Wi-Fi is enabled' in (
self._RunShellCommandImpl('dumpsys wifi')):
- time.sleep(0.1)
+ time.sleep(1)
+
+ REBOOT_DEFAULT_TIMEOUT = 10 * _DEFAULT_TIMEOUT
+ REBOOT_DEFAULT_RETRIES = _DEFAULT_RETRIES
@decorators.WithTimeoutAndRetriesDefaults(
- 10 * _DEFAULT_TIMEOUT, _DEFAULT_RETRIES)
+ REBOOT_DEFAULT_TIMEOUT,
+ REBOOT_DEFAULT_RETRIES)
def Reboot(self, block=True, timeout=None, retries=None):
"""Reboot the device.
@@ -199,8 +203,12 @@ class DeviceUtils(object):
if block:
self._WaitUntilFullyBootedImpl(timeout=timeout)
+ INSTALL_DEFAULT_TIMEOUT = 4 * _DEFAULT_TIMEOUT
+ INSTALL_DEFAULT_RETRIES = _DEFAULT_RETRIES
+
@decorators.WithTimeoutAndRetriesDefaults(
- 4 * _DEFAULT_TIMEOUT, _DEFAULT_RETRIES)
+ INSTALL_DEFAULT_TIMEOUT,
+ INSTALL_DEFAULT_RETRIES)
def Install(self, apk_path, reinstall=False, timeout=None, retries=None):
"""Install an APK.
@@ -293,7 +301,7 @@ class DeviceUtils(object):
cmd, timeout_time=timeout)
if int(code) != 0:
raise device_errors.CommandFailedError(
- cmd, 'Nonzero exit code (%d)' % code)
+ cmd.split(), 'Nonzero exit code (%d)' % code)
else:
output = self.old_interface.RunShellCommand(cmd, timeout_time=timeout)
return output
« no previous file with comments | « build/android/pylib/device/decorators.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