Add support for launching webcam software for use in recipes

* Copy ensure_webcam_is_running.py from recipes repo
* Turn it into a wrapper that can launch another script
  (fix_python_path is copied from test_env.py as _ForcePythonInterpreter)
* Support it in mb.py
* Add it to video_capture_unittests

No-Try: True
Bug: chromium:755660
Change-Id: I376724a77e443620724add7818592e9368d02079
Reviewed-on: https://webrtc-review.googlesource.com/77320
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23275}
This commit is contained in:
Oleh Prypin
2018-05-17 12:15:25 +02:00
committed by Commit Bot
parent d5addcaf1e
commit cd469a4ce5
4 changed files with 183 additions and 6 deletions

View File

@ -844,18 +844,20 @@ class MetaBuildWrapper(object):
else:
extra_files = ['../../testing/test_env.py']
if isolate_map[target].get('use_webcam', False):
cmdline.append('../../tools_webrtc/ensure_webcam_is_running.py')
extra_files.append('../../tools_webrtc/ensure_webcam_is_running.py')
# This needs to mirror the settings in //build/config/ui.gni:
# use_x11 = is_linux && !use_ozone.
use_x11 = is_linux and not 'use_ozone=true' in vals['gn_args']
xvfb = use_x11 and test_type == 'windowed_test_launcher'
if xvfb:
extra_files += [
'../../testing/xvfb.py',
]
cmdline = (['../../testing/xvfb.py'] if xvfb else
['../../testing/test_env.py'])
cmdline.append('../../testing/xvfb.py')
extra_files.append('../../testing/xvfb.py')
else:
cmdline.append('../../testing/test_env.py')
# Memcheck is only supported for linux. Ignore in other platforms.
if is_linux and 'rtc_use_memcheck=true' in vals['gn_args']: