Require all swarming tests to specify an OS value

The recipe currently applies some very outdated defaults for the OS.
Requiring every test to specify their own OS would allow those defaults
to be deleted, as well as generally making test configs be more
declarative.

This was also tested on clank's and src-internal's testing specs, and
they all already set needed OS values.

Bug: 1203436
Change-Id: I4c2c7974634c5c4ab5819d6913e173b9e2913edb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4382515
Reviewed-by: Garrett Beaty <[email protected]>
Commit-Queue: Ben Pastene <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1124908}
diff --git a/testing/buildbot/generate_buildbot_json.py b/testing/buildbot/generate_buildbot_json.py
index aaa821a..4912a82 100755
--- a/testing/buildbot/generate_buildbot_json.py
+++ b/testing/buildbot/generate_buildbot_json.py
@@ -2047,17 +2047,19 @@
                                       step_data)
 
   def _check_swarming_config(self, filename, builder, step_name, step_data):
-    # TODO(crbug.com/1203436): Ensure all swarming tests specify os and cpu, not
+    # TODO(crbug.com/1203436): Ensure all swarming tests specify cpu, not
     # just mac tests.
-    if ('mac' in builder.lower()
-        and step_data['swarming']['can_use_on_swarming_builders']):
+    if step_data['swarming']['can_use_on_swarming_builders']:
       dimension_sets = step_data['swarming'].get('dimension_sets')
       if not dimension_sets:
-        raise BBGenErr('%s: %s / %s : os and cpu must be specified for mac '
+        raise BBGenErr('%s: %s / %s : os must be specified for all '
                        'swarmed tests' % (filename, builder, step_name))
       for s in dimension_sets:
-        if not s.get('os') or not s.get('cpu'):
-          raise BBGenErr('%s: %s / %s : os and cpu must be specified for mac '
+        if not s.get('os'):
+          raise BBGenErr('%s: %s / %s : os must be specified for all '
+                         'swarmed tests' % (filename, builder, step_name))
+        if 'Mac' in s.get('os') and not s.get('cpu'):
+          raise BBGenErr('%s: %s / %s : cpu must be specified for mac '
                          'swarmed tests' % (filename, builder, step_name))
 
   def check_consistency(self, verbose=False):