toolchain_utils: chrome_src flag for buildbot_test_toolchains

At present, buildbot_test_toolchains always uses the chroot's
chrome checkout for running telemetry tests. This CL allows
callers to change that behaviour with the --chrome_src
flag.

BUG=b:255191595
TEST=./run_tests.py
TEST=Ran on chrotomation with --chrome_src=doesntexist

Change-Id: I7099b13882b72aabf0a4988fec20b90ee80a873f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4201149
Tested-by: Jordan Abrahams-Whitehead <ajordanr@google.com>
Reviewed-by: George Burgess <gbiv@chromium.org>
Commit-Queue: Jordan Abrahams-Whitehead <ajordanr@google.com>
diff --git a/buildbot_test_toolchains.py b/buildbot_test_toolchains.py
index e847af4..e67a151 100755
--- a/buildbot_test_toolchains.py
+++ b/buildbot_test_toolchains.py
@@ -84,10 +84,12 @@
         recipe=False,
         test=False,
         noschedv2=False,
+        chrome_src="",
     ):
         self._board = board
         self._remotes = remotes
         self._chromeos_root = chromeos_root
+        self._chrome_src = chrome_src
         self._base_dir = os.getcwd()
         self._ce = command_executer.GetCommandExecuter()
         self._l = logger.GetLogger()
@@ -189,11 +191,13 @@
             official_image = """
       vanilla_image {
         chromeos_root: %s
+        chrome_src: %s
         build: %s
         compiler: llvm
       }
       """ % (
                 self._chromeos_root,
+                self._chrome_src,
                 vanilla_image,
             )
             f.write(official_image)
@@ -207,6 +211,7 @@
             experiment_image = """
       %s {
         chromeos_root: %s
+        chrome_src: %s
         build: %s
         autotest_path: %s
         compiler: %s
@@ -214,6 +219,7 @@
       """ % (
                 label_string,
                 self._chromeos_root,
+                self._chrome_src,
                 trybot_image,
                 autotest_files,
                 compiler_string,
@@ -337,6 +343,14 @@
         help="The chromeos root from which to run tests.",
     )
     parser.add_argument(
+        "--chrome_src",
+        dest="chrome_src",
+        default="",
+        help="The path to the source of chrome. "
+        "This is used to run telemetry benchmarks. "
+        "The default one is the src inside chroot.",
+    )
+    parser.add_argument(
         "--weekday",
         default="",
         dest="weekday",
@@ -397,6 +411,7 @@
         options.recipe,
         options.test,
         options.noschedv2,
+        chrome_src=options.chrome_src,
     )
     return fc.DoAll()