WebKit Bugzilla
Attachment 356617 Details for
Bug 192409
: webkitpy: Ignore case when comparing device types
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192409-20181205103044.patch (text/plain), 5.05 KB, created by
Jonathan Bedard
on 2018-12-05 10:30:45 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Jonathan Bedard
Created:
2018-12-05 10:30:45 PST
Size:
5.05 KB
patch
obsolete
>Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 238897) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,21 @@ >+2018-12-05 Jonathan Bedard <jbedard@apple.com> >+ >+ webkitpy: Ignore case when comparing device types >+ https://bugs.webkit.org/show_bug.cgi?id=192409 >+ <rdar://problem/46491558> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This allows DeviceTypes constructed with lowercase strings to correctly compare >+ against DeviceTypes coming form the simulator runtime. >+ >+ * Scripts/webkitpy/xcode/device_type.py: >+ (DeviceType.__eq__): >+ (DeviceType.__contains__): >+ * Scripts/webkitpy/xcode/device_type_unittest.py: >+ (DeviceTypeTest): >+ (DeviceTypeTest.test_comparsion_lower_case): >+ > 2018-12-05 Alicia Boya GarcÃa <aboya@igalia.com> > > [MSE][GStreamer] Remove the AppendPipeline state machine >Index: Tools/Scripts/webkitpy/xcode/device_type.py >=================================================================== >--- Tools/Scripts/webkitpy/xcode/device_type.py (revision 238895) >+++ Tools/Scripts/webkitpy/xcode/device_type.py (working copy) >@@ -117,11 +117,11 @@ class DeviceType(object): > # This technique of matching treats 'None' a wild-card. > def __eq__(self, other): > assert isinstance(other, DeviceType) >- if self.hardware_family is not None and other.hardware_family is not None and self.hardware_family != other.hardware_family: >+ if self.hardware_family is not None and other.hardware_family is not None and self.hardware_family.lower() != other.hardware_family.lower(): > return False >- if self.hardware_type is not None and other.hardware_type is not None and self.hardware_type != other.hardware_type: >+ if self.hardware_type is not None and other.hardware_type is not None and self.hardware_type.lower() != other.hardware_type.lower(): > return False >- if self.software_variant is not None and other.software_variant is not None and self.software_variant != other.software_variant: >+ if self.software_variant is not None and other.software_variant is not None and self.software_variant.lower() != other.software_variant.lower(): > return False > if self.software_version is not None and other.software_version is not None and self.software_version != other.software_version: > return False >@@ -129,11 +129,11 @@ class DeviceType(object): > > def __contains__(self, other): > assert isinstance(other, DeviceType) >- if self.hardware_family is not None and self.hardware_family != other.hardware_family: >+ if self.hardware_family is not None and (not other.hardware_family or self.hardware_family.lower() != other.hardware_family.lower()): > return False >- if self.hardware_type is not None and self.hardware_type != other.hardware_type: >+ if self.hardware_type is not None and (not other.hardware_type or self.hardware_type.lower() != other.hardware_type.lower()): > return False >- if self.software_variant is not None and self.software_variant != other.software_variant: >+ if self.software_variant is not None and (not other.software_variant or self.software_variant.lower() != other.software_variant.lower()): > return False > if self.software_version is not None and other.software_version is not None and not other.software_version in self.software_version: > return False >Index: Tools/Scripts/webkitpy/xcode/device_type_unittest.py >=================================================================== >--- Tools/Scripts/webkitpy/xcode/device_type_unittest.py (revision 238895) >+++ Tools/Scripts/webkitpy/xcode/device_type_unittest.py (working copy) >@@ -143,3 +143,15 @@ class DeviceTypeTest(unittest.TestCase): > self.assertFalse(DeviceType.from_string('iPhone') in DeviceType.from_string('iPhone 6s')) > self.assertTrue(DeviceType.from_string('iPhone', Version(11, 1)) in DeviceType.from_string('iPhone', Version(11))) > self.assertFalse(DeviceType.from_string('iPhone', Version(11)) in DeviceType.from_string('iPhone', Version(11, 1))) >+ >+ def test_comparsion_lower_case(self): >+ self.assertEqual(DeviceType.from_string('iphone X'), DeviceType.from_string('iPhone')) >+ self.assertEqual(DeviceType.from_string('iphone'), DeviceType.from_string('iPhone X')) >+ self.assertEqual(DeviceType.from_string('iPhone X'), DeviceType.from_string('iphone')) >+ self.assertEqual(DeviceType.from_string('iPhone'), DeviceType.from_string('iphone X')) >+ self.assertEqual(DeviceType.from_string('iphone X'), DeviceType.from_string('iphone')) >+ self.assertEqual(DeviceType.from_string('iphone'), DeviceType.from_string('iphone X')) >+ >+ self.assertTrue(DeviceType.from_string('iphone 6s') in DeviceType.from_string('iPhone')) >+ self.assertTrue(DeviceType.from_string('iPhone 6s') in DeviceType.from_string('iphone')) >+ self.assertTrue(DeviceType.from_string('iphone 6s') in DeviceType.from_string('iphone'))
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192409
:
356617
|
356620
|
356748