add parameter to invoke escalate sanitizer warnings.

For some sanitizer bots, we would like to post process the stdout
logs to scan for sanitizer warnings. these warnings do not cause tests
to fail, but are valid issues that should be investigated and so for
some builders they should cause tests and thus steps to fail.

Bug: 1442587
Change-Id: I6e3be1e66a2cb3da6fb1b98b0ee8724d0f780cfb
Validate-Test-Flakiness: skip
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4485037
Reviewed-by: Erik Staab <[email protected]>
Reviewed-by: Ben Pastene <[email protected]>
Commit-Queue: Ian Struiksma <[email protected]>
Reviewed-by: Alexander Potapenko <[email protected]>
Reviewed-by: Jonathan Metzman <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1148281}
diff --git a/testing/test.gni b/testing/test.gni
index a0d5e1ad..f67f2886 100644
--- a/testing/test.gni
+++ b/testing/test.gni
@@ -938,6 +938,9 @@
       if (use_cfi_diag) {
         executable_args += [ "--cfi-diag=1" ]
       }
+      if (fail_on_san_warnings) {
+        executable_args += [ "--fail-san=1" ]
+      }
 
       data += [ "//build/lacros/test_runner.py" ]
 
@@ -1016,6 +1019,9 @@
       if (use_cfi_diag) {
         executable_args += [ "--cfi-diag=1" ]
       }
+      if (fail_on_san_warnings) {
+        executable_args += [ "--fail-san=1" ]
+      }
 
       if (use_rts) {
         data_deps += [ ":${invoker.target_name}__rts_filters" ]