Title: [238940] trunk/Tools
Revision
238940
Author
jbed...@apple.com
Date
2018-12-06 14:09:19 -0800 (Thu, 06 Dec 2018)

Log Message

webkitpy: Create device given lower-case DeviceType
<https://bugs.webkit.org/show_bug.cgi?id=192472>
<rdar://problem/46532650>

Reviewed by Lucas Forschler.

* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDeviceManager._get_device_identifier_for_type): Comparing simctl device identifiers with DeviceTypes
should be letter-case agnostic.
* Scripts/webkitpy/xcode/simulated_device_unittest.py:
(test_lower_case_device_type):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (238939 => 238940)


--- trunk/Tools/ChangeLog	2018-12-06 21:22:19 UTC (rev 238939)
+++ trunk/Tools/ChangeLog	2018-12-06 22:09:19 UTC (rev 238940)
@@ -1,3 +1,17 @@
+2018-12-06  Jonathan Bedard  <jbed...@apple.com>
+
+        webkitpy: Create device given lower-case DeviceType
+        <https://bugs.webkit.org/show_bug.cgi?id=192472>
+        <rdar://problem/46532650>
+
+        Reviewed by Lucas Forschler.
+
+        * Scripts/webkitpy/xcode/simulated_device.py:
+        (SimulatedDeviceManager._get_device_identifier_for_type): Comparing simctl device identifiers with DeviceTypes
+        should be letter-case agnostic.
+        * Scripts/webkitpy/xcode/simulated_device_unittest.py:
+        (test_lower_case_device_type):
+
 2018-12-06  Wenson Hsieh  <wenson_hs...@apple.com>
 
         [iOS] WKWebView should match UITextView behavior when editing text with an RTL keyboard

Modified: trunk/Tools/Scripts/webkitpy/xcode/simulated_device.py (238939 => 238940)


--- trunk/Tools/Scripts/webkitpy/xcode/simulated_device.py	2018-12-06 21:22:19 UTC (rev 238939)
+++ trunk/Tools/Scripts/webkitpy/xcode/simulated_device.py	2018-12-06 22:09:19 UTC (rev 238940)
@@ -229,7 +229,7 @@
     @staticmethod
     def _get_device_identifier_for_type(device_type):
         for type_id, type_name in SimulatedDeviceManager._device_identifier_to_name.iteritems():
-            if type_name == '{} {}'.format(device_type.hardware_family, device_type.hardware_type):
+            if type_name.lower() == '{} {}'.format(device_type.hardware_family.lower(), device_type.hardware_type.lower()):
                 return type_id
         return None
 

Modified: trunk/Tools/Scripts/webkitpy/xcode/simulated_device_unittest.py (238939 => 238940)


--- trunk/Tools/Scripts/webkitpy/xcode/simulated_device_unittest.py	2018-12-06 21:22:19 UTC (rev 238939)
+++ trunk/Tools/Scripts/webkitpy/xcode/simulated_device_unittest.py	2018-12-06 22:09:19 UTC (rev 238940)
@@ -610,6 +610,20 @@
         SimulatedDeviceManager.tear_down(host)
         self.assertIsNone(SimulatedDeviceManager.INITIALIZED_DEVICES)
 
+    def test_lower_case_device_type(self):
+        SimulatedDeviceTest.reset_simulated_device_manager()
+        host = SimulatedDeviceTest.mock_host_for_simctl()
+        SimulatedDeviceManager.available_devices(host)
+
+        SimulatedDeviceManager.initialize_devices(DeviceRequest(DeviceType.from_string('iphone 5s', Version(11))), host=host)
+
+        self.assertEquals(1, len(SimulatedDeviceManager.INITIALIZED_DEVICES))
+        self.assertEquals('34FB476C-6FA0-43C8-8945-1BD7A4EBF0DE', SimulatedDeviceManager.INITIALIZED_DEVICES[0].udid)
+        self.assertEquals(SimulatedDevice.DeviceState.BOOTED, SimulatedDeviceManager.INITIALIZED_DEVICES[0].platform_device.state())
+
+        SimulatedDeviceManager.tear_down(host)
+        self.assertIsNone(SimulatedDeviceManager.INITIALIZED_DEVICES)
+
     @staticmethod
     def change_state_to(device, state):
         assert isinstance(state, int)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to