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

Unified Diff: webrtc/examples/androidtests/video_quality_loopback_test.py

Issue 2937123002: Use information about blacklisted devices in video_quality_loopback_test (Closed)
Patch Set: Warning only on chrome infra Created 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/examples/androidtests/video_quality_loopback_test.py
diff --git a/webrtc/examples/androidtests/video_quality_loopback_test.py b/webrtc/examples/androidtests/video_quality_loopback_test.py
index e8c4381f1f94fff230e8acc26c1ab92b59cbe363..aa0d8a92b781299a7d9b8a9888790cbf72ce0b75 100755
--- a/webrtc/examples/androidtests/video_quality_loopback_test.py
+++ b/webrtc/examples/androidtests/video_quality_loopback_test.py
@@ -19,6 +19,7 @@ It assumes you have a Android device plugged in.
"""
import argparse
+import json
import logging
import os
import shutil
@@ -31,6 +32,9 @@ import time
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
SRC_DIR = os.path.normpath(os.path.join(SCRIPT_DIR, os.pardir, os.pardir,
os.pardir))
+BAD_DEVICES_JSON = os.path.join(SRC_DIR,
+ os.environ.get('CHROMIUM_OUT_DIR', 'out'),
+ 'bad_devices.json')
class Error(Exception):
@@ -109,10 +113,19 @@ def main():
_RunCommand([sys.executable, setup_apprtc_script, temp_dir])
# Select an Android device in case multiple are connected
+ try:
+ with open(BAD_DEVICES_JSON) as bad_devices_file:
+ bad_devices = json.load(bad_devices_file)
+ except IOError:
+ if os.environ.get('CHROME_HEADLESS'):
+ logging.warning('Cannot read %r', BAD_DEVICES_JSON)
+ bad_devices = {}
+
for line in _RunCommandWithOutput([adb_path, 'devices']).splitlines():
if line.endswith('\tdevice'):
android_device = line.split('\t')[0]
- break
+ if android_device not in bad_devices:
+ break
else:
raise VideoQualityTestError('Cannot find any connected Android device.')
« 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