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

Unified Diff: build/android/screenshot.py

Issue 1132993004: [Android] Remove more references to and uses of AndroidCommands. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/pylib/android_commands.py ('k') | chrome/test/chromedriver/test/run_py_tests.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/screenshot.py
diff --git a/build/android/screenshot.py b/build/android/screenshot.py
index c48a2553fbd0f6ffe967d61bb611b1b1c3559f06..097739fb62deb0667141e2fe16e9533f678757b0 100755
--- a/build/android/screenshot.py
+++ b/build/android/screenshot.py
@@ -74,8 +74,11 @@ def main():
logging.getLogger().setLevel(logging.DEBUG)
devices = device_utils.DeviceUtils.HealthyDevices()
-
- if not options.device:
+ if options.device:
+ device = next((d for d in devices if d == options.device), None)
+ if not device:
+ raise device_errors.DeviceUnreachableError(options.device)
+ else:
if len(devices) > 1:
parser.error('Multiple devices are attached. '
'Please specify device serial number with --device.')
@@ -83,8 +86,6 @@ def main():
device = devices[0]
else:
raise device_errors.NoDevicesError()
- else:
- device = device_utils.DeviceUtils(options.device)
if options.video:
_CaptureVideo(device, host_file, options)
« no previous file with comments | « build/android/pylib/android_commands.py ('k') | chrome/test/chromedriver/test/run_py_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698