Chromium Code Reviews| 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..74bb23386fa809b002b2b4f53815d1e6461e28f0 100644 |
| --- a/build/android/pylib/device/decorators.py |
| +++ b/build/android/pylib/device/decorators.py |
| @@ -7,11 +7,18 @@ 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 |
| +sys.path.append(os.path.join(constants.DIR_SOURCE_ROOT, 'third_party', |
|
craigdh
2014/05/14 20:33:08
if this is temporary please add a TODO saying when
jbudorick
2014/05/14 21:02:01
Done.
|
| + 'android_testrunner')) |
| +import errors as old_errors |
| + |
| def _TimeoutRetryWrapper(f, timeout_func, retries_func): |
| @functools.wraps(f) |
| @@ -22,6 +29,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 |