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

Unified Diff: build/android/pylib/android_commands.py

Issue 358993003: [Android] Switch to DeviceUtils versions of file functions. (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/provision_devices.py ('k') | build/android/pylib/base/base_test_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/android_commands.py
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py
index df7e56f7019b675088ee56f149cbcfe68ea67001..3d13f196a6f9a45aaede3df6e4bba747c9d1afd1 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -1054,7 +1054,9 @@ class AndroidCommands(object):
All pushed files can be removed by calling RemovePushedFiles().
"""
MAX_INDIVIDUAL_PUSHES = 50
- assert os.path.exists(host_path), 'Local path not found %s' % host_path
+ if not os.path.exists(host_path):
+ raise device_errors.CommandFailedError(
+ 'Local path not found %s' % host_path, device=str(self))
# See if the file on the host changed since the last push (if any) and
# return early if it didn't. Note that this shortcut assumes that the tests
@@ -1110,8 +1112,6 @@ class AndroidCommands(object):
# approximates the push time for each method.
if len(changed_files) > MAX_INDIVIDUAL_PUSHES or diff_size > 0.5 * size:
self._actual_push_size += size
- if os.path.isdir(host_path):
- self.RunShellCommand('mkdir -p %s' % device_path)
Push(host_path, device_path)
else:
for f in changed_files:
@@ -1783,7 +1783,9 @@ class AndroidCommands(object):
device_file: Absolute path to the file to retrieve from the device.
host_file: Absolute path to the file to store on the host.
"""
- assert self._adb.Pull(device_file, host_file)
+ if not self._adb.Pull(device_file, host_file):
+ raise device_errors.AdbCommandFailedError(
+ ['pull', device_file, host_file], 'Failed to pull file from device.')
assert os.path.exists(host_file)
def SetUtilWrapper(self, util_wrapper):
« no previous file with comments | « build/android/provision_devices.py ('k') | build/android/pylib/base/base_test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698