Switch --is-asan exceptions to magic substitutions

Changes the --is-asan additions in test_suite_exceptions.pyl to magic
substitutions in the suite definitions for GPU WebGL and context loss
tests. This should prevent future cases of failures being introduced
because an exception failed to be added.

Also drive-by fixes some M1 expectations that had no-asan specified,
which is redundant since we don't run ASAN tests on M1 machines.

Bug: 1272114
Change-Id: I39ededf6eff81bce45b646c9117fc3cbffbe576f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3292447
Commit-Queue: Brian Sheedy <[email protected]>
Auto-Submit: Brian Sheedy <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
Cr-Commit-Position: refs/heads/main@{#944763}
diff --git a/testing/buildbot/generate_buildbot_json.py b/testing/buildbot/generate_buildbot_json.py
index b5f65b5f..b0b865d 100755
--- a/testing/buildbot/generate_buildbot_json.py
+++ b/testing/buildbot/generate_buildbot_json.py
@@ -501,7 +501,7 @@
     arr = self.merge_command_line_args(arr, '--test-launcher-filter-file=', ';')
     return arr
 
-  def substitute_magic_args(self, test_config):
+  def substitute_magic_args(self, test_config, tester_name):
     """Substitutes any magic substitution args present in |test_config|.
 
     Substitutions are done in-place.
@@ -512,6 +512,8 @@
     Args:
       test_config: A dict containing a configuration for a specific test on
           a specific builder, e.g. the output of update_and_cleanup_test.
+      tester_name: A string containing the name of the tester that |test_config|
+          came from.
     """
     substituted_array = []
     for arg in test_config.get('args', []):
@@ -520,7 +522,7 @@
             magic_substitutions.MAGIC_SUBSTITUTION_PREFIX, '')
         if hasattr(magic_substitutions, function):
           substituted_array.extend(
-              getattr(magic_substitutions, function)(test_config))
+              getattr(magic_substitutions, function)(test_config, tester_name))
         else:
           raise BBGenErr(
               'Magic substitution function %s does not exist' % function)
@@ -793,7 +795,7 @@
     result = self.update_and_cleanup_test(
         result, test_name, tester_name, tester_config, waterfall)
     self.add_common_test_properties(result, tester_config)
-    self.substitute_magic_args(result)
+    self.substitute_magic_args(result, tester_name)
 
     if not result.get('merge'):
       # TODO(https://crbug.com/958376): Consider adding the ability to not have
@@ -829,7 +831,7 @@
     result = self.update_and_cleanup_test(
         result, test_name, tester_name, tester_config, waterfall)
     self.add_common_test_properties(result, tester_config)
-    self.substitute_magic_args(result)
+    self.substitute_magic_args(result, tester_name)
 
     if not result.get('merge'):
       # TODO(https://crbug.com/958376): Consider adding the ability to not have
@@ -857,7 +859,7 @@
     }
     result = self.update_and_cleanup_test(
         result, test_name, tester_name, tester_config, waterfall)
-    self.substitute_magic_args(result)
+    self.substitute_magic_args(result, tester_name)
     return result
 
   def generate_junit_test(self, waterfall, tester_name, tester_config,
@@ -873,7 +875,7 @@
     self.initialize_args_for_test(result, tester_config)
     result = self.update_and_cleanup_test(
         result, test_name, tester_name, tester_config, waterfall)
-    self.substitute_magic_args(result)
+    self.substitute_magic_args(result, tester_name)
     return result
 
   def generate_skylab_test(self, waterfall, tester_name, tester_config,
@@ -888,7 +890,7 @@
     self.initialize_args_for_test(result, tester_config)
     result = self.update_and_cleanup_test(result, test_name, tester_name,
                                           tester_config, waterfall)
-    self.substitute_magic_args(result)
+    self.substitute_magic_args(result, tester_name)
     return result
 
   def substitute_gpu_args(self, tester_config, swarming_config, args):