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

Changeset 280622 in webkit


Ignore:
Timestamp:
Aug 3, 2021, 4:40:10 PM (5 years ago)
Author:
Jonathan Bedard
Message:

[webkitpy] Handle case where no existing simulators are defined
https://bugs.webkit.org/show_bug.cgi?id=228758
<rdar://problem/81484040>

Reviewed by Ryan Haddad.

  • Scripts/webkitpy/xcode/simulated_device.py:

(SimulatedDeviceManager._disambiguate_device_type): If there are no available devices,
find the newest device identifier which matches the requested type.

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r280621 r280622  
     12021-08-03  Jonathan Bedard  <jbedard@apple.com>
     2
     3        [webkitpy] Handle case where no existing simulators are defined
     4        https://bugs.webkit.org/show_bug.cgi?id=228758
     5        <rdar://problem/81484040>
     6
     7        Reviewed by Ryan Haddad.
     8
     9        * Scripts/webkitpy/xcode/simulated_device.py:
     10        (SimulatedDeviceManager._disambiguate_device_type): If there are no available devices,
     11        find the newest device identifier which matches the requested type.
     12
    1132021-08-03  Jonathan Bedard  <jbedard@apple.com>
    214
  • trunk/Tools/Scripts/webkitpy/xcode/simulated_device.py

    r280618 r280622  
    244244        if full_device_type.hardware_type is None:
    245245            # Again, we use the existing devices to determine a legal hardware type
    246             for name in SimulatedDeviceManager._device_identifier_to_name.values():
    247                 type_from_name = DeviceType.from_string(name)
    248                 if type_from_name == full_device_type:
    249                     full_device_type.hardware_type = type_from_name.hardware_type
     246            for device in SimulatedDeviceManager.AVAILABLE_DEVICES:
     247                if device.device_type == full_device_type:
     248                    full_device_type.hardware_type = device.device_type.hardware_type
     249                    break
     250
     251        if not full_device_type.hardware_family or not full_device_type.hardware_type:
     252            # If we couldn't define a device with existing devices, pick the newest matching device type
     253            for _, type_name in reversed(SimulatedDeviceManager._device_identifier_to_name.items()):
     254                candidate = DeviceType.from_string(type_name)
     255                if candidate == full_device_type:
     256                    full_device_type = candidate
    250257                    break
    251258
Note: See TracChangeset for help on using the changeset viewer.