⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 238672 in webkit


Ignore:
Timestamp:
Nov 29, 2018, 10:00:14 AM (8 years ago)
Author:
Jonathan Bedard
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.

Location:
trunk/Tools
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r238661 r238672  
     12018-11-29  Jonathan Bedard  <jbedard@apple.com>
     2
     3        webkitpy: Unify ios_version/watchos_version code
     4        https://bugs.webkit.org/show_bug.cgi?id=192153
     5        <rdar://problem/46343642>
     6
     7        Reviewed by Lucas Forschler.
     8
     9        Treating watchOS and iOS versions differently makes it harder to share code between the similar ports.
     10
     11        * Scripts/webkitpy/port/device_port.py:
     12        (DevicePort):
     13        (DevicePort.device_version): Added.
     14        * Scripts/webkitpy/port/ios.py:
     15        (IOSPort.default_baseline_search_path): Use device_version() instead of ios_version().
     16        (IOSPort.ios_version): Deleted.
     17        * Scripts/webkitpy/port/ios_device.py:
     18        (IOSDevicePort.device_version): Renamed from ios_version().
     19        (IOSDevicePort.ios_version): Deleted.
     20        * Scripts/webkitpy/port/ios_simulator.py:
     21        (IOSSimulatorPort.device_version): Renamed from ios_version().
     22        (IOSSimulatorPort.default_child_processes.booted_ios_devices_filter): Use device_version() instead of ios_version().
     23        (IOSSimulatorPort._create_devices): Ditto.
     24        (IOSSimulatorPort.check_sys_deps): Ditto.
     25        (IOSSimulatorPort.ios_version): Deleted.
     26        * Scripts/webkitpy/port/watch.py:
     27        (WatchPort.default_baseline_search_path): Use device_version() instead of watchos_version().
     28        (WatchPort.watchos_version): Deleted.
     29        * Scripts/webkitpy/port/watch_device.py:
     30        (WatchDevicePort.device_version): Renamed from watchos_version().
     31        (WatchDevicePort.watchos_version): Deleted.
     32        * Scripts/webkitpy/port/watch_simulator.py:
     33        (WatchSimulatorPort.device_version): Renamed from watchos_version().
     34        (WatchSimulatorPort.default_child_processes.filter_booted_watchos_devices): Use device_version() instead of watchos_version().
     35        (WatchSimulatorPort._create_devices): Ditto.
     36        (WatchSimulatorPort.check_sys_deps): Ditto.
     37        (WatchSimulatorPort.watchos_version): Deleted.
     38
    1392018-11-28  Wenson Hsieh  <wenson_hsieh@apple.com>
    240
  • trunk/Tools/Scripts/webkitpy/port/device_port.py

    r238177 r238672  
    161161        env['XML_CATALOG_FILES'] = ''  # work around missing /etc/catalog <rdar://problem/4292995>
    162162        return env
     163
     164    def device_version(self):
     165        raise NotImplementedError
  • trunk/Tools/Scripts/webkitpy/port/ios.py

    r238177 r238672  
    5757
    5858        versions_to_fallback = []
    59         if self.ios_version().major == self.CURRENT_VERSION.major:
     59        if self.device_version().major == self.CURRENT_VERSION.major:
    6060            versions_to_fallback = [self.CURRENT_VERSION]
    61         elif self.ios_version():
    62             temp_version = Version(self.ios_version().major)
     61        elif self.device_version():
     62            temp_version = Version(self.device_version().major)
    6363            while temp_version != self.CURRENT_VERSION:
    6464                versions_to_fallback.append(Version.from_iterable(temp_version))
     
    110110    def test_expectations_file_position(self):
    111111        return 4
    112 
    113     def ios_version(self):
    114         raise NotImplementedError
  • trunk/Tools/Scripts/webkitpy/port/ios_device.py

    r238177 r238672  
    8888
    8989    @memoized
    90     def ios_version(self):
     90    def device_version(self):
    9191        if self.get_option('version'):
    9292            return Version.from_string(self.get_option('version'))
  • trunk/Tools/Scripts/webkitpy/port/ios_simulator.py

    r238177 r238672  
    6161
    6262    @memoized
    63     def ios_version(self):
     63    def device_version(self):
    6464        if self.get_option('version'):
    6565            return Version.from_string(self.get_option('version'))
     
    7171            if not device.platform_device.is_booted_or_booting():
    7272                return False
    73             return device.platform_device.device_type in DeviceType(software_variant='iOS',
    74                                                                     software_version=self.ios_version())
     73            return device.platform_device.device_type in DeviceType(software_variant='iOS', software_version=self.device_version())
    7574
    7675        if not self.get_option('dedicated_simulators', False):
     
    8584    def _create_devices(self, device_class):
    8685        self._set_device_class(device_class)
    87         device_type = DeviceType.from_string(self._device_class, self.ios_version())
     86        device_type = DeviceType.from_string(self._device_class, self.device_version())
    8887
    8988        _log.debug('\nCreating devices for {}'.format(device_type))
     
    129128
    130129    def check_sys_deps(self):
    131         target_device_type = DeviceType(software_variant='iOS', software_version=self.ios_version())
     130        target_device_type = DeviceType(software_variant='iOS', software_version=self.device_version())
    132131        for device in SimulatedDeviceManager.available_devices(self.host):
    133132            if device.platform_device.device_type in target_device_type:
  • trunk/Tools/Scripts/webkitpy/port/watch.py

    r238590 r238672  
    6060    def default_baseline_search_path(self):
    6161        versions_to_fallback = []
    62         if self.watchos_version() == self.CURRENT_VERSION:
     62        if self.device_version() == self.CURRENT_VERSION:
    6363            versions_to_fallback = [self.CURRENT_VERSION]
    64         elif self.watchos_version():
    65             temp_version = Version(self.watchos_version().major)
     64        elif self.device_version():
     65            temp_version = Version(self.device_version().major)
    6666            while temp_version.major != self.CURRENT_VERSION.major:
    6767                versions_to_fallback.append(Version.from_iterable(temp_version))
     
    9898
    9999        return expectations
    100 
    101     def watchos_version(self):
    102         # The implementation of this function differs between on-device and simulator testing.
    103         raise NotImplementedError
  • trunk/Tools/Scripts/webkitpy/port/watch_device.py

    r238590 r238672  
    8686
    8787    @memoized
    88     def watchos_version(self):
     88    def device_version(self):
    8989        if self.get_option('version'):
    9090            return Version.from_string(self.get_option('version'))
  • trunk/Tools/Scripts/webkitpy/port/watch_simulator.py

    r238590 r238672  
    6363
    6464    @memoized
    65     def watchos_version(self):
     65    def device_version(self):
    6666        if self.get_option('version'):
    6767            return Version.from_string(self.get_option('version'))
     
    8484            if not device.platform_device.is_booted_or_booting():
    8585                return False
    86             return device.platform_device.device_type in DeviceType(software_variant='watchOS', software_version=self.watchos_version())
     86            return device.platform_device.device_type in DeviceType(software_variant='watchOS', software_version=self.device_version())
    8787
    8888        if not self.get_option('dedicated_simulators', False):
     
    9797    def _create_devices(self, device_class):
    9898        self._set_device_class(device_class)
    99         device_type = DeviceType.from_string(self._device_class, self.watchos_version())
     99        device_type = DeviceType.from_string(self._device_class, self.device_version())
    100100
    101101        _log.debug('\nCreating devices for {}'.format(device_type))
     
    113113
    114114    def check_sys_deps(self):
    115         target_device_type = DeviceType(software_variant='watchOS', software_version=self.watchos_version())
     115        target_device_type = DeviceType(software_variant='watchOS', software_version=self.device_version())
    116116        for device in SimulatedDeviceManager.available_devices(self.host):
    117117            if device.platform_device.device_type in target_device_type:
Note: See TracChangeset for help on using the changeset viewer.