- Revision
- 238672
- Author
- [email protected]
- Date
- 2018-11-29 10:00:14 -0800 (Thu, 29 Nov 2018)
Log Message
webkitpy: Unify ios_version/watchos_version code
https://bugs.webkit.org/show_bug.cgi?id=192153
<rdar://problem/46343642>
Reviewed by Lucas Forschler.
Treating watchOS and iOS versions differently makes it harder to share code between the similar ports.
* Scripts/webkitpy/port/device_port.py:
(DevicePort):
(DevicePort.device_version): Added.
* Scripts/webkitpy/port/ios.py:
(IOSPort.default_baseline_search_path): Use device_version() instead of ios_version().
(IOSPort.ios_version): Deleted.
* Scripts/webkitpy/port/ios_device.py:
(IOSDevicePort.device_version): Renamed from ios_version().
(IOSDevicePort.ios_version): Deleted.
* Scripts/webkitpy/port/ios_simulator.py:
(IOSSimulatorPort.device_version): Renamed from ios_version().
(IOSSimulatorPort.default_child_processes.booted_ios_devices_filter): Use device_version() instead of ios_version().
(IOSSimulatorPort._create_devices): Ditto.
(IOSSimulatorPort.check_sys_deps): Ditto.
(IOSSimulatorPort.ios_version): Deleted.
* Scripts/webkitpy/port/watch.py:
(WatchPort.default_baseline_search_path): Use device_version() instead of watchos_version().
(WatchPort.watchos_version): Deleted.
* Scripts/webkitpy/port/watch_device.py:
(WatchDevicePort.device_version): Renamed from watchos_version().
(WatchDevicePort.watchos_version): Deleted.
* Scripts/webkitpy/port/watch_simulator.py:
(WatchSimulatorPort.device_version): Renamed from watchos_version().
(WatchSimulatorPort.default_child_processes.filter_booted_watchos_devices): Use device_version() instead of watchos_version().
(WatchSimulatorPort._create_devices): Ditto.
(WatchSimulatorPort.check_sys_deps): Ditto.
(WatchSimulatorPort.watchos_version): Deleted.
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (238671 => 238672)
--- trunk/Tools/ChangeLog 2018-11-29 17:50:21 UTC (rev 238671)
+++ trunk/Tools/ChangeLog 2018-11-29 18:00:14 UTC (rev 238672)
@@ -1,3 +1,41 @@
+2018-11-29 Jonathan Bedard <[email protected]>
+
+ webkitpy: Unify ios_version/watchos_version code
+ https://bugs.webkit.org/show_bug.cgi?id=192153
+ <rdar://problem/46343642>
+
+ Reviewed by Lucas Forschler.
+
+ Treating watchOS and iOS versions differently makes it harder to share code between the similar ports.
+
+ * Scripts/webkitpy/port/device_port.py:
+ (DevicePort):
+ (DevicePort.device_version): Added.
+ * Scripts/webkitpy/port/ios.py:
+ (IOSPort.default_baseline_search_path): Use device_version() instead of ios_version().
+ (IOSPort.ios_version): Deleted.
+ * Scripts/webkitpy/port/ios_device.py:
+ (IOSDevicePort.device_version): Renamed from ios_version().
+ (IOSDevicePort.ios_version): Deleted.
+ * Scripts/webkitpy/port/ios_simulator.py:
+ (IOSSimulatorPort.device_version): Renamed from ios_version().
+ (IOSSimulatorPort.default_child_processes.booted_ios_devices_filter): Use device_version() instead of ios_version().
+ (IOSSimulatorPort._create_devices): Ditto.
+ (IOSSimulatorPort.check_sys_deps): Ditto.
+ (IOSSimulatorPort.ios_version): Deleted.
+ * Scripts/webkitpy/port/watch.py:
+ (WatchPort.default_baseline_search_path): Use device_version() instead of watchos_version().
+ (WatchPort.watchos_version): Deleted.
+ * Scripts/webkitpy/port/watch_device.py:
+ (WatchDevicePort.device_version): Renamed from watchos_version().
+ (WatchDevicePort.watchos_version): Deleted.
+ * Scripts/webkitpy/port/watch_simulator.py:
+ (WatchSimulatorPort.device_version): Renamed from watchos_version().
+ (WatchSimulatorPort.default_child_processes.filter_booted_watchos_devices): Use device_version() instead of watchos_version().
+ (WatchSimulatorPort._create_devices): Ditto.
+ (WatchSimulatorPort.check_sys_deps): Ditto.
+ (WatchSimulatorPort.watchos_version): Deleted.
+
2018-11-28 Wenson Hsieh <[email protected]>
[iOSMac] Dropping text selections from web content into editable elements crashes the web process
Modified: trunk/Tools/Scripts/webkitpy/port/device_port.py (238671 => 238672)
--- trunk/Tools/Scripts/webkitpy/port/device_port.py 2018-11-29 17:50:21 UTC (rev 238671)
+++ trunk/Tools/Scripts/webkitpy/port/device_port.py 2018-11-29 18:00:14 UTC (rev 238672)
@@ -160,3 +160,6 @@
self._append_value_colon_separated(env, '__XPC_DYLD_INSERT_LIBRARIES', '/usr/lib/libgmalloc.dylib')
env['XML_CATALOG_FILES'] = '' # work around missing /etc/catalog <rdar://problem/4292995>
return env
+
+ def device_version(self):
+ raise NotImplementedError
Modified: trunk/Tools/Scripts/webkitpy/port/ios.py (238671 => 238672)
--- trunk/Tools/Scripts/webkitpy/port/ios.py 2018-11-29 17:50:21 UTC (rev 238671)
+++ trunk/Tools/Scripts/webkitpy/port/ios.py 2018-11-29 18:00:14 UTC (rev 238672)
@@ -56,10 +56,10 @@
wk_string = 'wk2'
versions_to_fallback = []
- if self.ios_version().major == self.CURRENT_VERSION.major:
+ if self.device_version().major == self.CURRENT_VERSION.major:
versions_to_fallback = [self.CURRENT_VERSION]
- elif self.ios_version():
- temp_version = Version(self.ios_version().major)
+ elif self.device_version():
+ temp_version = Version(self.device_version().major)
while temp_version != self.CURRENT_VERSION:
versions_to_fallback.append(Version.from_iterable(temp_version))
if temp_version < self.CURRENT_VERSION:
@@ -109,6 +109,3 @@
def test_expectations_file_position(self):
return 4
-
- def ios_version(self):
- raise NotImplementedError
Modified: trunk/Tools/Scripts/webkitpy/port/ios_device.py (238671 => 238672)
--- trunk/Tools/Scripts/webkitpy/port/ios_device.py 2018-11-29 17:50:21 UTC (rev 238671)
+++ trunk/Tools/Scripts/webkitpy/port/ios_device.py 2018-11-29 18:00:14 UTC (rev 238672)
@@ -87,7 +87,7 @@
return (stderr, None)
@memoized
- def ios_version(self):
+ def device_version(self):
if self.get_option('version'):
return Version.from_string(self.get_option('version'))
Modified: trunk/Tools/Scripts/webkitpy/port/ios_simulator.py (238671 => 238672)
--- trunk/Tools/Scripts/webkitpy/port/ios_simulator.py 2018-11-29 17:50:21 UTC (rev 238671)
+++ trunk/Tools/Scripts/webkitpy/port/ios_simulator.py 2018-11-29 18:00:14 UTC (rev 238672)
@@ -60,7 +60,7 @@
return None
@memoized
- def ios_version(self):
+ def device_version(self):
if self.get_option('version'):
return Version.from_string(self.get_option('version'))
return IOSSimulatorPort._version_from_name(self._name) if IOSSimulatorPort._version_from_name(self._name) else self.host.platform.xcode_sdk_version('iphonesimulator')
@@ -70,8 +70,7 @@
def booted_ios_devices_filter(device):
if not device.platform_device.is_booted_or_booting():
return False
- return device.platform_device.device_type in DeviceType(software_variant='iOS',
- software_version=self.ios_version())
+ return device.platform_device.device_type in DeviceType(software_variant='iOS', software_version=self.device_version())
if not self.get_option('dedicated_simulators', False):
num_booted_sims = len(SimulatedDeviceManager.device_by_filter(booted_ios_devices_filter, host=self.host))
@@ -84,7 +83,7 @@
def _create_devices(self, device_class):
self._set_device_class(device_class)
- device_type = DeviceType.from_string(self._device_class, self.ios_version())
+ device_type = DeviceType.from_string(self._device_class, self.device_version())
_log.debug('\nCreating devices for {}'.format(device_type))
@@ -128,7 +127,7 @@
return 'ios-simulator'
def check_sys_deps(self):
- target_device_type = DeviceType(software_variant='iOS', software_version=self.ios_version())
+ target_device_type = DeviceType(software_variant='iOS', software_version=self.device_version())
for device in SimulatedDeviceManager.available_devices(self.host):
if device.platform_device.device_type in target_device_type:
return super(IOSSimulatorPort, self).check_sys_deps()
Modified: trunk/Tools/Scripts/webkitpy/port/watch.py (238671 => 238672)
--- trunk/Tools/Scripts/webkitpy/port/watch.py 2018-11-29 17:50:21 UTC (rev 238671)
+++ trunk/Tools/Scripts/webkitpy/port/watch.py 2018-11-29 18:00:14 UTC (rev 238672)
@@ -59,10 +59,10 @@
@memoized
def default_baseline_search_path(self):
versions_to_fallback = []
- if self.watchos_version() == self.CURRENT_VERSION:
+ if self.device_version() == self.CURRENT_VERSION:
versions_to_fallback = [self.CURRENT_VERSION]
- elif self.watchos_version():
- temp_version = Version(self.watchos_version().major)
+ elif self.device_version():
+ temp_version = Version(self.device_version().major)
while temp_version.major != self.CURRENT_VERSION.major:
versions_to_fallback.append(Version.from_iterable(temp_version))
if temp_version < self.CURRENT_VERSION:
@@ -97,7 +97,3 @@
expectations.append(self._webkit_baseline_path('wk2'))
return expectations
-
- def watchos_version(self):
- # The implementation of this function differs between on-device and simulator testing.
- raise NotImplementedError
Modified: trunk/Tools/Scripts/webkitpy/port/watch_device.py (238671 => 238672)
--- trunk/Tools/Scripts/webkitpy/port/watch_device.py 2018-11-29 17:50:21 UTC (rev 238671)
+++ trunk/Tools/Scripts/webkitpy/port/watch_device.py 2018-11-29 18:00:14 UTC (rev 238672)
@@ -85,7 +85,7 @@
return (stderr, None)
@memoized
- def watchos_version(self):
+ def device_version(self):
if self.get_option('version'):
return Version.from_string(self.get_option('version'))
Modified: trunk/Tools/Scripts/webkitpy/port/watch_simulator.py (238671 => 238672)
--- trunk/Tools/Scripts/webkitpy/port/watch_simulator.py 2018-11-29 17:50:21 UTC (rev 238671)
+++ trunk/Tools/Scripts/webkitpy/port/watch_simulator.py 2018-11-29 18:00:14 UTC (rev 238672)
@@ -62,7 +62,7 @@
return None
@memoized
- def watchos_version(self):
+ def device_version(self):
if self.get_option('version'):
return Version.from_string(self.get_option('version'))
return WatchSimulatorPort._version_from_name(self._name) or self.host.platform.xcode_sdk_version('watchsimulator')
@@ -83,7 +83,7 @@
def filter_booted_watchos_devices(device):
if not device.platform_device.is_booted_or_booting():
return False
- return device.platform_device.device_type in DeviceType(software_variant='watchOS', software_version=self.watchos_version())
+ return device.platform_device.device_type in DeviceType(software_variant='watchOS', software_version=self.device_version())
if not self.get_option('dedicated_simulators', False):
num_booted_sims = len(SimulatedDeviceManager.device_by_filter(filter_booted_watchos_devices, host=self.host))
@@ -96,7 +96,7 @@
def _create_devices(self, device_class):
self._set_device_class(device_class)
- device_type = DeviceType.from_string(self._device_class, self.watchos_version())
+ device_type = DeviceType.from_string(self._device_class, self.device_version())
_log.debug('\nCreating devices for {}'.format(device_type))
@@ -112,7 +112,7 @@
return 'watchos-simulator'
def check_sys_deps(self):
- target_device_type = DeviceType(software_variant='watchOS', software_version=self.watchos_version())
+ target_device_type = DeviceType(software_variant='watchOS', software_version=self.device_version())
for device in SimulatedDeviceManager.available_devices(self.host):
if device.platform_device.device_type in target_device_type:
return super(WatchSimulatorPort, self).check_sys_deps()