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

Unified Diff: build/android/screenshot.py

Issue 1281923003: [Android] Add --blacklist-file as a command-line option. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix telemetry_unittests Created 5 years, 4 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/utils/test_environment.py ('k') | build/android/test_runner.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 097739fb62deb0667141e2fe16e9533f678757b0..b52b70699502adabfeb3c8449f2d5382d22bf70a 100755
--- a/build/android/screenshot.py
+++ b/build/android/screenshot.py
@@ -12,6 +12,7 @@ import os
import sys
from pylib import screenshot
+from pylib.device import device_blacklist
from pylib.device import device_errors
from pylib.device import device_utils
@@ -47,6 +48,7 @@ def main():
usage='screenshot.py [options] [filename]')
parser.add_option('-d', '--device', metavar='ANDROID_DEVICE', help='Serial '
'number of Android device to use.', default=None)
+ parser.add_option('--blacklist-file', help='Device blacklist JSON file.')
parser.add_option('-f', '--file', help='Save result to file instead of '
'generating a timestamped file name.', metavar='FILE')
parser.add_option('-v', '--verbose', help='Verbose logging.',
@@ -73,7 +75,12 @@ def main():
if options.verbose:
logging.getLogger().setLevel(logging.DEBUG)
- devices = device_utils.DeviceUtils.HealthyDevices()
+ if options.blacklist_file:
+ blacklist = device_blacklist.Blacklist(options.blacklist_file)
+ else:
+ blacklist = None
+
+ devices = device_utils.DeviceUtils.HealthyDevices(blacklist)
if options.device:
device = next((d for d in devices if d == options.device), None)
if not device:
« no previous file with comments | « build/android/pylib/utils/test_environment.py ('k') | build/android/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698