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

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

Issue 10910087: The 'test' command is not always usable on android (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Refine it Created 8 years, 3 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 | « no previous file | no next file » | 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 c6da8e5b6032b848f66a643f1177022b92f1a539..3cfcab52d2588d735d1e4f33a9e487239f00d370 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -1011,7 +1011,14 @@ class AndroidCommands(object):
assert '"' not in file_name, 'file_name cannot contain double quotes'
status = self._adb.SendShellCommand(
'\'test -f "%s"; echo $?\'' % (file_name))
- return int(status) == 0
+ if not status[0].find('test: not found'):
+ return int(status) == 0
+
+ status = self._adb.SendShellCommand('ls "%s"' % (file_name))
+ if 'No such file or directory' not in status[0]:
+ return True
+
+ return False
def RunMonkey(self, package_name, category=None, throttle=100, seed=None,
event_count=10000, verbosity=1, extra_args=''):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698