Title: [217057] trunk
Revision
217057
Author
[email protected]
Date
2017-05-18 11:57:10 -0700 (Thu, 18 May 2017)

Log Message

Add "countryCode" to ApplePayErrorContactField
https://bugs.webkit.org/show_bug.cgi?id=172264
<rdar://problem/32004909>

Reviewed by Anders Carlsson.

Source/WebCore:

Added ApplePayError tests to http/tests/ssl/applepay/ApplePaySession.html

* Modules/applepay/ApplePayError.idl:
* Modules/applepay/PaymentRequest.h:

Source/WebKit2:

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toNSError):

LayoutTests:

* http/tests/ssl/applepay/ApplePaySession-expected.txt:
* http/tests/ssl/applepay/ApplePaySession.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (217056 => 217057)


--- trunk/LayoutTests/ChangeLog	2017-05-18 18:56:32 UTC (rev 217056)
+++ trunk/LayoutTests/ChangeLog	2017-05-18 18:57:10 UTC (rev 217057)
@@ -1,3 +1,14 @@
+2017-05-18  Andy Estes  <[email protected]>
+
+        Add "countryCode" to ApplePayErrorContactField
+        https://bugs.webkit.org/show_bug.cgi?id=172264
+        <rdar://problem/32004909>
+
+        Reviewed by Anders Carlsson.
+
+        * http/tests/ssl/applepay/ApplePaySession-expected.txt:
+        * http/tests/ssl/applepay/ApplePaySession.html:
+
 2017-05-18  Daniel Bates  <[email protected]>
 
         REGRESSION (r209608): Cross-origin plugin document opened in child window blocked by parent

Modified: trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySession-expected.txt (217056 => 217057)


--- trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySession-expected.txt	2017-05-18 18:56:32 UTC (rev 217056)
+++ trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySession-expected.txt	2017-05-18 18:57:10 UTC (rev 217057)
@@ -414,6 +414,65 @@
 SETUP: request = validRequest(); request.applicationData = { toString: function() { throw '"Error in toString"'; } };
 PASS new ApplePaySession(2, request) threw exception "Error in toString".
 
+Testing ApplePayError
+
+SETUP: 
+PASS new ApplePayError() threw exception TypeError: Not enough arguments.
+
+SETUP: 
+PASS new ApplePayError([]) threw exception TypeError: Argument 1 ('errorCode') to the ApplePayError constructor must be one of: "unknown", "shippingContactInvalid", "billingContactInvalid", "addressUnserviceable".
+
+SETUP: 
+PASS new ApplePayError('') threw exception TypeError: Argument 1 ('errorCode') to the ApplePayError constructor must be one of: "unknown", "shippingContactInvalid", "billingContactInvalid", "addressUnserviceable".
+
+SETUP: 
+PASS new ApplePayError('unknown') did not throw exception.
+
+SETUP: 
+PASS new ApplePayError('shippingContactInvalid') did not throw exception.
+
+SETUP: 
+PASS new ApplePayError('billingContactInvalid') did not throw exception.
+
+SETUP: 
+PASS new ApplePayError('addressUnserviceable') did not throw exception.
+
+SETUP: 
+PASS new ApplePayError('unknown', []) threw exception TypeError: Argument 2 ('contactField') to the ApplePayError constructor must be one of: "phoneNumber", "emailAddress", "name", "postalAddress", "addressLines", "locality", "postalCode", "administrativeArea", "country", "countryCode".
+
+SETUP: 
+PASS new ApplePayError('unknown', '') threw exception TypeError: Argument 2 ('contactField') to the ApplePayError constructor must be one of: "phoneNumber", "emailAddress", "name", "postalAddress", "addressLines", "locality", "postalCode", "administrativeArea", "country", "countryCode".
+
+SETUP: 
+PASS new ApplePayError('unknown', 'phoneNumber') did not throw exception.
+
+SETUP: 
+PASS new ApplePayError('unknown', 'emailAddress') did not throw exception.
+
+SETUP: 
+PASS new ApplePayError('unknown', 'name') did not throw exception.
+
+SETUP: 
+PASS new ApplePayError('unknown', 'postalAddress') did not throw exception.
+
+SETUP: 
+PASS new ApplePayError('unknown', 'addressLines') did not throw exception.
+
+SETUP: 
+PASS new ApplePayError('unknown', 'locality') did not throw exception.
+
+SETUP: 
+PASS new ApplePayError('unknown', 'postalCode') did not throw exception.
+
+SETUP: 
+PASS new ApplePayError('unknown', 'administrativeArea') did not throw exception.
+
+SETUP: 
+PASS new ApplePayError('unknown', 'country') did not throw exception.
+
+SETUP: 
+PASS new ApplePayError('unknown', 'countryCode') did not throw exception.
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySession.html (217056 => 217057)


--- trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySession.html	2017-05-18 18:56:32 UTC (rev 217056)
+++ trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySession.html	2017-05-18 18:57:10 UTC (rev 217057)
@@ -213,6 +213,28 @@
     logAndShouldNotThrow("request = validRequest(); request.applicationData = { };", "new ApplePaySession(2, request)")
     logAndShouldThrow("request = validRequest(); request.applicationData = { toString: function() { throw '\"Error in toString\"'; } };", "new ApplePaySession(2, request)")
 
+    debug("Testing ApplePayError")
+    debug("");
+    logAndShouldThrow("", "new ApplePayError()")
+    logAndShouldThrow("", "new ApplePayError([])")
+    logAndShouldThrow("", "new ApplePayError('')")
+    logAndShouldNotThrow("", "new ApplePayError('unknown')")
+    logAndShouldNotThrow("", "new ApplePayError('shippingContactInvalid')")
+    logAndShouldNotThrow("", "new ApplePayError('billingContactInvalid')")
+    logAndShouldNotThrow("", "new ApplePayError('addressUnserviceable')")
+    logAndShouldThrow("", "new ApplePayError('unknown', [])")
+    logAndShouldThrow("", "new ApplePayError('unknown', '')")
+    logAndShouldNotThrow("", "new ApplePayError('unknown', 'phoneNumber')")
+    logAndShouldNotThrow("", "new ApplePayError('unknown', 'emailAddress')")
+    logAndShouldNotThrow("", "new ApplePayError('unknown', 'name')")
+    logAndShouldNotThrow("", "new ApplePayError('unknown', 'postalAddress')")
+    logAndShouldNotThrow("", "new ApplePayError('unknown', 'addressLines')")
+    logAndShouldNotThrow("", "new ApplePayError('unknown', 'locality')")
+    logAndShouldNotThrow("", "new ApplePayError('unknown', 'postalCode')")
+    logAndShouldNotThrow("", "new ApplePayError('unknown', 'administrativeArea')")
+    logAndShouldNotThrow("", "new ApplePayError('unknown', 'country')")
+    logAndShouldNotThrow("", "new ApplePayError('unknown', 'countryCode')")
+
     document.querySelector("button").remove();
 
     finishJSTest();

Modified: trunk/Source/WebCore/ChangeLog (217056 => 217057)


--- trunk/Source/WebCore/ChangeLog	2017-05-18 18:56:32 UTC (rev 217056)
+++ trunk/Source/WebCore/ChangeLog	2017-05-18 18:57:10 UTC (rev 217057)
@@ -1,3 +1,16 @@
+2017-05-18  Andy Estes  <[email protected]>
+
+        Add "countryCode" to ApplePayErrorContactField
+        https://bugs.webkit.org/show_bug.cgi?id=172264
+        <rdar://problem/32004909>
+
+        Reviewed by Anders Carlsson.
+
+        Added ApplePayError tests to http/tests/ssl/applepay/ApplePaySession.html
+
+        * Modules/applepay/ApplePayError.idl:
+        * Modules/applepay/PaymentRequest.h:
+
 2017-05-18  Daniel Bates  <[email protected]>
 
         Cleanup: Remove unnecessary call to AddToImplIncludes("RuntimeEnabledFeatures.h") in GenerateImplementation()

