Make webrtc_perf_tests output an empty result output.json

to satisfy a stricter check introduced in
https://chromium.googlesource.com/chromium/tools/build/+/503174a3e1e439c6ab0b18d263980fd18a3d2855

The file is supposed to contain actual gtest results, so having an
empty one is a workaround, but this just returns things to the way
they were.

TBR: phoglund@webrtc.org
No-Try: True
Bug: webrtc:9767, chromium:885194
Change-Id: I693cc2df9dfcafd7b728deb9efd445d8fe2c4edf
Reviewed-on: https://webrtc-review.googlesource.com/101301
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Reviewed-by: Yves Gerey <yvesg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24783}
diff --git a/test/test_main.cc b/test/test_main.cc
index 46a7de6..8091b3f 100644
--- a/test/test_main.cc
+++ b/test/test_main.cc
@@ -8,6 +8,8 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
+#include <fstream>
+
 #include "rtc_base/flags.h"
 #include "rtc_base/logging.h"
 #include "rtc_base/thread.h"
@@ -38,9 +40,10 @@
 
 #else
 
-DEFINE_string(isolated_script_test_output,
-              "",
-              "Intentionally ignored flag intended for Chromium.");
+DEFINE_string(
+    isolated_script_test_output,
+    "",
+    "Path to output an empty JSON file which Chromium infra requires.");
 
 DEFINE_string(
     isolated_script_test_perf_output,
@@ -112,6 +115,13 @@
     webrtc::test::WritePerfResults(chartjson_result_file);
   }
 
+  std::string result_filename = FLAG_isolated_script_test_output;
+  if (!result_filename.empty()) {
+    std::ofstream result_file(result_filename);
+    result_file << "{\"version\": 3}";
+    result_file.close();
+  }
+
   return exit_code;
 
 #endif