diff options
Diffstat (limited to 'chromium/third_party/blink/tools/blinkpy/web_tests/port')
4 files changed, 45 insertions, 18 deletions
diff --git a/chromium/third_party/blink/tools/blinkpy/web_tests/port/base.py b/chromium/third_party/blink/tools/blinkpy/web_tests/port/base.py index 968194c31c4..b5686e9d558 100644 --- a/chromium/third_party/blink/tools/blinkpy/web_tests/port/base.py +++ b/chromium/third_party/blink/tools/blinkpy/web_tests/port/base.py @@ -147,6 +147,8 @@ class Port(object): ('mac10.15', 'x86'), ('mac11', 'x86'), ('mac11-arm64', 'arm64'), + ('mac12', 'x86_64'), + ('mac12-arm64', 'arm64'), ('win7', 'x86'), ('win10.20h2', 'x86'), ('trusty', 'x86_64'), @@ -156,7 +158,7 @@ class Port(object): CONFIGURATION_SPECIFIER_MACROS = { 'mac': [ 'mac10.12', 'mac10.13', 'mac10.14', 'mac10.15', 'mac11', - 'mac11-arm64' + 'mac11-arm64', 'mac12', 'mac12-arm64' ], 'win': ['win7', 'win10.20h2'], 'linux': ['trusty'], diff --git a/chromium/third_party/blink/tools/blinkpy/web_tests/port/mac.py b/chromium/third_party/blink/tools/blinkpy/web_tests/port/mac.py index 624aaaea233..401a442b582 100644 --- a/chromium/third_party/blink/tools/blinkpy/web_tests/port/mac.py +++ b/chromium/third_party/blink/tools/blinkpy/web_tests/port/mac.py @@ -36,12 +36,15 @@ _log = logging.getLogger(__name__) class MacPort(base.Port): SUPPORTED_VERSIONS = ('mac10.12', 'mac10.13', 'mac10.14', 'mac10.15', - 'mac11', 'mac11-arm64') + 'mac11', 'mac11-arm64', 'mac12', 'mac12-arm64') port_name = 'mac' FALLBACK_PATHS = {} - FALLBACK_PATHS['mac11'] = ['mac'] + FALLBACK_PATHS['mac12'] = ['mac'] + FALLBACK_PATHS['mac12-arm64'] = ['mac-mac12-arm64' + ] + FALLBACK_PATHS['mac12'] + FALLBACK_PATHS['mac11'] = ['mac-mac11'] + FALLBACK_PATHS['mac12'] FALLBACK_PATHS['mac11-arm64'] = ['mac-mac11-arm64' ] + FALLBACK_PATHS['mac11'] FALLBACK_PATHS['mac10.15'] = ['mac-mac10.15'] + FALLBACK_PATHS['mac11'] @@ -56,17 +59,11 @@ class MacPort(base.Port): @classmethod def determine_full_port_name(cls, host, options, port_name): if port_name.endswith('mac'): - # TODO(crbug.com/1253659): verify this under native arm. - if (host.platform.get_machine() == 'arm64' - or host.platform.is_running_rosetta()): - # TODO(crbug.com/1197679): When running under py3, change this - # to `version = host.platform.os_version + '-arm64'`. This - # must be done before macOS 12 capability for this script. - version = 'mac11-arm64' + parts = [port_name] # TODO(crbug.com/1114885): This is to workaround the failure of # blink_python_tests on mac10.10 and 10.11 waterfall bots. Remove this # when we remove the step from the bots. - elif (host.platform.os_version == 'mac10.10' + if (host.platform.os_version == 'mac10.10' or host.platform.os_version == 'mac10.11'): version = 'mac10.12' # TODO(crbug.com/1126062): Workaround for Big sur using 10.16 version, @@ -76,7 +73,15 @@ class MacPort(base.Port): version = 'mac11' else: version = host.platform.os_version - return port_name + '-' + version + parts.append(version) + # Maybe add an architecture suffix. + # In this context, 'arm64' refers to Apple M1. + # No suffix is appended for Intel-based ports. + if (host.platform.get_machine() == 'arm64' + or host.platform.is_running_rosetta()): + # TODO(crbug.com/1253659): verify this under native arm. + parts.append('arm64') + return '-'.join(parts) return port_name def __init__(self, host, port_name, **kwargs): diff --git a/chromium/third_party/blink/tools/blinkpy/web_tests/port/mac_unittest.py b/chromium/third_party/blink/tools/blinkpy/web_tests/port/mac_unittest.py index c99069f6b7f..d754896c303 100644 --- a/chromium/third_party/blink/tools/blinkpy/web_tests/port/mac_unittest.py +++ b/chromium/third_party/blink/tools/blinkpy/web_tests/port/mac_unittest.py @@ -39,9 +39,11 @@ class MacPortTest(port_testcase.PortTestCase): full_port_name = 'mac-mac10.12' port_maker = mac.MacPort - def assert_name(self, port_name, os_version_string, expected): - port = self.make_port( - os_version=os_version_string, port_name=port_name) + def assert_name(self, port_name, os_version_string, expected, + machine=None): + port = self.make_port(os_version=os_version_string, + port_name=port_name, + machine=machine) self.assertEqual(expected, port.name()) def test_operating_system(self): @@ -52,6 +54,21 @@ class MacPortTest(port_testcase.PortTestCase): self.assertEqual(port.get_platform_tags(), {'mac', 'mac10.12', 'x86', 'release'}) + def test_versions(self): + # Workarounds where we need to bump up the version. + self.assert_name(None, 'mac10.16', 'mac-mac11') + self.assert_name('mac', 'mac10.16', 'mac-mac11') + + self.assert_name(None, 'mac11', 'mac-mac11') + self.assert_name(None, 'mac12', 'mac-mac12') + self.assert_name('mac', 'mac11', 'mac-mac11') + self.assert_name('mac', 'mac12', 'mac-mac12') + + self.assert_name(None, 'mac11', 'mac-mac11-arm64', 'arm64') + self.assert_name(None, 'mac12', 'mac-mac12-arm64', 'arm64') + self.assert_name('mac', 'mac11', 'mac-mac11-arm64', 'arm64') + self.assert_name('mac', 'mac12', 'mac-mac12-arm64', 'arm64') + def test_driver_name_option(self): self.assertTrue( self.make_port()._path_to_driver().endswith('Content Shell')) diff --git a/chromium/third_party/blink/tools/blinkpy/web_tests/port/port_testcase.py b/chromium/third_party/blink/tools/blinkpy/web_tests/port/port_testcase.py index 7b8cb1dbe85..3241aa76923 100644 --- a/chromium/third_party/blink/tools/blinkpy/web_tests/port/port_testcase.py +++ b/chromium/third_party/blink/tools/blinkpy/web_tests/port/port_testcase.py @@ -59,6 +59,7 @@ class PortTestCase(LoggingTestCase): # Subclasses override this to point to their Port subclass. os_name = None os_version = None + machine = None port_maker = Port port_name = None full_port_name = None @@ -69,10 +70,12 @@ class PortTestCase(LoggingTestCase): options=None, os_name=None, os_version=None, + machine=None, **kwargs): - host = host or MockSystemHost( - os_name=(os_name or self.os_name), - os_version=(os_version or self.os_version)) + host = host or MockSystemHost(os_name=(os_name or self.os_name), + os_version=(os_version + or self.os_version), + machine=(machine or self.machine)) options = options or optparse.Values({ 'configuration': 'Release', 'use_xvfb': True |