Add remaining GN targets for the Linux gpu tests.

This patch adds support for the telemetry-based
gpu tests to the GN build, adds a stubbed out
target for angle_end2end_tests (full support
depends on angle GN fixes), and adds a dummy
'chromium_swarm_tests' build target.

With these fixes, it should be possible to flip the
linux_chromium_rel_ng bot to GN and still have
everything run.

[email protected], [email protected]
BUG=519778

Review URL: https://codereview.chromium.org/1311913004

Cr-Commit-Position: refs/heads/master@{#346067}
diff --git a/tools/mb/mb.py b/tools/mb/mb.py
index 94400be..f1a223e 100755
--- a/tools/mb/mb.py
+++ b/tools/mb/mb.py
@@ -363,6 +363,12 @@
     for target in swarming_targets:
       if gn_isolate_map[target]['type'] == 'gpu_browser_test':
         runtime_deps_target = 'browser_tests'
+      elif gn_isolate_map[target]['type'] == 'script':
+        # For script targets, the build target is usually a group,
+        # for which gn generates the runtime_deps next to the stamp file
+        # for the label, which lives under the obj/ directory.
+        label = gn_isolate_map[target]['label']
+        runtime_deps_target = 'obj/%s.stamp' % label.replace(':', '/')
       else:
         runtime_deps_target = target
       if sys.platform == 'win32':
@@ -568,12 +574,19 @@
       gtest_filter = gn_isolate_map[target]['gtest_filter']
       cmdline = [
           '../../testing/test_env.py',
-          'browser_tests<(EXECUTABLE_SUFFIX)',
+          './browser_tests' + executable_suffix,
           '--test-launcher-bot-mode',
           '--enable-gpu',
           '--test-launcher-jobs=1',
           '--gtest_filter=%s' % gtest_filter,
       ]
+    elif test_type == 'script':
+      extra_files = [
+          '../../testing/test_env.py'
+      ]
+      cmdline = [
+          '../../testing/test_env.py',
+      ] + ['../../' + self.ToSrcRelPath(gn_isolate_map[target]['script'])]
     elif test_type in ('raw'):
       extra_files = []
       cmdline = [