Modified: trunk/Source/WebCore/Modules/applepay/ApplePayError.idl (217056 => 217057)


--- trunk/Source/WebCore/Modules/applepay/ApplePayError.idl	2017-05-18 18:56:32 UTC (rev 217056)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayError.idl	2017-05-18 18:57:10 UTC (rev 217057)
@@ -43,7 +43,8 @@
     "locality",
     "postalCode",
     "administrativeArea",
-    "country"
+    "country",
+    "countryCode"
 };
 
 [

Modified: trunk/Source/WebCore/Modules/applepay/PaymentRequest.h (217056 => 217057)


--- trunk/Source/WebCore/Modules/applepay/PaymentRequest.h	2017-05-18 18:56:32 UTC (rev 217056)
+++ trunk/Source/WebCore/Modules/applepay/PaymentRequest.h	2017-05-18 18:57:10 UTC (rev 217057)
@@ -168,6 +168,7 @@
         PostalCode,
         AdministrativeArea,
         Country,
+        CountryCode,
     };
 
     Code code;
@@ -222,7 +223,8 @@
         WebCore::PaymentError::ContactField::Locality,
         WebCore::PaymentError::ContactField::PostalCode,
         WebCore::PaymentError::ContactField::AdministrativeArea,
-        WebCore::PaymentError::ContactField::Country
+        WebCore::PaymentError::ContactField::Country,
+        WebCore::PaymentError::ContactField::CountryCode
     >;
 };
 

Modified: trunk/Source/WebKit2/ChangeLog (217056 => 217057)


--- trunk/Source/WebKit2/ChangeLog	2017-05-18 18:56:32 UTC (rev 217056)
+++ trunk/Source/WebKit2/ChangeLog	2017-05-18 18:57:10 UTC (rev 217057)
@@ -1,3 +1,14 @@
+2017-05-18  Andy Estes  <[email protected]>
+
+        Add "countryCode" to ApplePayErrorContactField
+        https://bugs.webkit.org/show_bug.cgi?id=172264
+        <rdar://problem/32004909>
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
+        (WebKit::toNSError):
+
 2017-05-18  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r217031, r217032, and r217037.

Modified: trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm (217056 => 217057)


--- trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm	2017-05-18 18:56:32 UTC (rev 217056)
+++ trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm	2017-05-18 18:57:10 UTC (rev 217057)
@@ -64,6 +64,7 @@
 SOFT_LINK_CONSTANT(Contacts, CNPostalAddressStateKey, NSString *);
 SOFT_LINK_CONSTANT(Contacts, CNPostalAddressPostalCodeKey, NSString *);
 SOFT_LINK_CONSTANT(Contacts, CNPostalAddressCountryKey, NSString *);
+SOFT_LINK_CONSTANT(Contacts, CNPostalAddressISOCountryCodeKey, NSString *);
 SOFT_LINK_CLASS(PassKit, PKPaymentAuthorizationResult)
 SOFT_LINK_CLASS(PassKit, PKPaymentRequestPaymentMethodUpdate)
 SOFT_LINK_CLASS(PassKit, PKPaymentRequestShippingContactUpdate)
@@ -635,6 +636,11 @@
             pkContactField = getPKContactFieldPostalAddress();
             postalAddressKey = getCNPostalAddressCountryKey();
             break;
+
+        case WebCore::PaymentError::ContactField::CountryCode:
+            pkContactField = getPKContactFieldPostalAddress();
+            postalAddressKey = getCNPostalAddressISOCountryCodeKey();
+            break;
         }
 
         [userInfo setObject:pkContactField forKey:getPKPaymentErrorContactFieldUserInfoKey()];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to