Diff
Modified: trunk/Tools/ChangeLog (225855 => 225856)
--- trunk/Tools/ChangeLog 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/ChangeLog 2017-12-13 19:04:04 UTC (rev 225856)
@@ -1,3 +1,123 @@
+2017-12-13 Jonathan Bedard <[email protected]>
+
+ webkitpy: Better name-version mapping (Part 2)
+ https://bugs.webkit.org/show_bug.cgi?id=179621
+ <rdar://problem/35589585>
+
+ Reviewed by David Kilzer.
+
+ Now that we have a central mapping of version numbers to version names, this
+ mapping should be used to compute version names. This patch treats passes versions
+ as objects, only mapping them to names when strings are needed.
+
+ * Scripts/webkitpy/common/system/platforminfo.py:
+ (PlatformInfo.__init__): Store os_version as a version object instead of a string.
+ (PlatformInfo.os_version_name): Convert os_version to a string through the VersionNameMap.
+ * Scripts/webkitpy/common/system/platforminfo_mock.py:
+ (MockPlatformInfo.__init__): Store os_version as a version object.
+ (MockPlatformInfo.os_version_name): Mirror PlatformInfo.
+ * Scripts/webkitpy/common/system/platforminfo_unittest.py:
+ (TestPlatformInfo.test_real_code): Only Mac and Windows have defined version objects.
+ (TestPlatformInfo.test_os_version): Deleted, this behavior is now managed by VersionNameMap.
+ * Scripts/webkitpy/common/version.py:
+ (Version.__cmp__): Allow a version object to be compared with 'None'.
+ * Scripts/webkitpy/common/version_name_map.py:
+ (VersionNameMap.map): Check for the apple_additions VersionNameMap.
+ (VersionNameMap.__init__): Add a wincairo mapping, the same as the win mapping.
+ * Scripts/webkitpy/common/version_unittest.py:
+ (VersionTestCase.test_compare_versions): Test comparing a version object to 'None'.
+ * Scripts/webkitpy/layout_tests/models/test_configuration.py:
+ (TestConfiguration.__init__): Strip formatting from version name. Note that this object still
+ accepts a string because the version string implicitly contains the platform as well.
+ * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py: Win7 should be 7SP0 as
+ it is in the VersionNameMap.
+ * Scripts/webkitpy/port/apple.py:
+ (ApplePort): Replace VERSION_FALLBACK_ORDER with a minimum and maximum version. This is required
+ because it may be the case that scripts are aware of more versions than the port actually supports.
+ (ApplePort.determine_full_port_name): Use the host operating system to compute the full port name.
+ (ApplePort._allowed_versions): Return a list of valid port versions by iterating through the
+ VersionNameMap.
+ (ApplePort._generate_all_test_configurations): Compute a list of configurations by iterating through
+ _allowed_versions and converting each version to a string.
+ (ApplePort._apple_baseline_path): Return a layout test expectation directory inside apple_additions.
+ (ApplePort._skipped_file_search_paths): Deleted.
+ (ApplePort._allowed_port_names): Deleted.
+ (ApplePort._future_port_name): Deleted.
+ * Scripts/webkitpy/port/base.py:
+ (Port.__init__): Replace _version string with _os_version object.
+ (Port.version_name): Convert version object to string.
+ (Port.test_configuration): Pass version string to TestConfiguration.
+ (Port.version): Deleted.
+ * Scripts/webkitpy/port/darwin_testcase.py:
+ (DarwinTest.assert_name): Convert an os_version_string to a version object and construct a port.
+ * Scripts/webkitpy/port/factory_unittest.py:
+ (FactoryTest.test_mac): Replace version strings with version objects.
+ (FactoryTest.test_win): Ditto.
+ * Scripts/webkitpy/port/gtk.py:
+ (GtkPort._generate_all_test_configurations): Replace _version with version_name().
+ * Scripts/webkitpy/port/ios.py:
+ (IOSPort.version_name): Both Simulator and device share the same version-name convention.
+ (IOSPort._generate_all_test_configurations): Replace _version with version_name().
+ (IOSPort.default_baseline_search_path): Use the internal mapping of version names to construct
+ apple_additions expectations.
+ (IOSPort._apple_additions_path): Deleted.
+ * Scripts/webkitpy/port/ios_device.py:
+ (IOSDevicePort.ios_version): Return None if no version is defined.
+ * Scripts/webkitpy/port/ios_device_unittest.py:
+ (IOSDeviceTest):
+ (IOSDeviceTest.test_layout_test_searchpath_with_apple_additions): Conform with the new mock
+ apple_additions.
+ (IOSDeviceTest.make_port): Deleted.
+ * Scripts/webkitpy/port/ios_simulator.py:
+ (IOSSimulatorPort._create_devices): Use Version object over list of version strings.
+ * Scripts/webkitpy/port/ios_simulator_unittest.py:
+ (IOSSimulatorTest):
+ (IOSSimulatorTest.make_port): Use iOS 11 as the default version for testing.
+ (IOSSimulatorTest.test_layout_test_searchpath_with_apple_additions): Conform with the new
+ mock apple_additions.
+ * Scripts/webkitpy/port/ios_testcase.py:
+ (IOSTest.make_port): Use iOS 11 as the default version for testing.
+ * Scripts/webkitpy/port/mac.py:
+ (MacPort):
+ (MacPort.__init__): Use Version object for _os_version.
+ (MacPort.default_baseline_search_path): Use the internal mapping of version names to construct
+ apple_additions expectations.
+ (MacPort.configuration_specifier_macros): Automatically construct macros based on VersionNameMap.
+ (MacPort._apple_additions_path): Deleted.
+ * Scripts/webkitpy/port/mac_unittest.py:
+ (MacTest): Use Version object instead of version string.
+ (MacTest.test_version):
+ * Scripts/webkitpy/port/port_testcase.py:
+ (bind_mock_apple_additions): Add a mock VersionNameMap to mock apple_additions.
+ (bind_mock_apple_additions.MockAppleAdditions):
+ (bind_mock_apple_additions.MockAppleAdditions.version_name_mapping):
+ * Scripts/webkitpy/port/test.py:
+ (TestPort):
+ (TestPort.__init__): Use VersionNameMap to compute the correct Version from a port name.
+ (TestPort.version_name): Mirror Port object.
+ (TestPort.baseline_search_path): Replace win7 with 7sp0.
+ (TestPort._all_systems): Ditto.
+ (TestPort.configuration_specifier_macros): Ditto.
+ * Scripts/webkitpy/port/win.py:
+ (WinPort):
+ (WinPort.__init__): Construct Version object from port name.
+ (WinPort.default_baseline_search_path): Use the internal mapping of version names to construct
+ apple_additions expectations.
+ (WinCairoPort):
+ (WinCairoPort.default_baseline_search_path): Use MIN/MAX instead of the VERSION_FALLBACK_ORDER.
+ (WinCairoPort._future_port_name): Deleted.
+ * Scripts/webkitpy/port/win_unittest.py:
+ (WinPortTest.test_baseline_search_path): Add new Windows versions not previously included.
+ (WinPortTest._assert_version): Handle expected_version as a Version object.
+ (WinPortTest.test_versions): Pass Version objects instead of version strings.
+ * Scripts/webkitpy/port/wpe.py:
+ (WPEPort._generate_all_test_configurations): Replace _version with version_name().
+ * Scripts/webkitpy/tool/commands/queries_unittest.py:
+ (PrintExpectationsTest.test_multiple): Replace win7 with 7sp0.
+ (PrintBaselinesTest.test_multiple): Ditto.
+ * Scripts/webkitpy/tool/commands/queues.py:
+ (PatchProcessingQueue._new_port_name_from_old): Use os_version_name() instead of Version object.
+
2017-12-12 Daniel Bates <[email protected]>
[WK] Add modern WebKit SPI to set auto fill button type and query if the auto fill button is enabled
Modified: trunk/Tools/Scripts/webkitpy/common/system/platforminfo.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/common/system/platforminfo.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/common/system/platforminfo.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -31,7 +31,7 @@
import sys
from webkitpy.common.version import Version
-from webkitpy.common.version_name_map import VersionNameMap
+from webkitpy.common.version_name_map import PUBLIC_TABLE, VersionNameMap
from webkitpy.common.system.executive import Executive
@@ -54,25 +54,18 @@
self.os_name = self._determine_os_name(sys_module.platform)
self.os_version = None
+ self._is_cygwin = sys_module.platform == 'cygwin'
+
if self.os_name.startswith('mac'):
- version = Version.from_string(platform_module.mac_ver()[0])
+ self.os_version = Version.from_string(platform_module.mac_ver()[0])
elif self.os_name.startswith('win'):
- version = self._win_version()
+ self.os_version = self._win_version()
elif self.os_name == 'linux' or self.os_name == 'freebsd' or self.os_name == 'openbsd' or self.os_name == 'netbsd':
- version = None
+ return
else:
# Most other platforms (namely iOS) return conforming version strings.
- version = Version.from_string(platform_module.release())
+ self.os_version = Version.from_string(platform_module.release())
- self._is_cygwin = sys_module.platform == 'cygwin'
-
- if version is None:
- return
-
- self.os_version = VersionNameMap.map(self).to_name(version, table='public')
- assert self.os_version is not None
- self.os_version = self.os_version.lower().replace(' ', '')
-
def is_mac(self):
return self.os_name == 'mac'
@@ -110,6 +103,11 @@
# Windows-2008ServerR2-6.1.7600
return self._platform_module.platform()
+ def os_version_name(self, table=PUBLIC_TABLE):
+ if not self.os_version:
+ return None
+ return VersionNameMap.map(self).to_name(self.os_version, table=table)
+
def total_bytes_memory(self):
if self.is_mac():
return long(self._executive.run_command(["sysctl", "-n", "hw.memsize"]))
Modified: trunk/Tools/Scripts/webkitpy/common/system/platforminfo_mock.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/common/system/platforminfo_mock.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/common/system/platforminfo_mock.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -28,10 +28,12 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from webkitpy.common.version import Version
+from webkitpy.common.version_name_map import PUBLIC_TABLE, VersionNameMap
class MockPlatformInfo(object):
- def __init__(self, os_name='mac', os_version='snowleopard'):
+ def __init__(self, os_name='mac', os_version=Version.from_name('Snow Leopard')):
+ assert isinstance(os_version, Version)
self.os_name = os_name
self.os_version = os_version
self.expected_xcode_simctl_list = None
@@ -60,6 +62,11 @@
def display_name(self):
return "MockPlatform 1.0"
+ def os_version_name(self, table=PUBLIC_TABLE):
+ if not self.os_version:
+ return None
+ return VersionNameMap.map(self).to_name(self.os_version, table=table)
+
def total_bytes_memory(self):
return 3 * 1024 * 1024 * 1024 # 3GB is a reasonable amount of ram to mock.
Modified: trunk/Tools/Scripts/webkitpy/common/system/platforminfo_unittest.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/common/system/platforminfo_unittest.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/common/system/platforminfo_unittest.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -77,7 +77,8 @@
# This test makes sure the real (unmocked) code actually works.
info = PlatformInfo(sys, platform, Executive())
self.assertNotEquals(info.os_name, '')
- self.assertNotEquals(info.os_version, '')
+ if info.is_mac() or info.is_win():
+ self.assertIsNotNone(info.os_version)
self.assertNotEquals(info.display_name(), '')
self.assertTrue(info.is_mac() or info.is_win() or info.is_linux() or info.is_freebsd())
self.assertIsNotNone(info.terminal_width())
@@ -132,37 +133,6 @@
self.assertRaises(AssertionError, self.make_info, fake_sys('vms'))
- def test_os_version(self):
- self.assertRaises(AssertionError, self.make_info, fake_sys('darwin'), fake_platform('10.4.3'))
- self.assertEqual(self.make_info(fake_sys('darwin'), fake_platform('10.5.1')).os_version, 'leopard')
- self.assertEqual(self.make_info(fake_sys('darwin'), fake_platform('10.6.1')).os_version, 'snowleopard')
- self.assertEqual(self.make_info(fake_sys('darwin'), fake_platform('10.7.1')).os_version, 'lion')
- self.assertEqual(self.make_info(fake_sys('darwin'), fake_platform('10.8.1')).os_version, 'mountainlion')
- self.assertEqual(self.make_info(fake_sys('darwin'), fake_platform('10.9.0')).os_version, 'mavericks')
- self.assertEqual(self.make_info(fake_sys('darwin'), fake_platform('10.10.0')).os_version, 'yosemite')
- self.assertEqual(self.make_info(fake_sys('darwin'), fake_platform('10.11.0')).os_version, 'elcapitan')
- self.assertEqual(self.make_info(fake_sys('darwin'), fake_platform('10.12.0')).os_version, 'sierra')
- self.assertEqual(self.make_info(fake_sys('darwin'), fake_platform('10.13.0')).os_version, 'highsierra')
- self.assertEqual(self.make_info(fake_sys('darwin'), fake_platform('10.14.0')).os_version, 'future')
-
- self.assertEqual(self.make_info(fake_sys('linux2'), fake_platform('', '10.4')).os_version, None)
-
- self.assertEqual(self.make_info(fake_sys('freebsd8'), fake_platform('', '8.3-PRERELEASE')).os_version, None)
- self.assertEqual(self.make_info(fake_sys('freebsd9'), fake_platform('', '9.0-RELEASE')).os_version, None)
-
- self.assertRaises(AssertionError, self.make_info, fake_sys('win32'), fake_platform(win_version_string='5.0.1234'))
- self.assertEqual(self.make_info(fake_sys('win32'), fake_platform(win_version_string='10.0.14393')).os_version, 'win10')
- self.assertEqual(self.make_info(fake_sys('win32'), fake_platform(win_version_string='6.2.1234')).os_version, '8')
- self.assertEqual(self.make_info(fake_sys('win32'), fake_platform(win_version_string='6.1.7600')).os_version, '7sp0')
- self.assertEqual(self.make_info(fake_sys('win32'), fake_platform(win_version_string='6.0.1234')).os_version, 'vista')
- self.assertEqual(self.make_info(fake_sys('win32'), fake_platform(win_version_string='5.1.1234')).os_version, 'xp')
-
- self.assertRaises(AssertionError, self.make_info, fake_sys('win32'), executive=fake_executive('5.0.1234'))
- self.assertEqual(self.make_info(fake_sys('cygwin'), executive=fake_executive('6.2.1234')).os_version, '8')
- self.assertEqual(self.make_info(fake_sys('cygwin'), executive=fake_executive('6.1.7600')).os_version, '7sp0')
- self.assertEqual(self.make_info(fake_sys('cygwin'), executive=fake_executive('6.0.1234')).os_version, 'vista')
- self.assertEqual(self.make_info(fake_sys('cygwin'), executive=fake_executive('5.1.1234')).os_version, 'xp')
-
def test_display_name(self):
info = self.make_info(fake_sys('darwin'))
self.assertNotEquals(info.display_name(), '')
Modified: trunk/Tools/Scripts/webkitpy/common/version.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/common/version.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/common/version.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -37,6 +37,11 @@
result[i] = int(val[i])
return result
+ @staticmethod
+ def from_name(name):
+ from version_name_map import VersionNameMap
+ return VersionNameMap.map().from_name(name)[1]
+
def __init__(self, major=0, minor=0, tiny=0, micro=0, nano=0):
self.major = int(major)
self.minor = int(minor)
@@ -111,6 +116,8 @@
return result
def __cmp__(self, other):
+ if other is None:
+ return 1
for i in xrange(len(self)):
if cmp(self[i], other[i]):
return cmp(self[i], other[i])
Modified: trunk/Tools/Scripts/webkitpy/common/version_name_map.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/common/version_name_map.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/common/version_name_map.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -35,6 +35,9 @@
@staticmethod
@memoized
def map(platform=None):
+ from webkitpy.port.config import apple_additions
+ if apple_additions():
+ return apple_additions().version_name_mapping(platform)
return VersionNameMap(platform=platform)
def __init__(self, platform=None):
@@ -72,6 +75,9 @@
'linux': {},
}
+ # wincairo uses the same versions as Windows
+ self.mapping[PUBLIC_TABLE]['wincairo'] = self.mapping[PUBLIC_TABLE]['win']
+
@classmethod
def _automap_to_major_version(cls, prefix, minimum=Version(1), maximum=Version(1)):
result = {}
Modified: trunk/Tools/Scripts/webkitpy/common/version_unittest.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/common/version_unittest.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/common/version_unittest.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -130,3 +130,4 @@
self.assertGreater(Version(1, 2, 4), Version(1, 2, 3))
self.assertGreater(Version(1, 3, 2), Version(1, 2, 3))
self.assertGreater(Version(2, 1, 1), Version(1, 2, 3))
+ self.assertNotEqual(Version(1, 2, 3), None)
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/models/test_configuration.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/layout_tests/models/test_configuration.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/models/test_configuration.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -31,7 +31,7 @@
class TestConfiguration(object):
def __init__(self, version, architecture, build_type):
- self.version = version
+ self.version = version.lower().replace(' ', '') if version is not None else ''
self.architecture = architecture
self.build_type = build_type
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -474,7 +474,7 @@
actual_expectations = expectations.remove_configuration_from_test('failures/expected/foo.html', test_config)
- self.assertEqual("""Bug(x) [ Linux Vista Win7 Release ] failures/expected/foo.html [ Failure ]
+ self.assertEqual("""Bug(x) [ 7SP0 Linux Vista Release ] failures/expected/foo.html [ Failure ]
Bug(y) [ Win Mac Debug ] failures/expected/foo.html [ Crash ]
""", actual_expectations)
@@ -493,7 +493,7 @@
actual_expectations = expectations.remove_configuration_from_test('failures/expected/foo.html', test_config)
actual_expectations = expectations.remove_configuration_from_test('failures/expected/foo.html', host.port_factory.get('test-win-vista', None).test_configuration())
- actual_expectations = expectations.remove_configuration_from_test('failures/expected/foo.html', host.port_factory.get('test-win-win7', None).test_configuration())
+ actual_expectations = expectations.remove_configuration_from_test('failures/expected/foo.html', host.port_factory.get('test-win-7sp0', None).test_configuration())
self.assertEqual("""Bug(y) [ Win Debug ] failures/expected/foo.html [ Crash ]
""", actual_expectations)
Modified: trunk/Tools/Scripts/webkitpy/port/apple.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/port/apple.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/port/apple.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -27,10 +27,11 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import logging
-import os
-from webkitpy.common.system.executive import ScriptError
+from webkitpy.common.memoized import memoized
+from webkitpy.common.version_name_map import VersionNameMap
from webkitpy.port.base import Port
+from webkitpy.port.config import apple_additions
from webkitpy.layout_tests.models.test_configuration import TestConfiguration
@@ -40,19 +41,9 @@
class ApplePort(Port):
"""Shared logic between all of Apple's ports."""
- # This is used to represent the version of an operating system
- # corresponding to the "mac" or "win" base LayoutTests/platform
- # directory. I'm not sure this concept is very useful,
- # but it gives us a way to refer to fallback paths *only* including
- # the base directory.
- # This is mostly done because TestConfiguration assumes that self.version()
- # will never return None. (None would be another way to represent this concept.)
- # Apple supposedly has explicit "future" results which are kept in an internal repository.
- # It's possible that Apple would want to fix this code to work better with those results.
- FUTURE_VERSION = 'future' # FIXME: This whole 'future' thing feels like a hack.
-
# overridden in subclasses
- VERSION_FALLBACK_ORDER = []
+ VERSION_MIN = None
+ VERSION_MAX = None
ARCHITECTURES = []
_crash_logs_to_skip_for_host = {}
@@ -71,9 +62,9 @@
# being run, so this won't work if you're not on mac or win (respectively).
# If you're not on the o/s in question, you must specify a full version or -future (cf. above).
if port_name == cls.port_name and not getattr(options, 'webkit_test_runner', False):
- port_name = cls.port_name + '-' + host.platform.os_version
+ port_name = cls.port_name + '-' + host.platform.os_version_name().lower().replace(' ', '')
else:
- port_name = cls.port_name + '-' + host.platform.os_version + '-wk2'
+ port_name = cls.port_name + '-' + host.platform.os_version_name().lower().replace(' ', '') + '-wk2'
elif getattr(options, 'webkit_test_runner', False) and '-wk2' not in port_name:
port_name += '-wk2'
@@ -103,31 +94,30 @@
def should_retry_crashes(self):
return True
- def _skipped_file_search_paths(self):
- # We don't have a dedicated Skipped file for the most recent version of the port;
- # we just use the one in platform/{mac,win}
- most_recent_name = self.VERSION_FALLBACK_ORDER[-1]
- return set(filter(lambda name: name != most_recent_name, super(ApplePort, self)._skipped_file_search_paths()))
-
# FIXME: A more sophisticated version of this function should move to WebKitPort and replace all calls to name().
# This is also a misleading name, since 'mac-future' gets remapped to 'mac'.
def _port_name_with_version(self):
return self.name().replace('-future', '').replace('-wk2', '')
- def _allowed_port_names(self):
- return self.VERSION_FALLBACK_ORDER + [self._future_port_name()]
+ @memoized
+ def _allowed_versions(self):
+ if self.VERSION_MIN is None or self.VERSION_MAX is None:
+ return []
+ sorted_versions = sorted(VersionNameMap.map(self.host.platform).mapping_for_platform(platform=self.port_name.split('-')[0]).values())
+ return sorted_versions[sorted_versions.index(self.VERSION_MIN):sorted_versions.index(self.VERSION_MAX) + 1]
- def _future_port_name(self):
- return self.operating_system() + "-" + self.FUTURE_VERSION
-
def _generate_all_test_configurations(self):
configurations = []
- for port_name in self._allowed_port_names():
+ for version in self._allowed_versions():
for build_type in self.ALL_BUILD_TYPES:
for architecture in self.ARCHITECTURES:
- configurations.append(TestConfiguration(version=self._strip_port_name_prefix(port_name), architecture=architecture, build_type=build_type))
+ version_name = VersionNameMap.map(self.host.platform).to_name(version, platform=self.port_name.split('-')[0])
+ configurations.append(TestConfiguration(version=version_name, architecture=architecture, build_type=build_type))
return configurations
+ def _apple_baseline_path(self, platform):
+ return self._filesystem.join(apple_additions().layout_tests_path(), platform)
+
def _path_to_helper(self):
binary_name = 'LayoutTestHelper'
return self._build_path(binary_name)
Modified: trunk/Tools/Scripts/webkitpy/port/base.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/port/base.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/port/base.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -49,6 +49,7 @@
from webkitpy.common.prettypatch import PrettyPatch
from webkitpy.common.system import path
from webkitpy.common.system.executive import ScriptError
+from webkitpy.common.version_name_map import PUBLIC_TABLE, VersionNameMap
from webkitpy.common.wavediff import WaveDiff
from webkitpy.common.webkit_finder import WebKitFinder
from webkitpy.layout_tests.models.test_configuration import TestConfiguration
@@ -99,7 +100,7 @@
self._name = port_name
# These are default values that should be overridden in a subclasses.
- self._version = ''
+ self._os_version = None
# FIXME: This can be removed once default architectures for GTK and EFL EWS bots are set.
self.did_override_architecture = False
@@ -764,13 +765,16 @@
# Subclasses should override this default implementation.
return 'mac'
- def version(self):
+ @memoized
+ def version_name(self):
"""Returns a string indicating the version of a given platform, e.g.
'leopard' or 'xp'.
This is used to help identify the exact port when parsing test
expectations, determining search paths, and logging information."""
- return self._version
+ if self._os_version is None:
+ return None
+ return VersionNameMap.map(self.host.platform).to_name(self._os_version, table=PUBLIC_TABLE)
def get_option(self, name, default_value=None):
return getattr(self._options, name, default_value)
@@ -1072,7 +1076,7 @@
def test_configuration(self):
"""Returns the current TestConfiguration for the port."""
if not self._test_configuration:
- self._test_configuration = TestConfiguration(self._version, self.architecture(), self._options.configuration.lower())
+ self._test_configuration = TestConfiguration(self.version_name(), self.architecture(), self._options.configuration.lower())
return self._test_configuration
# FIXME: Belongs on a Platform object.
Modified: trunk/Tools/Scripts/webkitpy/port/darwin_testcase.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/port/darwin_testcase.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/port/darwin_testcase.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -28,6 +28,7 @@
from webkitpy.common.system.filesystem_mock import MockFileSystem
from webkitpy.common.system.executive_mock import MockExecutive, MockExecutive2, MockProcess, ScriptError
from webkitpy.common.system.systemhost_mock import MockSystemHost
+from webkitpy.common.version_name_map import VersionNameMap
class DarwinTest(port_testcase.PortTestCase):
@@ -41,7 +42,7 @@
self.assertEqual(self.make_port(options=MockOptions(guard_malloc=True)).default_timeout_ms(), 350000)
def assert_name(self, port_name, os_version_string, expected):
- host = MockSystemHost(os_name=self.os_name, os_version=os_version_string)
+ host = MockSystemHost(os_name=self.os_name, os_version=VersionNameMap.map().from_name(os_version_string)[1])
port = self.make_port(host=host, port_name=port_name)
self.assertEqual(expected, port.name())
Modified: trunk/Tools/Scripts/webkitpy/port/factory_unittest.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/port/factory_unittest.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/port/factory_unittest.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -31,11 +31,11 @@
from webkitpy.tool.mocktool import MockOptions
from webkitpy.common.system.systemhost_mock import MockSystemHost
+from webkitpy.common.version import Version
from webkitpy.port import factory
from webkitpy.port import gtk
from webkitpy.port import mac
-from webkitpy.port import test
from webkitpy.port import win
@@ -55,15 +55,15 @@
def test_mac(self):
self.assert_port(port_name='mac-lion', cls=mac.MacPort)
self.assert_port(port_name='mac-lion-wk2', cls=mac.MacPort)
- self.assert_port(port_name='mac', os_name='mac', os_version='lion', cls=mac.MacPort)
- self.assert_port(port_name=None, os_name='mac', os_version='lion', cls=mac.MacPort)
+ self.assert_port(port_name='mac', os_name='mac', os_version=Version.from_name('Lion'), cls=mac.MacPort)
+ self.assert_port(port_name=None, os_name='mac', os_version=Version.from_name('Lion'), cls=mac.MacPort)
def test_win(self):
self.assert_port(port_name='win-xp', cls=win.WinPort)
self.assert_port(port_name='win-xp-wk2', cls=win.WinPort)
- self.assert_port(port_name='win', os_name='win', os_version='xp', cls=win.WinPort)
- self.assert_port(port_name=None, os_name='win', os_version='xp', cls=win.WinPort)
- self.assert_port(port_name=None, os_name='win', os_version='xp', options=self.webkit_options, cls=win.WinPort)
+ self.assert_port(port_name='win', os_name='win', os_version=Version.from_name('XP'), cls=win.WinPort)
+ self.assert_port(port_name=None, os_name='win', os_version=Version.from_name('XP'), cls=win.WinPort)
+ self.assert_port(port_name=None, os_name='win', os_version=Version.from_name('XP'), options=self.webkit_options, cls=win.WinPort)
def test_gtk(self):
self.assert_port(port_name='gtk', cls=gtk.GtkPort)
Modified: trunk/Tools/Scripts/webkitpy/port/gtk.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/port/gtk.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/port/gtk.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -168,7 +168,7 @@
def _generate_all_test_configurations(self):
configurations = []
for build_type in self.ALL_BUILD_TYPES:
- configurations.append(TestConfiguration(version=self._version, architecture='x86', build_type=build_type))
+ configurations.append(TestConfiguration(version=self.version_name(), architecture='x86', build_type=build_type))
return configurations
def _path_to_driver(self):
Modified: trunk/Tools/Scripts/webkitpy/port/ios.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/port/ios.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/port/ios.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -25,6 +25,7 @@
from webkitpy.common.memoized import memoized
from webkitpy.common.version import Version
+from webkitpy.common.version_name_map import VersionNameMap
from webkitpy.layout_tests.models.test_configuration import TestConfiguration
from webkitpy.port.config import apple_additions
from webkitpy.port.darwin import DarwinPort
@@ -36,6 +37,9 @@
class IOSPort(DarwinPort):
port_name = "ios"
+ VERSION_MIN = Version(11)
+ VERSION_MAX = Version(12)
+
def __init__(self, host, port_name, **kwargs):
super(IOSPort, self).__init__(host, port_name, **kwargs)
self._test_runner_process_constructor = SimulatorProcess
@@ -45,6 +49,11 @@
def _device_for_worker_number_map(self):
raise NotImplementedError
+ def version_name(self):
+ if self._os_version is None:
+ return None
+ return VersionNameMap.map(self.host.platform).to_name(self._os_version, platform=IOSPort.port_name)
+
def driver_cmd_line_for_logging(self):
# Avoid creating/connecting to devices just for logging the commandline.
self._printing_cmd_line = True
@@ -63,7 +72,7 @@
configurations = []
for build_type in self.ALL_BUILD_TYPES:
for architecture in self.ARCHITECTURES:
- configurations.append(TestConfiguration(version=self._version, architecture=architecture, build_type=build_type))
+ configurations.append(TestConfiguration(version=self.version_name(), architecture=architecture, build_type=build_type))
return configurations
@memoized
@@ -88,22 +97,6 @@
return self._testing_device(worker_number)
return self._current_device
- def _apple_additions_path(self, name):
- if name == 'wk2':
- return None
- split_name = name.split('-')
- os_index = -1
- for i in xrange(2):
- if split_name[os_index] == 'wk1' or split_name[os_index] == 'wk2' or split_name[os_index] == 'simulator' or split_name[os_index] == 'device':
- os_index -= 1
- if split_name[os_index] != split_name[0]:
- os_name = apple_additions().ios_os_name(split_name[os_index])
- if not os_name:
- return None
- split_name[os_index] = os_name
- name = '-'.join(split_name)
- return self._filesystem.join(apple_additions().layout_tests_path(), name)
-
@memoized
def default_baseline_search_path(self):
wk_string = 'wk1'
@@ -111,30 +104,42 @@
wk_string = 'wk2'
# If we don't have a specified version, that means we using the port without an SDK.
# This usually means we're doing some type of testing.In this case, don't add version fallbacks
- fallback_names = []
+ expectations = []
+ if apple_additions() and self.ios_version():
+ apple_name = VersionNameMap.map(self.host.platform).to_name(self.ios_version(), platform=IOSPort.port_name, table='internal').lower().replace(' ', '')
+ else:
+ apple_name = None
if self.ios_version():
- fallback_names.append('{}-{}-{}'.format(self.port_name, self.ios_version().major, wk_string))
- fallback_names.append('{}-{}'.format(self.port_name, self.ios_version().major))
- fallback_names.append('{}-{}'.format(self.port_name, wk_string))
- fallback_names.append(self.port_name)
+ if apple_name:
+ expectations.append(self._apple_baseline_path('{}-{}-{}'.format(self.port_name, apple_name, wk_string)))
+ expectations.append(self._webkit_baseline_path('{}-{}-{}'.format(self.port_name, self.ios_version().major, wk_string)))
+ if apple_name:
+ expectations.append(self._apple_baseline_path('{}-{}'.format(self.port_name, apple_name)))
+ expectations.append(self._webkit_baseline_path('{}-{}'.format(self.port_name, self.ios_version().major)))
+
+ if apple_additions():
+ expectations.append(self._apple_baseline_path('{}-{}'.format(self.port_name, wk_string)))
+ expectations.append(self._webkit_baseline_path('{}-{}'.format(self.port_name, wk_string)))
+ if apple_additions():
+ expectations.append(self._apple_baseline_path(self.port_name))
+ expectations.append(self._webkit_baseline_path(self.port_name))
+
if self.ios_version():
- fallback_names.append('{}-{}'.format(IOSPort.port_name, self.ios_version().major))
- fallback_names.append('{}-{}'.format(IOSPort.port_name, wk_string))
- fallback_names.append(IOSPort.port_name)
+ if apple_name:
+ expectations.append(self._apple_baseline_path('{}-{}'.format(IOSPort.port_name, apple_name)))
+ expectations.append(self._webkit_baseline_path('{}-{}'.format(IOSPort.port_name, self.ios_version().major)))
+ if apple_additions():
+ expectations.append(self._apple_baseline_path('{}-{}'.format(IOSPort.port_name, wk_string)))
+ expectations.append(self._webkit_baseline_path('{}-{}'.format(IOSPort.port_name, wk_string)))
+ if apple_additions():
+ expectations.append(self._apple_baseline_path(IOSPort.port_name))
+ expectations.append(self._webkit_baseline_path(IOSPort.port_name))
+
if self.get_option('webkit_test_runner'):
- fallback_names.append('wk2')
+ expectations.append(self._webkit_baseline_path('wk2'))
- webkit_expectations = map(self._webkit_baseline_path, fallback_names)
- if apple_additions() and getattr(apple_additions(), "layout_tests_path", None):
- apple_expectations = map(self._apple_additions_path, fallback_names)
- result = []
- for i in xrange(len(webkit_expectations)):
- if apple_expectations[i]:
- result.append(apple_expectations[i])
- result.append(webkit_expectations[i])
- return result
- return webkit_expectations
+ return expectations
def test_expectations_file_position(self):
return 4
Modified: trunk/Tools/Scripts/webkitpy/port/ios_device.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/port/ios_device.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/port/ios_device.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -109,9 +109,7 @@
else:
if device.platform.os_version != version:
raise RuntimeError('Multiple connected devices have different iOS versions')
- if version:
- return VersionNameMap.map(self.host.platform).from_name(version)[1]
- return None
+ return version
# FIXME: These need device implementations <rdar://problem/30497991>.
def check_for_leaks(self, process_name, process_pid):
Modified: trunk/Tools/Scripts/webkitpy/port/ios_device_unittest.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/port/ios_device_unittest.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/port/ios_device_unittest.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -31,15 +31,10 @@
class IOSDeviceTest(ios_testcase.IOSTest):
os_name = 'ios'
- os_version = ''
+ os_version = None
port_name = 'ios-device'
port_maker = IOSDevicePort
- def make_port(self, host=None, port_name=None, options=None, os_name=None, os_version=None, **kwargs):
- port = super(IOSDeviceTest, self).make_port(host=host, port_name=port_name, options=options, os_name=os_name, s_version=os_version, kwargs=kwargs)
- port.set_option('version', '11.0')
- return port
-
def test_operating_system(self):
self.assertEqual('ios-device', self.make_port().operating_system())
@@ -93,15 +88,15 @@
def test_layout_test_searchpath_with_apple_additions(self):
with port_testcase.bind_mock_apple_additions():
search_path = self.make_port().default_baseline_search_path()
- self.assertEqual(search_path[0], '/additional_testing_path/ios-device-add-11-wk1')
+ self.assertEqual(search_path[0], '/additional_testing_path/ios-device-add-ios11-wk1')
self.assertEqual(search_path[1], '/mock-checkout/LayoutTests/platform/ios-device-11-wk1')
- self.assertEqual(search_path[2], '/additional_testing_path/ios-device-add-11')
+ self.assertEqual(search_path[2], '/additional_testing_path/ios-device-add-ios11')
self.assertEqual(search_path[3], '/mock-checkout/LayoutTests/platform/ios-device-11')
self.assertEqual(search_path[4], '/additional_testing_path/ios-device-wk1')
self.assertEqual(search_path[5], '/mock-checkout/LayoutTests/platform/ios-device-wk1')
self.assertEqual(search_path[6], '/additional_testing_path/ios-device')
self.assertEqual(search_path[7], '/mock-checkout/LayoutTests/platform/ios-device')
- self.assertEqual(search_path[8], '/additional_testing_path/ios-add-11')
+ self.assertEqual(search_path[8], '/additional_testing_path/ios-add-ios11')
self.assertEqual(search_path[9], '/mock-checkout/LayoutTests/platform/ios-11')
self.assertEqual(search_path[10], '/additional_testing_path/ios-wk1')
self.assertEqual(search_path[11], '/mock-checkout/LayoutTests/platform/ios-wk1')
Modified: trunk/Tools/Scripts/webkitpy/port/ios_simulator.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/port/ios_simulator.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/port/ios_simulator.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -246,7 +246,7 @@
else:
self._executive.run_command(['xcrun', 'simctl', 'boot', device_udid])
- if mac_os_version in ['elcapitan', 'yosemite', 'mavericks']:
+ if mac_os_version < Version.from_name('Sierra'):
time.sleep(2.5)
if not self.use_multiple_simulator_apps():
Modified: trunk/Tools/Scripts/webkitpy/port/ios_simulator_unittest.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/port/ios_simulator_unittest.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/port/ios_simulator_unittest.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -20,12 +20,11 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-import time
-
from webkitpy.port.ios_simulator import IOSSimulatorPort
from webkitpy.port import ios_testcase
from webkitpy.port import port_testcase
from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.common.version import Version
from webkitpy.tool.mocktool import MockOptions
from webkitpy.common.system.executive_mock import MockExecutive2, ScriptError
@@ -33,12 +32,12 @@
class IOSSimulatorTest(ios_testcase.IOSTest):
# FIXME: https://bugs.webkit.org/show_bug.cgi?id=173107
os_name = 'mac'
- os_version = ''
+ os_version = None
port_name = 'ios-simulator'
port_maker = IOSSimulatorPort
- def make_port(self, host=None, port_name=None, options=None, os_name=None, os_version=None, **kwargs):
- port = super(IOSSimulatorTest, self).make_port(host=host, port_name=port_name, options=options, os_name=os_name, s_version=os_version, kwargs=kwargs)
+ def make_port(self, host=None, port_name=None, options=None, os_name=None, os_version=Version(11), **kwargs):
+ port = super(IOSSimulatorTest, self).make_port(host=host, port_name=port_name, options=options, os_name=os_name, os_version=os_version, kwargs=kwargs)
port.set_option('child_processes', 1)
return port
@@ -92,15 +91,15 @@
def test_layout_test_searchpath_with_apple_additions(self):
with port_testcase.bind_mock_apple_additions():
search_path = self.make_port().default_baseline_search_path()
- self.assertEqual(search_path[0], '/additional_testing_path/ios-simulator-add-8-wk1')
- self.assertEqual(search_path[1], '/mock-checkout/LayoutTests/platform/ios-simulator-8-wk1')
- self.assertEqual(search_path[2], '/additional_testing_path/ios-simulator-add-8')
- self.assertEqual(search_path[3], '/mock-checkout/LayoutTests/platform/ios-simulator-8')
+ self.assertEqual(search_path[0], '/additional_testing_path/ios-simulator-add-ios11-wk1')
+ self.assertEqual(search_path[1], '/mock-checkout/LayoutTests/platform/ios-simulator-11-wk1')
+ self.assertEqual(search_path[2], '/additional_testing_path/ios-simulator-add-ios11')
+ self.assertEqual(search_path[3], '/mock-checkout/LayoutTests/platform/ios-simulator-11')
self.assertEqual(search_path[4], '/additional_testing_path/ios-simulator-wk1')
self.assertEqual(search_path[5], '/mock-checkout/LayoutTests/platform/ios-simulator-wk1')
self.assertEqual(search_path[6], '/additional_testing_path/ios-simulator')
self.assertEqual(search_path[7], '/mock-checkout/LayoutTests/platform/ios-simulator')
- self.assertEqual(search_path[8], '/additional_testing_path/ios-add-8')
- self.assertEqual(search_path[9], '/mock-checkout/LayoutTests/platform/ios-8')
+ self.assertEqual(search_path[8], '/additional_testing_path/ios-add-ios11')
+ self.assertEqual(search_path[9], '/mock-checkout/LayoutTests/platform/ios-11')
self.assertEqual(search_path[10], '/additional_testing_path/ios-wk1')
self.assertEqual(search_path[11], '/mock-checkout/LayoutTests/platform/ios-wk1')
Modified: trunk/Tools/Scripts/webkitpy/port/ios_testcase.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/port/ios_testcase.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/port/ios_testcase.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -20,13 +20,18 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+from webkitpy.common.version import Version
from webkitpy.port import darwin_testcase
-from webkitpy.tool.mocktool import MockOptions
class IOSTest(darwin_testcase.DarwinTest):
disable_setup = True
+ def make_port(self, host=None, port_name=None, options=None, os_name=None, os_version=Version(11), **kwargs):
+ port = super(IOSTest, self).make_port(host=host, port_name=port_name, options=options, os_name=os_name, os_version=None, kwargs=kwargs)
+ port.set_option('version', str(os_version))
+ return port
+
def test_driver_name(self):
self.assertEqual(self.make_port().driver_name(), 'DumpRenderTree.app')
Modified: trunk/Tools/Scripts/webkitpy/port/mac.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/port/mac.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/port/mac.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -29,11 +29,12 @@
import logging
import os
-import time
import re
from webkitpy.common.memoized import memoized
from webkitpy.common.system.executive import ScriptError
+from webkitpy.common.version import Version
+from webkitpy.common.version_name_map import VersionNameMap
from webkitpy.port.config import apple_additions
from webkitpy.port.darwin import DarwinPort
@@ -43,7 +44,9 @@
class MacPort(DarwinPort):
port_name = "mac"
- VERSION_FALLBACK_ORDER = ['mac-snowleopard', 'mac-lion', 'mac-mountainlion', 'mac-mavericks', 'mac-yosemite', 'mac-elcapitan', 'mac-sierra', 'mac-highsierra']
+ VERSION_MIN = Version(10, 6)
+ VERSION_MAX = Version(10, 14)
+
SDK = 'macosx'
ARCHITECTURES = ['x86_64', 'x86']
@@ -52,66 +55,62 @@
def __init__(self, host, port_name, **kwargs):
DarwinPort.__init__(self, host, port_name, **kwargs)
- self._os_version = port_name.split('-')[1] if port_name.split('-') > 1 else self.host.platform.os_version
+ if port_name.split('-') > 1:
+ self._os_version = VersionNameMap.map(host.platform).from_name(port_name.split('-')[1])[1]
+ else:
+ self._os_version = self.host.platform.os_version
def _build_driver_flags(self):
return ['ARCHS=i386'] if self.architecture() == 'x86' else []
- def _apple_additions_path(self, name):
- if name == 'wk2':
- return None
- split_name = name.split('-')
- os_index = -1
- if split_name[-1] == 'wk1' or split_name[-1] == 'wk2':
- os_index = -2
- if split_name[os_index] != split_name[0]:
- os_name = apple_additions().mac_os_name(split_name[os_index])
- if not os_name:
- return None
- split_name[os_index] = os_name
- name = '-'.join(split_name)
- return self._filesystem.join(apple_additions().layout_tests_path(), name)
-
@memoized
def default_baseline_search_path(self):
- mac_version = 'mac-{}'.format(self._os_version)
- if mac_version.endswith(self.FUTURE_VERSION) or mac_version not in self.VERSION_FALLBACK_ORDER:
- version_fallback = [mac_version]
+ version_name_map = VersionNameMap.map(self.host.platform)
+ if self._os_version < self.VERSION_MIN or self._os_version > self.VERSION_MAX:
+ version_fallback = [self._os_version]
else:
- version_fallback = self.VERSION_FALLBACK_ORDER[self.VERSION_FALLBACK_ORDER.index(mac_version):-1]
+ sorted_versions = sorted(version_name_map.mapping_for_platform().values())
+ version_fallback = sorted_versions[sorted_versions.index(self._os_version):-1]
wk_string = 'wk1'
if self.get_option('webkit_test_runner'):
wk_string = 'wk2'
- fallback_names = []
+ expectations = []
for version in version_fallback:
- fallback_names.append('{}-{}'.format(version, wk_string))
- fallback_names.append(version)
- fallback_names = fallback_names + [
- '{}-{}'.format(self.port_name, wk_string),
- self.port_name,
- ]
+ version_name = version_name_map.to_name(version).lower().replace(' ', '')
+ if apple_additions():
+ apple_name = version_name_map.to_name(version, table='internal')
+ else:
+ apple_name = None
+ if apple_name:
+ expectations.append(self._apple_baseline_path('mac-{}-{}'.format(apple_name.lower().replace(' ', ''), wk_string)))
+ expectations.append(self._webkit_baseline_path('mac-{}-{}'.format(version_name, wk_string)))
+ if apple_name:
+ expectations.append(self._apple_baseline_path('mac-{}'.format(apple_name.lower().replace(' ', ''))))
+ expectations.append(self._webkit_baseline_path('mac-{}'.format(version_name)))
+
+ if apple_additions():
+ expectations.append(self._apple_baseline_path('{}-{}'.format(self.port_name, wk_string)))
+ expectations.append(self._webkit_baseline_path('{}-{}'.format(self.port_name, wk_string)))
+ if apple_additions():
+ expectations.append(self._apple_baseline_path('{}'.format(self.port_name)))
+ expectations.append(self._webkit_baseline_path(self.port_name))
+
if self.get_option('webkit_test_runner'):
- fallback_names.append('wk2')
+ expectations.append(self._webkit_baseline_path('wk2'))
+ return expectations
- webkit_expectations = map(self._webkit_baseline_path, fallback_names)
- if apple_additions() and getattr(apple_additions(), "layout_tests_path", None):
- apple_expectations = map(self._apple_additions_path, fallback_names)
- result = []
- for i in xrange(len(webkit_expectations)):
- if apple_expectations[i]:
- result.append(apple_expectations[i])
- result.append(webkit_expectations[i])
- return result
- return webkit_expectations
-
+ @memoized
def configuration_specifier_macros(self):
- return {
- "highsierra+": ["highsierra", "future"],
- "sierra+": ["sierra", "highsierra", "future"],
- "elcapitan+": ["elcapitan", "sierra", "highsierra", "future"],
- "yosemite+": ["yosemite", "elcapitan", "sierra", "highsierra", "future"],
- }
+ map = {}
+ version_name_map = VersionNameMap.map(self.host.platform)
+ sorted_versions = sorted(version_name_map.mapping_for_platform().values())
+ for version in sorted_versions:
+ list = []
+ for newer in sorted_versions[sorted_versions.index(version):]:
+ list.append(version_name_map.to_name(newer, platform=self.port_name).lower().replace(' ', ''))
+ map[version_name_map.to_name(version, platform=self.port_name).lower().replace(' ', '') + '+'] = list
+ return map
def setup_environ_for_server(self, server_name=None):
env = super(MacPort, self).setup_environ_for_server(server_name)
Modified: trunk/Tools/Scripts/webkitpy/port/mac_unittest.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/port/mac_unittest.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/port/mac_unittest.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -27,8 +27,6 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-import time
-
from webkitpy.port.mac import MacPort
from webkitpy.port import darwin_testcase
from webkitpy.port import port_testcase
@@ -35,17 +33,18 @@
from webkitpy.common.system.outputcapture import OutputCapture
from webkitpy.tool.mocktool import MockOptions
from webkitpy.common.system.executive_mock import MockExecutive, MockExecutive2, ScriptError
+from webkitpy.common.version import Version
class MacTest(darwin_testcase.DarwinTest):
os_name = 'mac'
- os_version = 'lion'
+ os_version = Version.from_name('Lion')
port_name = 'mac-lion'
port_maker = MacPort
def test_version(self):
port = self.make_port()
- self.assertTrue(port.version())
+ self.assertIsNotNone(port.version_name())
def test_versions(self):
# Note: these tests don't need to be exhaustive as long as we get path coverage.
Modified: trunk/Tools/Scripts/webkitpy/port/port_testcase.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/port/port_testcase.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/port/port_testcase.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -78,6 +78,7 @@
@contextmanager
def bind_mock_apple_additions():
+ from webkitpy.common.version_name_map import PUBLIC_TABLE, VersionNameMap
class MockAppleAdditions(object):
@@ -93,11 +94,23 @@
def mac_os_name(name):
return 'add-{}'.format(name)
+ @staticmethod
+ def version_name_mapping(platform=None):
+ result = VersionNameMap(platform)
+ result.mapping['internal'] = {}
+ for platform in result.mapping[PUBLIC_TABLE]:
+ result.mapping['internal'][platform] = {}
+ for name, version in result.mapping[PUBLIC_TABLE][platform].iteritems():
+ result.mapping['internal'][platform]['add-' + name] = version
+ return result
+
# apple_additions is a memoized function. Take advantage of this fact and manipulate the cache
# to temporarily return a mocked result
apple_additions._results_cache[()] = MockAppleAdditions
+ VersionNameMap.map._results_cache = {}
yield
apple_additions._results_cache[()] = None
+ VersionNameMap.map._results_cache = {}
class PortTestCase(unittest.TestCase):
Modified: trunk/Tools/Scripts/webkitpy/port/test.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/port/test.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/port/test.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -26,13 +26,12 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-import sys
import time
from webkitpy.port import Port, Driver, DriverOutput
from webkitpy.layout_tests.models.test_configuration import TestConfiguration
-from webkitpy.common.system.filesystem_mock import MockFileSystem
from webkitpy.common.system.crashlogs import CrashLogs
+from webkitpy.common.version_name_map import PUBLIC_TABLE, VersionNameMap
# This sets basic expectations for a test. Each individual expectation
@@ -243,7 +242,7 @@
# For testing test are properly included from platform directories.
tests.add('platform/test-mac-leopard/http/test.html')
- tests.add('platform/test-win-win7/http/test.html')
+ tests.add('platform/test-win-7sp0/http/test.html')
# For --no-http tests, test that platform specific HTTP tests are properly skipped.
tests.add('platform/test-snow-leopard/http/test.html')
@@ -357,7 +356,7 @@
ALL_BASELINE_VARIANTS = (
'test-linux-x86_64',
'test-mac-snowleopard', 'test-mac-leopard',
- 'test-win-vista', 'test-win-win7', 'test-win-xp',
+ 'test-win-vista', 'test-win-7sp0', 'test-win-xp',
)
@classmethod
@@ -373,21 +372,16 @@
self._expectations_path = LAYOUT_TEST_DIR + '/platform/test/TestExpectations'
self._results_directory = None
- self._operating_system = 'mac'
- if self._name.startswith('test-win'):
- self._operating_system = 'win'
- elif self._name.startswith('test-linux'):
- self._operating_system = 'linux'
+ self._operating_system = self._name.split('-')[1]
+ if self._operating_system == 'linux':
+ self._os_version = None
+ else:
+ self._os_version = VersionNameMap.map(self.host.platform).from_name(self._name.split('-')[2])[1]
- version_map = {
- 'test-win-xp': 'xp',
- 'test-win-win7': 'win7',
- 'test-win-vista': 'vista',
- 'test-mac-leopard': 'leopard',
- 'test-mac-snowleopard': 'snowleopard',
- 'test-linux-x86_64': 'lucid',
- }
- self._version = version_map[self._name]
+ def version_name(self):
+ if self._os_version is None:
+ return None
+ return VersionNameMap.map(self.host.platform).to_name(self._os_version, platform=self._operating_system, table=PUBLIC_TABLE)
def default_pixel_tests(self):
return True
@@ -401,10 +395,10 @@
search_paths = {
'test-mac-snowleopard': ['test-mac-snowleopard'],
'test-mac-leopard': ['test-mac-leopard', 'test-mac-snowleopard'],
- 'test-win-win7': ['test-win-win7'],
- 'test-win-vista': ['test-win-vista', 'test-win-win7'],
- 'test-win-xp': ['test-win-xp', 'test-win-vista', 'test-win-win7'],
- 'test-linux-x86_64': ['test-linux', 'test-win-win7'],
+ 'test-win-7sp0': ['test-win-7sp0'],
+ 'test-win-vista': ['test-win-vista', 'test-win-7sp0'],
+ 'test-win-xp': ['test-win-xp', 'test-win-vista', 'test-win-7sp0'],
+ 'test-linux-x86_64': ['test-linux'],
}
return [self._webkit_baseline_path(d) for d in search_paths[self.name()]]
@@ -514,7 +508,7 @@
('snowleopard', 'x86'),
('xp', 'x86'),
('vista', 'x86'),
- ('win7', 'x86'),
+ ('7sp0', 'x86'),
('lucid', 'x86'),
('lucid', 'x86_64'))
@@ -523,7 +517,7 @@
def configuration_specifier_macros(self):
"""To avoid surprises when introducing new macros, these are intentionally fixed in time."""
- return {'mac': ['leopard', 'snowleopard'], 'win': ['xp', 'vista', 'win7'], 'linux': ['lucid']}
+ return {'mac': ['leopard', 'snowleopard'], 'win': ['xp', 'vista', '7sp0'], 'linux': ['lucid']}
def all_baseline_variants(self):
return self.ALL_BASELINE_VARIANTS
Modified: trunk/Tools/Scripts/webkitpy/port/win.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/port/win.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/port/win.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -37,8 +37,9 @@
from webkitpy.common.system.crashlogs import CrashLogs
from webkitpy.common.system.systemhost import SystemHost
-from webkitpy.common.system.executive import ScriptError, Executive
+from webkitpy.common.system.executive import Executive
from webkitpy.common.system.path import abspath_to_uri, cygpath
+from webkitpy.common.version import Version
from webkitpy.common.version_name_map import VersionNameMap
from webkitpy.port.apple import ApplePort
from webkitpy.port.config import apple_additions
@@ -56,7 +57,8 @@
class WinPort(ApplePort):
port_name = "win"
- VERSION_FALLBACK_ORDER = ["win-xp", "win-vista", "win-7sp0", "win-win10", "win"]
+ VERSION_MIN = Version(5, 1)
+ VERSION_MAX = Version(10)
ARCHITECTURES = ['x86', 'x86_64']
@@ -87,6 +89,13 @@
previous_error_reporting_values = {}
previous_wow64_error_reporting_values = {}
+ def __init__(self, host, port_name, **kwargs):
+ ApplePort.__init__(self, host, port_name, **kwargs)
+ if port_name.split('-') > 1:
+ self._os_version = VersionNameMap.map(host.platform).from_name(port_name.split('-')[1])[1]
+ else:
+ self._os_version = self.host.platform.os_version
+
def do_text_results_differ(self, expected_text, actual_text):
# Sanity was restored in WK2, so we don't need this hack there.
if self.get_option('webkit_test_runner'):
@@ -102,11 +111,15 @@
return expected_text != actual_text
def default_baseline_search_path(self):
- name = self._name.replace('-wk2', '')
- if name.endswith(self.FUTURE_VERSION):
- fallback_names = [self.port_name]
+ version_name_map = VersionNameMap.map(self.host.platform)
+ if self._os_version < self.VERSION_MIN or self._os_version > self.VERSION_MAX:
+ fallback_versions = [self._os_version]
else:
- fallback_names = self.VERSION_FALLBACK_ORDER[self.VERSION_FALLBACK_ORDER.index(name):-1] + [self.port_name]
+ sorted_versions = sorted(version_name_map.mapping_for_platform(platform=self.port_name).values())
+ fallback_versions = sorted_versions[sorted_versions.index(self._os_version):]
+ fallback_names = ['win-' + version_name_map.to_name(version, platform=self.port_name).lower().replace(' ', '') for version in fallback_versions]
+ fallback_names.append('win')
+
# FIXME: The AppleWin port falls back to AppleMac for some results. Eventually we'll have a shared 'apple' port.
if self.get_option('webkit_test_runner'):
fallback_names.insert(0, 'win-wk2')
@@ -438,17 +451,13 @@
TEST_PATH_SEPARATOR = os.sep
- VERSION_FALLBACK_ORDER = ["wincairo-" + os_name.lower() for os_name in VersionNameMap.map().names()]
-
def default_baseline_search_path(self):
- name = self._name.replace('-wk2', '')
- if name.endswith(self.FUTURE_VERSION):
- fallback_names = []
+ version_name_map = VersionNameMap.map(self.host.platform)
+ if self._os_version < self.VERSION_MIN or self._os_version > self.VERSION_MAX:
+ fallback_versions = [self._os_version]
else:
- assert name in self.VERSION_FALLBACK_ORDER
- fallback_names = self.VERSION_FALLBACK_ORDER[self.VERSION_FALLBACK_ORDER.index(name):]
- fallback_names.append(self.port_name)
+ sorted_versions = sorted(version_name_map.mapping_for_platform(platform=self.port_name).values())
+ fallback_versions = sorted_versions[sorted_versions.index(self._os_version):]
+ fallback_names = ['wincairo-' + version_name_map.to_name(version, platform=self.port_name).lower().replace(' ', '') for version in fallback_versions]
+ fallback_names.append('wincairo')
return map(self._webkit_baseline_path, fallback_names)
-
- def _future_port_name(self):
- return self.port_name + "-" + self.FUTURE_VERSION
Modified: trunk/Tools/Scripts/webkitpy/port/win_unittest.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/port/win_unittest.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/port/win_unittest.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -29,6 +29,8 @@
from webkitpy.common.system.executive_mock import MockExecutive
from webkitpy.common.system.outputcapture import OutputCapture
from webkitpy.common.system.systemhost_mock import MockSystemHost
+from webkitpy.common.version import Version
+from webkitpy.common.version_name_map import PUBLIC_TABLE, VersionNameMap
from webkitpy.port import port_testcase
from webkitpy.port.win import WinPort
from webkitpy.tool.mocktool import MockOptions
@@ -36,7 +38,7 @@
class WinPortTest(port_testcase.PortTestCase):
os_name = 'win'
- os_version = 'xp'
+ os_version = Version.from_name('XP')
port_name = 'win-xp'
port_maker = WinPort
@@ -58,24 +60,24 @@
self.assertEqual(port.baseline_search_path(), absolute_search_paths)
def test_baseline_search_path(self):
- self._assert_search_path(['win-xp', 'win-vista', 'win-7sp0', 'win-win10', 'win', 'mac'], 'xp')
- self._assert_search_path(['win-vista', 'win-7sp0', 'win-win10', 'win', 'mac'], 'vista')
- self._assert_search_path(['win-7sp0', 'win-win10', 'win', 'mac'], '7sp0')
+ self._assert_search_path(['win-xp', 'win-vista', 'win-7sp0', 'win-8', 'win-8.1', 'win-win10', 'win', 'mac'], Version.from_name('XP'))
+ self._assert_search_path(['win-vista', 'win-7sp0', 'win-8', 'win-8.1', 'win-win10', 'win', 'mac'], Version.from_name('Vista'))
+ self._assert_search_path(['win-7sp0', 'win-8', 'win-8.1', 'win-win10', 'win', 'mac'], Version.from_name('7sp0'))
- self._assert_search_path(['win-wk2', 'win-xp', 'win-vista', 'win-7sp0', 'win-win10', 'win', 'mac-wk2', 'mac'], 'xp', use_webkit2=True)
- self._assert_search_path(['win-wk2', 'win-vista', 'win-7sp0', 'win-win10', 'win', 'mac-wk2', 'mac'], 'vista', use_webkit2=True)
- self._assert_search_path(['win-wk2', 'win-7sp0', 'win-win10', 'win', 'mac-wk2', 'mac'], '7sp0', use_webkit2=True)
+ self._assert_search_path(['win-wk2', 'win-xp', 'win-vista', 'win-7sp0', 'win-8', 'win-8.1', 'win-win10', 'win', 'mac-wk2', 'mac'], Version.from_name('XP'), use_webkit2=True)
+ self._assert_search_path(['win-wk2', 'win-vista', 'win-7sp0', 'win-8', 'win-8.1', 'win-win10', 'win', 'mac-wk2', 'mac'], Version.from_name('Vista'), use_webkit2=True)
+ self._assert_search_path(['win-wk2', 'win-7sp0', 'win-8', 'win-8.1', 'win-win10', 'win', 'mac-wk2', 'mac'], Version.from_name('7sp0'), use_webkit2=True)
def _assert_version(self, port_name, expected_version):
host = MockSystemHost(os_name='win', os_version=expected_version)
port = WinPort(host, port_name=port_name)
- self.assertEqual(port.version(), expected_version)
+ self.assertEqual(port.version_name(), VersionNameMap.map().to_name(expected_version, platform='win', table=PUBLIC_TABLE))
def test_versions(self):
- self._assert_version('win-xp', 'xp')
- self._assert_version('win-vista', 'vista')
- self._assert_version('win-7sp0', '7sp0')
- self.assertRaises(AssertionError, self._assert_version, 'win-me', 'xp')
+ self._assert_version('win-xp', Version.from_name('XP'))
+ self._assert_version('win-vista', Version.from_name('Vista'))
+ self._assert_version('win-7sp0', Version.from_name('7sp0'))
+ self.assertRaises(AssertionError, self._assert_version, 'win-me', Version.from_name('Vista'))
def test_compare_text(self):
expected = "EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification\nfoo\nEDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification\n"
Modified: trunk/Tools/Scripts/webkitpy/port/wpe.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/port/wpe.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/port/wpe.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -82,7 +82,7 @@
def _generate_all_test_configurations(self):
configurations = []
for build_type in self.ALL_BUILD_TYPES:
- configurations.append(TestConfiguration(version=self._version, architecture='x86', build_type=build_type))
+ configurations.append(TestConfiguration(version=self.version_name(), architecture='x86', build_type=build_type))
return configurations
def _path_to_driver(self):
Modified: trunk/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -187,7 +187,7 @@
'failures/expected/image.html [ ImageOnlyFailure ]\n'
'failures/expected/text.html [ Failure ]\n'
'\n'
- '// For test-win-win7\n'
+ '// For test-win-7sp0\n'
'failures/expected/image.html [ ImageOnlyFailure ]\n'
'failures/expected/text.html [ Failure ]\n'
'\n'
@@ -281,7 +281,7 @@
'passes/text-expected.png\n'
'passes/text-expected.txt\n'
'\n'
- '// For test-win-win7\n'
+ '// For test-win-7sp0\n'
'passes/text-expected.png\n'
'passes/text-expected.txt\n'
'\n'
Modified: trunk/Tools/Scripts/webkitpy/tool/commands/queues.py (225855 => 225856)
--- trunk/Tools/Scripts/webkitpy/tool/commands/queues.py 2017-12-13 18:43:05 UTC (rev 225855)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/queues.py 2017-12-13 19:04:04 UTC (rev 225856)
@@ -35,7 +35,6 @@
import time
import traceback
-from datetime import datetime
from optparse import make_option
from StringIO import StringIO
@@ -42,7 +41,6 @@
from webkitpy.common.config.committervalidator import CommitterValidator
from webkitpy.common.config.ports import DeprecatedPort
from webkitpy.common.net.bugzilla import Attachment
-from webkitpy.common.net.statusserver import StatusServer
from webkitpy.common.system.executive import ScriptError
from webkitpy.tool.bot.botinfo import BotInfo
from webkitpy.tool.bot.commitqueuetask import CommitQueueTask, CommitQueueTaskDelegate
@@ -272,7 +270,7 @@
def _new_port_name_from_old(self, port_name, platform):
# ApplePort.determine_full_port_name asserts if the name doesn't include version.
if port_name == 'mac':
- return 'mac-' + platform.os_version
+ return 'mac-' + platform.os_version_name().lower().replace(' ', '')
if port_name == 'win':
return 'win-future'
return port_name