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}
diff --git a/tools_webrtc/mb/mb.py b/tools_webrtc/mb/mb.py
index 0291066..e888367 100755
--- a/tools_webrtc/mb/mb.py
+++ b/tools_webrtc/mb/mb.py
@@ -844,18 +844,20 @@
     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']: