WebKit Bugzilla
Attachment 340091 Details for
Bug 185387
: webkitpy: Clarify construction of VersionNameMap
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185387-20180510102730.patch (text/plain), 28.23 KB, created by
Jonathan Bedard
on 2018-05-10 08:27:32 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Jonathan Bedard
Created:
2018-05-10 08:27:32 PDT
Size:
28.23 KB
patch
obsolete
>Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 231640) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,59 @@ >+2018-05-10 Jonathan Bedard <jbedard@apple.com> >+ >+ webkitpy: Clarify construction of VersionNameMap >+ https://bugs.webkit.org/show_bug.cgi?id=185387 >+ >+ PATCH FOR REFERENCE. >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Scripts/webkitpy/common/system/platforminfo.py: >+ (PlatformInfo.os_version_name): >+ * Scripts/webkitpy/common/system/platforminfo_mock.py: >+ (MockPlatformInfo.os_version_name): >+ * Scripts/webkitpy/common/version.py: >+ (Version.from_name): >+ * Scripts/webkitpy/common/version_name_map.py: >+ (VersionNameMap): >+ (VersionNameMap.__init__): >+ (VersionNameMap.to_name): >+ (VersionNameMap.names): >+ (VersionNameMap.mapping_for_platform): >+ (VersionNameMap.map): Deleted. >+ * Scripts/webkitpy/common/version_name_map_unittest.py: >+ (VersionMapTestCase.test_default_system_platform): >+ (VersionMapTestCase.test_mac_name_by_version): >+ (VersionMapTestCase.test_ios_name_by_version): >+ * Scripts/webkitpy/port/apple.py: >+ (ApplePort._allowed_versions): >+ (ApplePort._generate_all_test_configurations): >+ * Scripts/webkitpy/port/base.py: >+ (Port.version_name): >+ * Scripts/webkitpy/port/darwin_testcase.py: >+ (DarwinTest.assert_name): >+ * Scripts/webkitpy/port/ios.py: >+ (IOSPort.version_name): >+ (IOSPort.default_baseline_search_path): >+ * Scripts/webkitpy/port/mac.py: >+ (MacPort.__init__): >+ (MacPort.default_baseline_search_path): >+ (MacPort.configuration_specifier_macros): >+ * Scripts/webkitpy/port/mac_unittest.py: >+ (MacTest.test_factory_with_future_version): >+ * Scripts/webkitpy/port/port_testcase.py: >+ (bind_mock_apple_additions.MockAppleAdditions.insert_version_name_mapping): >+ (bind_mock_apple_additions): >+ (bind_mock_apple_additions.MockAppleAdditions.version_name_mapping): Deleted. >+ * Scripts/webkitpy/port/test.py: >+ * Scripts/webkitpy/port/win.py: >+ (WinPort.__init__): >+ (WinPort.default_baseline_search_path): >+ (WinCairoPort.default_baseline_search_path): >+ * Scripts/webkitpy/port/win_unittest.py: >+ (WinPortTest._assert_version): >+ * Scripts/webkitpy/xcode/device_type.py: >+ (DeviceType.__str__): >+ > 2018-05-10 Carlos Garcia Campos <cgarcia@igalia.com> > > [GTK] Add support for settings cookies policy and storage type in MiniBrowser >Index: Tools/Scripts/webkitpy/common/version.py >=================================================================== >--- Tools/Scripts/webkitpy/common/version.py (revision 231595) >+++ Tools/Scripts/webkitpy/common/version.py (working copy) >@@ -40,7 +40,7 @@ class Version(object): > @staticmethod > def from_name(name): > from version_name_map import VersionNameMap >- return VersionNameMap.map().from_name(name)[1] >+ return VersionNameMap().from_name(name)[1] > > def __init__(self, major=0, minor=0, tiny=0, micro=0, nano=0): > self.major = int(major) >Index: Tools/Scripts/webkitpy/common/version_name_map.py >=================================================================== >--- Tools/Scripts/webkitpy/common/version_name_map.py (revision 231595) >+++ Tools/Scripts/webkitpy/common/version_name_map.py (working copy) >@@ -32,22 +32,13 @@ INTERNAL_TABLE = 'internal' > > class VersionNameMap(object): > >- # Allows apple_additions to define a custom mapping >- @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): > if platform is None: > from webkitpy.common.system.systemhost import SystemHost >- platform = SystemHost().platform >+ platform = SystemHost().platform.os_name > self.mapping = {} > >- self.default_system_platform = platform.os_name >+ self.default_system_platform = platform > self.mapping[PUBLIC_TABLE] = { > 'mac': { > 'Leopard': Version(10, 5), >@@ -79,6 +70,9 @@ class VersionNameMap(object): > > # wincairo uses the same versions as Windows > self.mapping[PUBLIC_TABLE]['wincairo'] = self.mapping[PUBLIC_TABLE]['win'] >+ from webkitpy.port.config import apple_additions >+ if apple_additions(): >+ apple_additions().insert_version_name_mapping(self) > > @classmethod > def _automap_to_major_version(cls, prefix, minimum=Version(1), maximum=Version(1)): >@@ -88,9 +82,9 @@ class VersionNameMap(object): > result['{} {}'.format(prefix, str(Version(minimum.major + i)))] = Version(minimum.major + i) > return result > >- def to_name(self, version, platform=None, table=PUBLIC_TABLE): >+ def to_name(self, version, table=PUBLIC_TABLE): > closest_match = (None, None) >- for os_name, os_version in self.mapping_for_platform(platform, table).iteritems(): >+ for os_name, os_version in self.mapping_for_platform(table).iteritems(): > if version == os_version: > return os_name > elif version in os_version: >@@ -134,13 +128,12 @@ class VersionNameMap(object): > return (os_name, version) > return (None, None) > >- def names(self, platform=None, table=PUBLIC_TABLE): >+ def names(self, table=PUBLIC_TABLE): > """return list of os_name for platform""" >- mapping = self.mapping_for_platform(platform, table) >+ mapping = self.mapping_for_platform(table) > names = [os_name for os_name in mapping] > return sorted(names, key=lambda os_name: mapping[os_name]) > >- def mapping_for_platform(self, platform=None, table=PUBLIC_TABLE): >+ def mapping_for_platform(self, table=PUBLIC_TABLE): > """return proper os_name: os_version mapping for platform""" >- platform = self.default_system_platform if platform is None else platform >- return self.mapping.get(table, {}).get(platform, {}) >+ return self.mapping.get(table, {}).get(self.default_system_platform, {}) >Index: Tools/Scripts/webkitpy/common/version_name_map_unittest.py >=================================================================== >--- Tools/Scripts/webkitpy/common/version_name_map_unittest.py (revision 231595) >+++ Tools/Scripts/webkitpy/common/version_name_map_unittest.py (working copy) >@@ -31,7 +31,7 @@ class VersionMapTestCase(unittest.TestCa > > def test_default_system_platform(self): > host = SystemHost() >- map = VersionNameMap(platform=host.platform) >+ map = VersionNameMap(platform=host.platform.os_name) > self.assertEqual(map.default_system_platform, host.platform.os_name) > > def test_mac_version_by_name(self): >@@ -51,13 +51,13 @@ class VersionMapTestCase(unittest.TestCa > self.assertEqual(('ios', Version(11)), map.from_name('iOS11.2')) > > def test_mac_name_by_version(self): >- map = VersionNameMap() >- self.assertEqual('Sierra', map.to_name(version=Version(10, 12), platform='mac')) >- self.assertEqual('El Capitan', map.to_name(version=Version(10, 11), platform='mac')) >- self.assertEqual('El Capitan', map.to_name(version=Version(10, 11, 3), platform='mac')) >+ map = VersionNameMap(platform='mac') >+ self.assertEqual('Sierra', map.to_name(version=Version(10, 12))) >+ self.assertEqual('El Capitan', map.to_name(version=Version(10, 11))) >+ self.assertEqual('El Capitan', map.to_name(version=Version(10, 11, 3))) > > def test_ios_name_by_version(self): >- map = VersionNameMap() >- self.assertEqual('iOS 11', map.to_name(version=Version(11), platform='ios')) >- self.assertEqual('iOS 10', map.to_name(version=Version(10), platform='ios')) >- self.assertEqual('iOS 10', map.to_name(version=Version(10, 3), platform='ios')) >+ map = VersionNameMap(platform='ios') >+ self.assertEqual('iOS 11', map.to_name(version=Version(11))) >+ self.assertEqual('iOS 10', map.to_name(version=Version(10))) >+ self.assertEqual('iOS 10', map.to_name(version=Version(10, 3))) >Index: Tools/Scripts/webkitpy/common/system/platforminfo.py >=================================================================== >--- Tools/Scripts/webkitpy/common/system/platforminfo.py (revision 231595) >+++ Tools/Scripts/webkitpy/common/system/platforminfo.py (working copy) >@@ -118,10 +118,10 @@ class PlatformInfo(object): > if not self.os_version: > return None > if table: >- return VersionNameMap.map(self).to_name(self.os_version, table=table) >- version_name = VersionNameMap.map(self).to_name(self.os_version, table=PUBLIC_TABLE) >+ return VersionNameMap(platform=self.os_name).to_name(self.os_version, table=table) >+ version_name = VersionNameMap(platform=self.os_name).to_name(self.os_version, table=PUBLIC_TABLE) > if not version_name: >- version_name = VersionNameMap.map(self).to_name(self.os_version, table=INTERNAL_TABLE) >+ version_name = VersionNameMap(platform=self.os_name).to_name(self.os_version, table=INTERNAL_TABLE) > return version_name > > def total_bytes_memory(self): >Index: Tools/Scripts/webkitpy/common/system/platforminfo_mock.py >=================================================================== >--- Tools/Scripts/webkitpy/common/system/platforminfo_mock.py (revision 231595) >+++ Tools/Scripts/webkitpy/common/system/platforminfo_mock.py (working copy) >@@ -66,10 +66,10 @@ class MockPlatformInfo(object): > if not self.os_version: > return None > if table: >- return VersionNameMap.map(self).to_name(self.os_version, table=table) >- version_name = VersionNameMap.map(self).to_name(self.os_version, table=PUBLIC_TABLE) >+ return VersionNameMap(platform=self.os_name).to_name(self.os_version, table=table) >+ version_name = VersionNameMap(platform=self.os_name).to_name(self.os_version, table=PUBLIC_TABLE) > if not version_name: >- version_name = VersionNameMap.map(self).to_name(self.os_version, table=INTERNAL_TABLE) >+ version_name = VersionNameMap(platform=self.os_name).to_name(self.os_version, table=INTERNAL_TABLE) > return version_name > > def total_bytes_memory(self): >Index: Tools/Scripts/webkitpy/port/apple.py >=================================================================== >--- Tools/Scripts/webkitpy/port/apple.py (revision 231595) >+++ Tools/Scripts/webkitpy/port/apple.py (working copy) >@@ -99,7 +99,7 @@ class ApplePort(Port): > def _allowed_versions(self): > versions = set() > for table in [PUBLIC_TABLE, INTERNAL_TABLE]: >- versions.update(VersionNameMap.map(self.host.platform).mapping_for_platform(platform=self.port_name.split('-')[0], table=table).values()) >+ versions.update(VersionNameMap(platform=self.port_name.split('-')[0]).mapping_for_platform(table=table).values()) > return sorted(versions) > > def _generate_all_test_configurations(self): >@@ -108,7 +108,7 @@ class ApplePort(Port): > for build_type in self.ALL_BUILD_TYPES: > for architecture in self.ARCHITECTURES: > for table in [PUBLIC_TABLE, INTERNAL_TABLE]: >- version_name = VersionNameMap.map(self.host.platform).to_name(version, platform=self.port_name.split('-')[0], table=table) >+ version_name = VersionNameMap(platform=self.port_name.split('-')[0]).to_name(version, table=table) > if version_name: > configurations.append(TestConfiguration(version=version_name, architecture=architecture, build_type=build_type)) > return configurations >Index: Tools/Scripts/webkitpy/port/base.py >=================================================================== >--- Tools/Scripts/webkitpy/port/base.py (revision 231595) >+++ Tools/Scripts/webkitpy/port/base.py (working copy) >@@ -795,9 +795,9 @@ class Port(object): > expectations, determining search paths, and logging information.""" > if self._os_version is None: > return None >- result = VersionNameMap.map(self.host.platform).to_name(self._os_version, table=PUBLIC_TABLE) >+ result = VersionNameMap(self.host.platform.os_name).to_name(self._os_version, table=PUBLIC_TABLE) > if not result: >- result = VersionNameMap.map(self.host.platform).to_name(self._os_version, table=INTERNAL_TABLE) >+ result = VersionNameMap(self.host.platform.os_name).to_name(self._os_version, table=INTERNAL_TABLE) > return result > > def get_option(self, name, default_value=None): >Index: Tools/Scripts/webkitpy/port/darwin_testcase.py >=================================================================== >--- Tools/Scripts/webkitpy/port/darwin_testcase.py (revision 231595) >+++ Tools/Scripts/webkitpy/port/darwin_testcase.py (working copy) >@@ -42,7 +42,7 @@ class DarwinTest(port_testcase.PortTestC > 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=VersionNameMap.map().from_name(os_version_string)[1]) >+ host = MockSystemHost(os_name=self.os_name, os_version=VersionNameMap().from_name(os_version_string)[1]) > port = self.make_port(host=host, port_name=port_name) > self.assertEqual(expected, port.name()) > >Index: Tools/Scripts/webkitpy/port/ios.py >=================================================================== >--- Tools/Scripts/webkitpy/port/ios.py (revision 231595) >+++ Tools/Scripts/webkitpy/port/ios.py (working copy) >@@ -50,7 +50,7 @@ class IOSPort(DarwinPort): > 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) >+ return VersionNameMap(platform=IOSPort.port_name).to_name(self._os_version) > > def driver_cmd_line_for_logging(self): > # Avoid creating/connecting to devices just for logging the commandline. >@@ -111,7 +111,7 @@ class IOSPort(DarwinPort): > for version in versions_to_fallback: > apple_name = None > if apple_additions(): >- apple_name = VersionNameMap.map(self.host.platform).to_name(version, platform=IOSPort.port_name, table=INTERNAL_TABLE) >+ apple_name = VersionNameMap(platform=IOSPort.port_name).to_name(version, table=INTERNAL_TABLE) > > if apple_name: > expectations.append(self._apple_baseline_path('{}-{}-{}'.format(self.port_name, apple_name.lower().replace(' ', ''), wk_string))) >@@ -130,7 +130,7 @@ class IOSPort(DarwinPort): > for version in versions_to_fallback: > apple_name = None > if apple_additions(): >- apple_name = VersionNameMap.map(self.host.platform).to_name(version, platform=IOSPort.port_name, table=INTERNAL_TABLE) >+ apple_name = VersionNameMap(platform=IOSPort.port_name).to_name(version, table=INTERNAL_TABLE) > if apple_name: > expectations.append(self._apple_baseline_path('{}-{}'.format(IOSPort.port_name, apple_name.lower().replace(' ', '')))) > expectations.append(self._webkit_baseline_path('{}-{}'.format(IOSPort.port_name, version.major))) >Index: Tools/Scripts/webkitpy/port/mac.py >=================================================================== >--- Tools/Scripts/webkitpy/port/mac.py (revision 231595) >+++ Tools/Scripts/webkitpy/port/mac.py (working copy) >@@ -55,7 +55,7 @@ class MacPort(DarwinPort): > > def __init__(self, host, port_name, **kwargs): > DarwinPort.__init__(self, host, port_name, **kwargs) >- version_name_map = VersionNameMap.map(host.platform) >+ version_name_map = VersionNameMap(platform=host.platform.os_name) > self._os_version = None > split_port_name = port_name.split('-') > if len(split_port_name) > 1 and split_port_name[1] != 'wk2': >@@ -72,7 +72,7 @@ class MacPort(DarwinPort): > @memoized > def default_baseline_search_path(self): > versions_to_fallback = [] >- version_name_map = VersionNameMap.map(self.host.platform) >+ version_name_map = VersionNameMap(platform=self.port_name) > > if self._os_version == self.CURRENT_VERSION: > versions_to_fallback = [self.CURRENT_VERSION] >@@ -90,12 +90,12 @@ class MacPort(DarwinPort): > > expectations = [] > for version in versions_to_fallback: >- version_name = version_name_map.to_name(version, platform=self.port_name) >+ version_name = version_name_map.to_name(version) > if version_name: > standardized_version_name = version_name.lower().replace(' ', '') > apple_name = None > if apple_additions(): >- apple_name = version_name_map.to_name(version, platform=self.port_name, table=INTERNAL_TABLE) >+ apple_name = version_name_map.to_name(version, table=INTERNAL_TABLE) > > if apple_name: > expectations.append(self._apple_baseline_path('mac-{}-{}'.format(apple_name.lower().replace(' ', ''), wk_string))) >@@ -120,16 +120,16 @@ class MacPort(DarwinPort): > @memoized > def configuration_specifier_macros(self): > config_map = {} >- version_name_map = VersionNameMap.map(self.host.platform) >+ version_name_map = VersionNameMap(platform=self.port_name) > for version in self._allowed_versions(): > version_names = [] > for newer in self._allowed_versions()[self._allowed_versions().index(version):]: >- version_name = version_name_map.to_name(newer, platform=self.port_name) >+ version_name = version_name_map.to_name(newer) > if not version_name: >- version_name = version_name_map.to_name(newer, platform=self.port_name, table=INTERNAL_TABLE) >+ version_name = version_name_map.to_name(newer, table=INTERNAL_TABLE) > version_names.append(version_name.lower().replace(' ', '')) > for table in [PUBLIC_TABLE, INTERNAL_TABLE]: >- version_name = version_name_map.to_name(version, platform=self.port_name, table=table) >+ version_name = version_name_map.to_name(version, table=table) > if not version_name: > continue > config_map[version_name.lower().replace(' ', '') + '+'] = version_names >Index: Tools/Scripts/webkitpy/port/mac_unittest.py >=================================================================== >--- Tools/Scripts/webkitpy/port/mac_unittest.py (revision 231595) >+++ Tools/Scripts/webkitpy/port/mac_unittest.py (working copy) >@@ -160,19 +160,19 @@ class MacTest(darwin_testcase.DarwinTest > def test_factory_with_future_version(self): > port = self.make_port(options=MockOptions(webkit_test_runner=True), os_version=MacTest.FUTURE_VERSION, os_name='mac', port_name='mac') > self.assertEqual(port.driver_name(), 'WebKitTestRunner') >- self.assertEqual(port.version_name(), VersionNameMap().to_name(MacPort.CURRENT_VERSION, platform=MacPort.port_name)) >+ self.assertEqual(port.version_name(), VersionNameMap(platform=MacPort.port_name).to_name(MacPort.CURRENT_VERSION)) > > port = self.make_port(options=MockOptions(webkit_test_runner=False), os_version=MacTest.FUTURE_VERSION, os_name='mac', port_name='mac') > self.assertEqual(port.driver_name(), 'DumpRenderTree') >- self.assertEqual(port.version_name(), VersionNameMap().to_name(MacPort.CURRENT_VERSION, platform=MacPort.port_name)) >+ self.assertEqual(port.version_name(), VersionNameMap(platform=MacPort.port_name).to_name(MacPort.CURRENT_VERSION)) > > port = self.make_port(options=MockOptions(webkit_test_runner=False), os_version=MacTest.FUTURE_VERSION, os_name='mac', port_name='mac-wk2') > self.assertEqual(port.driver_name(), 'WebKitTestRunner') >- self.assertEqual(port.version_name(), VersionNameMap().to_name(MacPort.CURRENT_VERSION, platform=MacPort.port_name)) >+ self.assertEqual(port.version_name(), VersionNameMap(platform=MacPort.port_name).to_name(MacPort.CURRENT_VERSION)) > > port = self.make_port(options=MockOptions(webkit_test_runner=True), os_version=MacTest.FUTURE_VERSION, os_name='mac', port_name='mac-wk2') > self.assertEqual(port.driver_name(), 'WebKitTestRunner') >- self.assertEqual(port.version_name(), VersionNameMap().to_name(MacPort.CURRENT_VERSION, platform=MacPort.port_name)) >+ self.assertEqual(port.version_name(), VersionNameMap(platform=MacPort.port_name).to_name(MacPort.CURRENT_VERSION)) > > def test_factory_with_future_version_and_apple_additions(self): > with port_testcase.bind_mock_apple_additions(): >Index: Tools/Scripts/webkitpy/port/port_testcase.py >=================================================================== >--- Tools/Scripts/webkitpy/port/port_testcase.py (revision 231595) >+++ Tools/Scripts/webkitpy/port/port_testcase.py (working copy) >@@ -88,22 +88,18 @@ def bind_mock_apple_additions(): > return '/additional_testing_path/' > > @staticmethod >- def version_name_mapping(platform=None): >- result = VersionNameMap(platform) >- result.mapping[INTERNAL_TABLE] = {} >- for platform in result.mapping[PUBLIC_TABLE]: >- result.mapping[INTERNAL_TABLE][platform] = {} >- for name, version in result.mapping[PUBLIC_TABLE][platform].iteritems(): >- result.mapping[INTERNAL_TABLE][platform]['add-' + name] = version >- return result >+ def insert_version_name_mapping(version_name_map): >+ version_name_map.mapping[INTERNAL_TABLE] = {} >+ for platform in version_name_map.mapping[PUBLIC_TABLE]: >+ version_name_map.mapping[INTERNAL_TABLE][platform] = {} >+ for name, version in version_name_map.mapping[PUBLIC_TABLE][platform].iteritems(): >+ version_name_map.mapping[INTERNAL_TABLE][platform]['add-' + name] = version > > # 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): >Index: Tools/Scripts/webkitpy/port/test.py >=================================================================== >--- Tools/Scripts/webkitpy/port/test.py (revision 231595) >+++ Tools/Scripts/webkitpy/port/test.py (working copy) >@@ -376,12 +376,12 @@ class TestPort(Port): > 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] >+ self._os_version = VersionNameMap(platform=self.host.platform.os_name).from_name(self._name.split('-')[2])[1] > > 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) >+ return VersionNameMap(platform=self._operating_system).to_name(self._os_version, table=PUBLIC_TABLE) > > def default_pixel_tests(self): > return True >Index: Tools/Scripts/webkitpy/port/win.py >=================================================================== >--- Tools/Scripts/webkitpy/port/win.py (revision 231595) >+++ Tools/Scripts/webkitpy/port/win.py (working copy) >@@ -92,7 +92,7 @@ class WinPort(ApplePort): > 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] >+ self._os_version = VersionNameMap(platform=host.platform.os_name).from_name(port_name.split('-')[1])[1] > else: > self._os_version = self.host.platform.os_version > >@@ -111,13 +111,13 @@ class WinPort(ApplePort): > return expected_text != actual_text > > def default_baseline_search_path(self): >- version_name_map = VersionNameMap.map(self.host.platform) >+ version_name_map = VersionNameMap(platform=self.port_name) > if self._os_version < self.VERSION_MIN or self._os_version > self.VERSION_MAX: > fallback_versions = [self._os_version] > else: >- sorted_versions = sorted(version_name_map.mapping_for_platform(platform=self.port_name).values()) >+ sorted_versions = sorted(version_name_map.mapping_for_platform().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 = ['win-' + version_name_map.to_name(version).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. >@@ -461,13 +461,13 @@ class WinCairoPort(WinPort): > TEST_PATH_SEPARATOR = os.sep > > def default_baseline_search_path(self): >- version_name_map = VersionNameMap.map(self.host.platform) >+ version_name_map = VersionNameMap(platform=self.port_name) > if self._os_version < self.VERSION_MIN or self._os_version > self.VERSION_MAX: > fallback_versions = [self._os_version] > else: >- sorted_versions = sorted(version_name_map.mapping_for_platform(platform=self.port_name).values()) >+ sorted_versions = sorted(version_name_map.mapping_for_platform().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 = ['wincairo-' + version_name_map.to_name(version).lower().replace(' ', '') for version in fallback_versions] > fallback_names.append('wincairo') > return map(self._webkit_baseline_path, fallback_names) > >Index: Tools/Scripts/webkitpy/port/win_unittest.py >=================================================================== >--- Tools/Scripts/webkitpy/port/win_unittest.py (revision 231595) >+++ Tools/Scripts/webkitpy/port/win_unittest.py (working copy) >@@ -71,7 +71,7 @@ class WinPortTest(port_testcase.PortTest > 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_name(), VersionNameMap.map().to_name(expected_version, platform='win', table=PUBLIC_TABLE)) >+ self.assertEqual(port.version_name(), VersionNameMap(platform='win').to_name(expected_version, table=PUBLIC_TABLE)) > > def test_versions(self): > self._assert_version('win-xp', Version.from_name('XP')) >Index: Tools/Scripts/webkitpy/xcode/device_type.py >=================================================================== >--- Tools/Scripts/webkitpy/xcode/device_type.py (revision 231595) >+++ Tools/Scripts/webkitpy/xcode/device_type.py (working copy) >@@ -111,7 +111,7 @@ class DeviceType(object): > return '{hardware_family}{hardware_type} running {version}'.format( > hardware_family=self.hardware_family if self.hardware_family else 'Device', > hardware_type=' {}'.format(self.hardware_type) if self.hardware_type else '', >- version=VersionNameMap.map().to_name(self.software_version, platform=self.software_variant.lower()) if self.software_version else self.software_variant, >+ version=VersionNameMap(platform=self.software_variant.lower()).to_name(self.software_version) if self.software_version else self.software_variant, > ) > > # This technique of matching treats 'None' a wild-card.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
jbedard
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185387
:
339775
| 340091