Dump json output for webrtc tests using gtest_parallel.

This is required step in order to upload tests results to ResultDB.

Bug: b/197492097
Change-Id: Ifff898997f6c9a3385659be34e7545217bb08f88
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238000
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Reviewed-by: Christoffer Jansson <jansson@google.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35385}
diff --git a/tools_webrtc/mb/mb.py b/tools_webrtc/mb/mb.py
index e8d2d63..bed28e3 100755
--- a/tools_webrtc/mb/mb.py
+++ b/tools_webrtc/mb/mb.py
@@ -947,10 +947,12 @@
                 ]
                 sep = '\\' if self.platform == 'win32' else '/'
                 output_dir = '${ISOLATED_OUTDIR}' + sep + 'test_logs'
+                test_results = '${ISOLATED_OUTDIR}' + sep + 'gtest_output.json'
                 timeout = isolate_map[target].get('timeout', 900)
                 cmdline += [
                     '../../tools_webrtc/gtest-parallel-wrapper.py',
                     '--output_dir=%s' % output_dir,
+                    '--dump_json_test_results=%s' % test_results,
                     '--gtest_color=no',
                     # We tell gtest-parallel to interrupt the test after 900
                     # seconds, so it can exit cleanly and report results,
diff --git a/tools_webrtc/mb/mb_unittest.py b/tools_webrtc/mb/mb_unittest.py
index fc359d9..2f0a619 100755
--- a/tools_webrtc/mb/mb_unittest.py
+++ b/tools_webrtc/mb/mb_unittest.py
@@ -411,6 +411,7 @@
         '../../testing/test_env.py',
         '../../tools_webrtc/gtest-parallel-wrapper.py',
         '--output_dir=${ISOLATED_OUTDIR}/test_logs',
+        '--dump_json_test_results=${ISOLATED_OUTDIR}/gtest_output.json',
         '--gtest_color=no',
         '--timeout=500',
         '--workers=1',
@@ -533,6 +534,7 @@
         '../../testing/test_env.py',
         '../../tools_webrtc/gtest-parallel-wrapper.py',
         '--output_dir=${ISOLATED_OUTDIR}/test_logs',
+        '--dump_json_test_results=${ISOLATED_OUTDIR}/gtest_output.json',
         '--gtest_color=no',
         '--timeout=900',
         '--workers=1',
@@ -583,6 +585,7 @@
         '../../testing/xvfb.py',
         '../../tools_webrtc/gtest-parallel-wrapper.py',
         '--output_dir=${ISOLATED_OUTDIR}/test_logs',
+        '--dump_json_test_results=${ISOLATED_OUTDIR}/gtest_output.json',
         '--gtest_color=no',
         '--timeout=900',
         '--retry_failed=3',
@@ -634,6 +637,7 @@
         '../../testing/test_env.py',
         '../../tools_webrtc/gtest-parallel-wrapper.py',
         '--output_dir=${ISOLATED_OUTDIR}\\test_logs',
+        '--dump_json_test_results=${ISOLATED_OUTDIR}\\gtest_output.json',
         '--gtest_color=no',
         '--timeout=900',
         '--retry_failed=3',
@@ -680,6 +684,7 @@
         '../../testing/test_env.py',
         '../../tools_webrtc/gtest-parallel-wrapper.py',
         '--output_dir=${ISOLATED_OUTDIR}/test_logs',
+        '--dump_json_test_results=${ISOLATED_OUTDIR}/gtest_output.json',
         '--gtest_color=no',
         '--timeout=900',
         '--retry_failed=3',
@@ -731,6 +736,7 @@
         '../../testing/test_env.py',
         '../../tools_webrtc/gtest-parallel-wrapper.py',
         '--output_dir=${ISOLATED_OUTDIR}/test_logs',
+        '--dump_json_test_results=${ISOLATED_OUTDIR}/gtest_output.json',
         '--gtest_color=no',
         '--timeout=900',
         '--retry_failed=3',