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

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

Issue 285143002: [Android] Convert to DeviceUtils versions of IsOnline, HasRoot, and EnableRoot. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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/gyp/util/build_device.py ('k') | build/android/pylib/device/device_utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/device/decorators.py
diff --git a/build/android/pylib/device/decorators.py b/build/android/pylib/device/decorators.py
index 29e46ff18b9fadc2e96a398c9e7c0a3e108678fe..09803dd253526072a0cac1919fdefa25dbe3fb5a 100644
--- a/build/android/pylib/device/decorators.py
+++ b/build/android/pylib/device/decorators.py
@@ -7,11 +7,20 @@ Function/method decorators that provide timeout and retry logic.
"""
import functools
+import os
+import sys
+from pylib import constants
from pylib.device import device_errors
from pylib.utils import reraiser_thread
from pylib.utils import timeout_retry
+# TODO(jbudorick) Remove once the DeviceUtils implementations are no longer
+# backed by AndroidCommands / android_testrunner.
+sys.path.append(os.path.join(constants.DIR_SOURCE_ROOT, 'third_party',
+ 'android_testrunner'))
+import errors as old_errors
+
def _TimeoutRetryWrapper(f, timeout_func, retries_func):
@functools.wraps(f)
@@ -22,6 +31,10 @@ def _TimeoutRetryWrapper(f, timeout_func, retries_func):
return f(*args, **kwargs)
try:
return timeout_retry.Run(impl, timeout, retries)
+ except old_errors.WaitForResponseTimedOutError as e:
+ raise device_errors.CommandTimeoutError(str(e))
+ except old_errors.DeviceUnresponsiveError as e:
+ raise device_errors.DeviceUnreachableError(str(e))
except reraiser_thread.TimeoutError as e:
raise device_errors.CommandTimeoutError(str(e))
return TimeoutRetryWrapper
« no previous file with comments | « build/android/gyp/util/build_device.py ('k') | build/android/pylib/device/device_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698