[go: nahoru, domu]

[lacros] Download and isolate ash-chrome on bots

Tests on CI/CQ bots should be hermetic, so download the and isolate
ash-chrome at build time instead of test time.

Bug: 1104318
Change-Id: Ia967cbc6fef205d30ec093ea4bfaadcc0eb46d62
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2307646
Commit-Queue: Yuke Liao <liaoyuke@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Erik Chen <erikchen@chromium.org>
Reviewed-by: Sven Zheng <svenzheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#790606}
diff --git a/testing/test.gni b/testing/test.gni
index 9d90ab3..678289b 100644
--- a/testing/test.gni
+++ b/testing/test.gni
@@ -43,6 +43,7 @@
 #   use_raw_android_executable: Use executable() rather than android_apk().
 #   use_native_activity: Test implements ANativeActivity_onCreate().
 #   win_test_enable_cfi_linker: (Win) Enable CFI linker for this test binary.
+#   use_ash_chrome: Use ash-chrome to run tests, only applicable to lacros.
 template("test") {
   if (is_android) {
     _use_raw_android_executable = defined(invoker.use_raw_android_executable) &&
@@ -393,10 +394,15 @@
 
       executable_args = [
         "@WrappedPath(../../build/lacros/test_runner.py)",
+        "test",
         "@WrappedPath(./${_executable})",
         "--test-launcher-bot-mode",
       ]
 
+      if (defined(invoker.use_ash_chrome) && invoker.use_ash_chrome) {
+        executable_args += [ "--ash-chrome-version=for_bots" ]
+      }
+
       if (is_asan) {
         executable_args += [ "--asan=true" ]
       }
@@ -411,9 +417,13 @@
       }
 
       data = [
+        "//build/lacros/test_runner.py",
         "//testing/test_env.py",
         "//.vpython",
       ]
+      if (defined(invoker.use_ash_chrome) && invoker.use_ash_chrome) {
+        data += [ "//build/lacros/prebuilt_ash_chrome/for_bots" ]
+      }
     }
 
     executable(target_name) {