Title: [229099] trunk/Tools
Revision
229099
Author
[email protected]
Date
2018-02-28 11:34:46 -0800 (Wed, 28 Feb 2018)

Log Message

[webkitpy] Remove concept of 'future' versions (Follow-up fix)
https://bugs.webkit.org/show_bug.cgi?id=183184
<rdar://problem/37958594>

Reviewed by David Kilzer.

The factory also relies on future in a non-obvious way.

* Scripts/webkitpy/common/system/platforminfo.py:
(PlatformInfo.os_version_name): Check both public and internal version mapping
when returning a version name.
* Scripts/webkitpy/common/system/platforminfo_mock.py:
(MockPlatformInfo.os_version_name): Ditto.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (229098 => 229099)


--- trunk/Tools/ChangeLog	2018-02-28 19:14:48 UTC (rev 229098)
+++ trunk/Tools/ChangeLog	2018-02-28 19:34:46 UTC (rev 229099)
@@ -1,3 +1,19 @@
+2018-02-28  Jonathan Bedard  <[email protected]>
+
+        [webkitpy] Remove concept of 'future' versions (Follow-up fix)
+        https://bugs.webkit.org/show_bug.cgi?id=183184
+        <rdar://problem/37958594>
+
+        Reviewed by David Kilzer.
+
+        The factory also relies on future in a non-obvious way.
+
+        * Scripts/webkitpy/common/system/platforminfo.py:
+        (PlatformInfo.os_version_name): Check both public and internal version mapping
+        when returning a version name.
+        * Scripts/webkitpy/common/system/platforminfo_mock.py:
+        (MockPlatformInfo.os_version_name): Ditto.
+
 2018-02-28  Zan Dobersek  <[email protected]>
 
         Unreviewed WPE fixup after r229080.

Modified: trunk/Tools/Scripts/webkitpy/common/system/platforminfo.py (229098 => 229099)


--- trunk/Tools/Scripts/webkitpy/common/system/platforminfo.py	2018-02-28 19:14:48 UTC (rev 229098)
+++ trunk/Tools/Scripts/webkitpy/common/system/platforminfo.py	2018-02-28 19:34:46 UTC (rev 229099)
@@ -32,7 +32,7 @@
 import platform
 
 from webkitpy.common.version import Version
-from webkitpy.common.version_name_map import PUBLIC_TABLE, VersionNameMap
+from webkitpy.common.version_name_map import PUBLIC_TABLE, INTERNAL_TABLE, VersionNameMap
 from webkitpy.common.system.executive import Executive
 
 
@@ -114,10 +114,15 @@
         # Windows-2008ServerR2-6.1.7600
         return self._platform_module.platform()
 
-    def os_version_name(self, table=PUBLIC_TABLE):
+    def os_version_name(self, table=None):
         if not self.os_version:
             return None
-        return VersionNameMap.map(self).to_name(self.os_version, table=table)
+        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)
+        if not version_name:
+            version_name = VersionNameMap.map(self).to_name(self.os_version, table=INTERNAL_TABLE)
+        return version_name
 
     def total_bytes_memory(self):
         if self.is_mac():

Modified: trunk/Tools/Scripts/webkitpy/common/system/platforminfo_mock.py (229098 => 229099)


--- trunk/Tools/Scripts/webkitpy/common/system/platforminfo_mock.py	2018-02-28 19:14:48 UTC (rev 229098)
+++ trunk/Tools/Scripts/webkitpy/common/system/platforminfo_mock.py	2018-02-28 19:34:46 UTC (rev 229099)
@@ -28,7 +28,7 @@
 # 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
+from webkitpy.common.version_name_map import PUBLIC_TABLE, INTERNAL_TABLE, VersionNameMap
 
 
 class MockPlatformInfo(object):
@@ -62,10 +62,15 @@
     def display_name(self):
         return "MockPlatform 1.0"
 
-    def os_version_name(self, table=PUBLIC_TABLE):
+    def os_version_name(self, table=None):
         if not self.os_version:
             return None
-        return VersionNameMap.map(self).to_name(self.os_version, table=table)
+        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)
+        if not version_name:
+            version_name = VersionNameMap.map(self).to_name(self.os_version, table=INTERNAL_TABLE)
+        return version_name
 
     def total_bytes_memory(self):
         return 3 * 1024 * 1024 * 1024  # 3GB is a reasonable amount of ram to mock.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to