Changeset 223447 in webkit
- Timestamp:
- Oct 16, 2017 5:00:40 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r223445 r223447 1 2017-10-16 Andy Estes <aestes@apple.com> 2 3 [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError 4 https://bugs.webkit.org/show_bug.cgi?id=178191 5 <rdar://problem/34906367> 6 7 Reviewed by Tim Horton. 8 9 * http/tests/ssl/applepay/ApplePayError-expected.txt: 10 * http/tests/ssl/applepay/ApplePaySession-expected.txt: 11 * http/tests/ssl/applepay/ApplePaySession.html: 12 1 13 2017-10-16 Alex Christensen <achristensen@webkit.org> 2 14 -
trunk/LayoutTests/http/tests/ssl/applepay/ApplePayError-expected.txt
r220718 r223447 28 28 29 29 SETUP: 30 PASS new ApplePayError('unknown', []) threw exception TypeError: Argument 2 ('contactField') to the ApplePayError constructor must be one of: "phoneNumber", "emailAddress", "name", "phoneticName", "postalAddress", "addressLines", " locality", "postalCode", "administrativeArea", "country", "countryCode".30 PASS new ApplePayError('unknown', []) threw exception TypeError: Argument 2 ('contactField') to the ApplePayError constructor must be one of: "phoneNumber", "emailAddress", "name", "phoneticName", "postalAddress", "addressLines", "subLocality", "locality", "postalCode", "subAdministrativeArea", "administrativeArea", "country", "countryCode". 31 31 32 32 SETUP: 33 PASS new ApplePayError('unknown', '') threw exception TypeError: Argument 2 ('contactField') to the ApplePayError constructor must be one of: "phoneNumber", "emailAddress", "name", "phoneticName", "postalAddress", "addressLines", " locality", "postalCode", "administrativeArea", "country", "countryCode".33 PASS new ApplePayError('unknown', '') threw exception TypeError: Argument 2 ('contactField') to the ApplePayError constructor must be one of: "phoneNumber", "emailAddress", "name", "phoneticName", "postalAddress", "addressLines", "subLocality", "locality", "postalCode", "subAdministrativeArea", "administrativeArea", "country", "countryCode". 34 34 35 35 SETUP: -
trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySession-expected.txt
r223221 r223447 261 261 PASS new ApplePaySession(2, request) did not throw exception. 262 262 263 SETUP: request = validRequest(); request.billingContact = { subLocality: '', subAdministrativeArea: '' }; 264 PASS new ApplePaySession(2, request) did not throw exception. 265 263 266 Testing PaymentRequest.requiredShippingContactFields 264 267 … … 322 325 PASS new ApplePaySession(2, request) did not throw exception. 323 326 327 SETUP: request = validRequest(); request.shippingContact = { subLocality: '', subAdministrativeArea: '' }; 328 PASS new ApplePaySession(2, request) did not throw exception. 329 324 330 Testing PaymentRequest.shippingType 325 331 -
trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySession.html
r223221 r223447 149 149 logAndShouldNotThrow("request = validRequest(); request.billingContact = undefined;", "new ApplePaySession(2, request)") 150 150 logAndShouldNotThrow("request = validRequest(); request.billingContact = { };", "new ApplePaySession(2, request)") 151 logAndShouldNotThrow("request = validRequest(); request.billingContact = { subLocality: '', subAdministrativeArea: '' };", "new ApplePaySession(2, request)") 151 152 152 153 debug("Testing PaymentRequest.requiredShippingContactFields") … … 175 176 logAndShouldNotThrow("request = validRequest(); request.shippingContact = undefined;", "new ApplePaySession(2, request)") 176 177 logAndShouldNotThrow("request = validRequest(); request.shippingContact = { };", "new ApplePaySession(2, request)") 178 logAndShouldNotThrow("request = validRequest(); request.shippingContact = { subLocality: '', subAdministrativeArea: '' };", "new ApplePaySession(2, request)") 177 179 178 180 debug("Testing PaymentRequest.shippingType") -
trunk/Source/WebCore/ChangeLog
r223446 r223447 1 2017-10-16 Andy Estes <aestes@apple.com> 2 3 [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError 4 https://bugs.webkit.org/show_bug.cgi?id=178191 5 <rdar://problem/34906367> 6 7 Reviewed by Tim Horton. 8 9 Added test cases to http/tests/ssl/applepay/ApplePaySession.html. 10 11 * Modules/applepay/ApplePayError.idl: 12 * Modules/applepay/ApplePayPaymentContact.h: 13 * Modules/applepay/ApplePayPaymentContact.idl: 14 * Modules/applepay/ApplePaySessionPaymentRequest.h: 15 * Modules/applepay/cocoa/PaymentContactCocoa.mm: 16 (WebCore::subLocality): 17 (WebCore::setSubLocality): 18 (WebCore::subAdministrativeArea): 19 (WebCore::setSubAdministrativeArea): 20 (WebCore::convert): 21 1 22 2017-10-16 Alex Christensen <achristensen@webkit.org> 2 23 -
trunk/Source/WebCore/Modules/applepay/ApplePayError.idl
r220718 r223447 42 42 "postalAddress", 43 43 "addressLines", 44 "subLocality", 44 45 "locality", 45 46 "postalCode", 47 "subAdministrativeArea", 46 48 "administrativeArea", 47 49 "country", -
trunk/Source/WebCore/Modules/applepay/ApplePayPaymentContact.h
r223221 r223447 42 42 String phoneticFamilyName; 43 43 std::optional<Vector<String>> addressLines; 44 String subLocality; 44 45 String locality; 45 46 String postalCode; 47 String subAdministrativeArea; 46 48 String administrativeArea; 47 49 String country; -
trunk/Source/WebCore/Modules/applepay/ApplePayPaymentContact.idl
r223221 r223447 35 35 [Conditional=APPLE_PAY_SESSION_V3] DOMString phoneticFamilyName; 36 36 sequence<DOMString> addressLines; 37 DOMString subLocality; 37 38 DOMString locality; 38 39 DOMString postalCode; 40 DOMString subAdministrativeArea; 39 41 DOMString administrativeArea; 40 42 DOMString country; -
trunk/Source/WebCore/Modules/applepay/ApplePaySessionPaymentRequest.h
r222921 r223447 168 168 PostalAddress, 169 169 AddressLines, 170 SubLocality, 170 171 Locality, 171 172 PostalCode, 173 SubAdministrativeArea, 172 174 AdministrativeArea, 173 175 Country, -
trunk/Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm
r223221 r223447 47 47 SOFT_LINK_CLASS(PassKit, PKContact) 48 48 49 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101300 50 @interface CNPostalAddress () 51 @property (readonly, copy, NS_NONATOMIC_IOSONLY) NSString *subLocality; 52 @property (readonly, copy, NS_NONATOMIC_IOSONLY) NSString *subAdministrativeArea; 53 @end 54 55 @interface CNMutablePostalAddress () 56 @property (copy, NS_NONATOMIC_IOSONLY) NSString *subLocality; 57 @property (copy, NS_NONATOMIC_IOSONLY) NSString *subAdministrativeArea; 58 @end 59 #endif 60 49 61 namespace WebCore { 62 63 static NSString *subLocality(CNPostalAddress *address) 64 { 65 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101300 66 if (![address respondsToSelector:@selector(subLocality)]) 67 return nil; 68 #endif 69 return address.subLocality; 70 } 71 72 static void setSubLocality(CNMutablePostalAddress *address, NSString *subLocality) 73 { 74 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101300 75 if (![address respondsToSelector:@selector(setSubLocality:)]) 76 return; 77 #endif 78 address.subLocality = subLocality; 79 } 80 81 static NSString *subAdministrativeArea(CNPostalAddress *address) 82 { 83 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101300 84 if (![address respondsToSelector:@selector(subAdministrativeArea)]) 85 return nil; 86 #endif 87 return address.subAdministrativeArea; 88 } 89 90 static void setSubAdministrativeArea(CNMutablePostalAddress *address, NSString *subAdministrativeArea) 91 { 92 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101300 93 if (![address respondsToSelector:@selector(setSubAdministrativeArea:)]) 94 return; 95 #endif 96 address.subAdministrativeArea = subAdministrativeArea; 97 } 50 98 51 99 static RetainPtr<PKContact> convert(unsigned version, const ApplePayPaymentContact& contact) … … 101 149 [address setStreet:builder.toString()]; 102 150 151 if (!contact.subLocality.isEmpty()) 152 setSubLocality(address.get(), contact.subLocality); 103 153 if (!contact.locality.isEmpty()) 104 154 [address setCity:contact.locality]; 105 155 if (!contact.postalCode.isEmpty()) 106 156 [address setPostalCode:contact.postalCode]; 157 if (!contact.subAdministrativeArea.isEmpty()) 158 setSubAdministrativeArea(address.get(), contact.subAdministrativeArea); 107 159 if (!contact.administrativeArea.isEmpty()) 108 160 [address setState:contact.administrativeArea]; … … 141 193 result.addressLines = WTFMove(addressLines); 142 194 } 195 result.subLocality = subLocality(postalAddress); 143 196 result.locality = postalAddress.city; 144 197 result.postalCode = postalAddress.postalCode; 198 result.subAdministrativeArea = subAdministrativeArea(postalAddress); 145 199 result.administrativeArea = postalAddress.state; 146 200 result.country = postalAddress.country; -
trunk/Source/WebKit/ChangeLog
r223444 r223447 1 2017-10-16 Andy Estes <aestes@apple.com> 2 3 [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError 4 https://bugs.webkit.org/show_bug.cgi?id=178191 5 <rdar://problem/34906367> 6 7 Reviewed by Tim Horton. 8 9 * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: 10 (WebKit::toNSError): 11 1 12 2017-10-16 Tim Horton <timothy_horton@apple.com> 2 13 -
trunk/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm
r222921 r223447 64 64 SOFT_LINK_FRAMEWORK(Contacts) 65 65 SOFT_LINK_CONSTANT(Contacts, CNPostalAddressStreetKey, NSString *); 66 SOFT_LINK_CONSTANT(Contacts, CNPostalAddressSubLocalityKey, NSString *); 66 67 SOFT_LINK_CONSTANT(Contacts, CNPostalAddressCityKey, NSString *); 68 SOFT_LINK_CONSTANT(Contacts, CNPostalAddressSubAdministrativeAreaKey, NSString *); 67 69 SOFT_LINK_CONSTANT(Contacts, CNPostalAddressStateKey, NSString *); 68 70 SOFT_LINK_CONSTANT(Contacts, CNPostalAddressPostalCodeKey, NSString *); … … 657 659 break; 658 660 661 case WebCore::PaymentError::ContactField::SubLocality: 662 pkContactField = getPKContactFieldPostalAddress(); 663 postalAddressKey = getCNPostalAddressSubLocalityKey(); 664 break; 665 659 666 case WebCore::PaymentError::ContactField::Locality: 660 667 pkContactField = getPKContactFieldPostalAddress(); … … 665 672 pkContactField = getPKContactFieldPostalAddress(); 666 673 postalAddressKey = getCNPostalAddressPostalCodeKey(); 674 break; 675 676 case WebCore::PaymentError::ContactField::SubAdministrativeArea: 677 pkContactField = getPKContactFieldPostalAddress(); 678 postalAddressKey = getCNPostalAddressSubAdministrativeAreaKey(); 667 679 break; 668 680
Note: See TracChangeset
for help on using the changeset viewer.