[fuchsia] Add Cast Streaming tests type

Bug: 1330697
Change-Id: I41b88cc748594f89b685624bc6012c0d03fdf61b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3752070
Commit-Queue: Fabrice de Gans <[email protected]>
Reviewed-by: Hans Wennborg <[email protected]>
Reviewed-by: Chong Gu <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1031568}
diff --git a/testing/buildbot/generate_buildbot_json_unittest.py b/testing/buildbot/generate_buildbot_json_unittest.py
index af0195d..46ff340 100755
--- a/testing/buildbot/generate_buildbot_json_unittest.py
+++ b/testing/buildbot/generate_buildbot_json_unittest.py
@@ -435,6 +435,32 @@
 ]
 """
 
+FOO_GPU_TELEMETRY_TEST_WATERFALL_CAST_STREAMING = """\
+[
+  {
+    'project': 'chromium',
+    'bucket': 'ci',
+    'name': 'chromium.test',
+    'machines': {
+      'Fake Tester': {
+        'os_type': 'fuchsia',
+        'browser_config': 'not-a-real-browser',
+        'swarming': {
+          'dimension_sets': [
+            {
+              'kvm': '1',
+            },
+          ],
+        },
+        'test_suites': {
+          'cast_streaming_tests': 'composition_tests',
+        },
+      },
+    },
+  },
+]
+"""
+
 NVIDIA_GPU_TELEMETRY_TEST_WATERFALL = """\
 [
   {
@@ -1812,6 +1838,44 @@
 }
 """
 
+GPU_TELEMETRY_TEST_OUTPUT_CAST_STREAMING = """\
+{
+  "AAAAA1 AUTOGENERATED FILE DO NOT EDIT": {},
+  "AAAAA2 See generate_buildbot_json.py to make changes": {},
+  "Fake Tester": {
+    "cast_streaming_tests": [
+      {
+        "args": [
+          "foo",
+          "--show-stdout",
+          "--browser=cast-streaming-shell",
+          "--passthrough",
+          "-v",
+          "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc"
+        ],
+        "isolate_name": "telemetry_gpu_integration_test_fuchsia",
+        "merge": {
+          "args": [],
+          "script": "//testing/merge_scripts/standard_isolated_script_merge.py"
+        },
+        "name": "foo_tests",
+        "should_retry_with_patch": false,
+        "swarming": {
+          "can_use_on_swarming_builders": true,
+          "dimension_sets": [
+            {
+              "kvm": "1"
+            }
+          ],
+          "idempotent": false
+        },
+        "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test_fuchsia/"
+      }
+    ]
+  }
+}
+"""
+
 NVIDIA_GPU_TELEMETRY_TEST_OUTPUT = """\
 {
   "AAAAA1 AUTOGENERATED FILE DO NOT EDIT": {},
@@ -2505,6 +2569,15 @@
 }
 """
 
+GPU_TELEMETRY_GN_ISOLATE_MAP_CAST_STREAMING = """\
+{
+  'telemetry_gpu_integration_test_fuchsia': {
+    'label': '//chrome/test:telemetry_gpu_integration_test_fuchsia',
+    'type': 'script',
+      }
+}
+"""
+
 GN_ISOLATE_MAP_KEY_LABEL_MISMATCH="""\
 {
   'foo_test': {
@@ -2891,6 +2964,20 @@
     fbb.check_output_file_consistency(verbose=True)
     self.assertFalse(fbb.printed_lines)
 
+  def test_gpu_telemetry_tests_cast_streaming(self):
+    fbb = FakeBBGen(self.args,
+                    FOO_GPU_TELEMETRY_TEST_WATERFALL_CAST_STREAMING,
+                    COMPOSITION_SUITE_WITH_NAME_NOT_ENDING_IN_TEST,
+                    LUCI_MILO_CFG,
+                    exceptions=NO_BAR_TEST_EXCEPTIONS,
+                    gn_isolate_map=GPU_TELEMETRY_GN_ISOLATE_MAP_CAST_STREAMING)
+    self.create_testing_buildbot_json_file(
+        'chromium.test.json', GPU_TELEMETRY_TEST_OUTPUT_CAST_STREAMING)
+    self.create_testing_buildbot_json_file(
+        'chromium.ci.json', GPU_TELEMETRY_TEST_OUTPUT_CAST_STREAMING)
+    fbb.check_output_file_consistency(verbose=True)
+    self.assertFalse(fbb.printed_lines)
+
   def test_nvidia_gpu_telemetry_tests(self):
     fbb = FakeBBGen(self.args,
                     NVIDIA_GPU_TELEMETRY_TEST_WATERFALL,