Title: [273922] trunk/Source/WebCore
Revision
273922
Author
drou...@apple.com
Date
2021-03-04 15:06:39 -0800 (Thu, 04 Mar 2021)

Log Message

[Payment Request] increment the current version
https://bugs.webkit.org/show_bug.cgi?id=222742
<rdar://problem/74502674>

Reviewed by Wenson Hsieh.

* Modules/applepay/cocoa/PaymentAPIVersionCocoa.mm:
(WebCore::PaymentAPIVersion::current):

* testing/MockPaymentCoordinator.h:
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::showPaymentUI):
(WebCore::MockPaymentCoordinator::completeShippingMethodSelection):
(WebCore::MockPaymentCoordinator::completeShippingContactSelection):
(WebCore::MockPaymentCoordinator::completePaymentMethodSelection):
(WebCore::MockPaymentCoordinator::completePaymentMethodModeChange):

* Modules/paymentrequest/PaymentRequestUtilities.h: Added.
* Modules/paymentrequest/PaymentRequestUtilities.cpp: Added.
(isValidDecimalMonetaryValue):
* Modules/paymentrequest/PaymentRequest.cpp:
(isValidDecimalMonetaryValue): Deleted.
* Modules/applepay/ApplePaySession.cpp:
(convertAndValidateTotal):
(convertAndValidate):
(validateAmount): Deleted.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
Move `isValidDecimalMonetaryValue` so it can be used in other files.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (273921 => 273922)


--- trunk/Source/WebCore/ChangeLog	2021-03-04 23:06:01 UTC (rev 273921)
+++ trunk/Source/WebCore/ChangeLog	2021-03-04 23:06:39 UTC (rev 273922)
@@ -1,3 +1,37 @@
+2021-03-04  Devin Rousso  <drou...@apple.com>
+
+        [Payment Request] increment the current version
+        https://bugs.webkit.org/show_bug.cgi?id=222742
+        <rdar://problem/74502674>
+
+        Reviewed by Wenson Hsieh.
+
+        * Modules/applepay/cocoa/PaymentAPIVersionCocoa.mm:
+        (WebCore::PaymentAPIVersion::current):
+
+        * testing/MockPaymentCoordinator.h:
+        * testing/MockPaymentCoordinator.cpp:
+        (WebCore::MockPaymentCoordinator::showPaymentUI):
+        (WebCore::MockPaymentCoordinator::completeShippingMethodSelection):
+        (WebCore::MockPaymentCoordinator::completeShippingContactSelection):
+        (WebCore::MockPaymentCoordinator::completePaymentMethodSelection):
+        (WebCore::MockPaymentCoordinator::completePaymentMethodModeChange):
+
+        * Modules/paymentrequest/PaymentRequestUtilities.h: Added.
+        * Modules/paymentrequest/PaymentRequestUtilities.cpp: Added.
+        (isValidDecimalMonetaryValue):
+        * Modules/paymentrequest/PaymentRequest.cpp:
+        (isValidDecimalMonetaryValue): Deleted.
+        * Modules/applepay/ApplePaySession.cpp:
+        (convertAndValidateTotal):
+        (convertAndValidate):
+        (validateAmount): Deleted.
+        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
+        Move `isValidDecimalMonetaryValue` so it can be used in other files.
+
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+
 2021-03-04  Zalan Bujtas  <za...@apple.com>
 
         [LFC][IFC] LineStatus::availableWidth should always be a valid number

Modified: trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp (273921 => 273922)


--- trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2021-03-04 23:06:01 UTC (rev 273921)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2021-03-04 23:06:39 UTC (rev 273922)
@@ -59,6 +59,7 @@
 #include "PaymentCoordinator.h"
 #include "PaymentMerchantSession.h"
 #include "PaymentMethod.h"
+#include "PaymentRequestUtilities.h"
 #include "PaymentRequestValidator.h"
 #include "SecurityOrigin.h"
 #include "Settings.h"
@@ -74,76 +75,9 @@
 
 WTF_MAKE_ISO_ALLOCATED_IMPL(ApplePaySession);
 
-// The amount follows the regular _expression_ -?[0-9]+(\.[0-9][0-9])?.
-static bool validateAmount(const String& amountString)
-{
-    enum class State {
-        Start,
-        Sign,
-        Digit,
-        Dot,
-        DotDigit,
-        End,
-    };
-
-    State state = State::Start;
-
-    for (unsigned i = 0; i < amountString.length(); ++i) {
-        UChar c = amountString[i];
-
-        switch (state) {
-        case State::Start:
-            if (c == '-') {
-                state = State::Sign;
-                break;
-            }
-
-            if (!isASCIIDigit(c))
-                return false;
-            state = State::Digit;
-            break;
-
-        case State::Sign:
-            if (!isASCIIDigit(c))
-                return false;
-            state = State::Digit;
-            break;
-
-        case State::Digit:
-            if (c == '.') {
-                state = State::Dot;
-                break;
-            }
-
-            if (!isASCIIDigit(c))
-                return false;
-            break;
-
-        case State::Dot:
-            if (!isASCIIDigit(c))
-                return false;
-
-            state = State::DotDigit;
-            break;
-
-        case State::DotDigit:
-            if (!isASCIIDigit(c))
-                return false;
-
-            state = State::End;
-            break;
-
-        case State::End:
-            return false;
-        }
-    }
-
-    return state == State::Digit || state == State::DotDigit || state == State::End;
-}
-
 static ExceptionOr<ApplePayLineItem> convertAndValidateTotal(ApplePayLineItem&& lineItem)
 {
-    if (!validateAmount(lineItem.amount))
+    if (!isValidDecimalMonetaryValue(lineItem.amount))
         return Exception { TypeError, makeString("\"" + lineItem.amount, "\" is not a valid amount.") };
 
     auto validatedTotal = PaymentRequestValidator::validateTotal(lineItem);
@@ -159,7 +93,7 @@
         // It is OK for pending types to not have an amount.
         lineItem.amount = nullString();
     } else {
-        if (!validateAmount(lineItem.amount))
+        if (!isValidDecimalMonetaryValue(lineItem.amount))
             return Exception { TypeError, makeString("\"" + lineItem.amount, "\" is not a valid amount.") };
     }
 
@@ -186,7 +120,7 @@
 
 static ExceptionOr<ApplePayShippingMethod> convertAndValidate(ApplePayShippingMethod&& shippingMethod)
 {
-    if (!validateAmount(shippingMethod.amount))
+    if (!isValidDecimalMonetaryValue(shippingMethod.amount))
         return Exception { TypeError, makeString("\"" + shippingMethod.amount, "\" is not a valid amount.") };
 
     return WTFMove(shippingMethod);

Modified: trunk/Source/WebCore/Modules/applepay/cocoa/PaymentAPIVersionCocoa.mm (273921 => 273922)


--- trunk/Source/WebCore/Modules/applepay/cocoa/PaymentAPIVersionCocoa.mm	2021-03-04 23:06:01 UTC (rev 273921)
+++ trunk/Source/WebCore/Modules/applepay/cocoa/PaymentAPIVersionCocoa.mm	2021-03-04 23:06:39 UTC (rev 273922)
@@ -35,7 +35,9 @@
 unsigned PaymentAPIVersion::current()
 {
     static unsigned current = [] {
-#if ENABLE(APPLE_PAY_SESSION_V11)
+#if ENABLE(APPLE_PAY_SESSION_V12)
+        return 12;
+#elif ENABLE(APPLE_PAY_SESSION_V11)
         return 11;
 #elif HAVE(PASSKIT_NEW_BUTTON_TYPES)
         return 10;

Modified: trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp (273921 => 273922)


--- trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp	2021-03-04 23:06:01 UTC (rev 273921)
+++ trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp	2021-03-04 23:06:39 UTC (rev 273922)
@@ -63,6 +63,7 @@
 #include "PaymentCoordinator.h"
 #include "PaymentMerchantSession.h"
 #include "PaymentMethod.h"
+#include "PaymentRequestUtilities.h"
 #include "PaymentRequestValidator.h"
 #include "PaymentResponse.h"
 #include "PaymentValidationErrors.h"

Modified: trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp (273921 => 273922)


--- trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp	2021-03-04 23:06:01 UTC (rev 273921)
+++ trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp	2021-03-04 23:06:39 UTC (rev 273922)
@@ -45,6 +45,7 @@
 #include "PaymentMethodData.h"
 #include "PaymentOptions.h"
 #include "PaymentRequestUpdateEvent.h"
+#include "PaymentRequestUtilities.h"
 #include "PaymentValidationErrors.h"
 #include "ScriptController.h"
 #include <_javascript_Core/JSONObject.h>
@@ -68,79 +69,6 @@
     return false;
 }
 
-// Implements the "valid decimal monetary value" validity checker
-// https://www.w3.org/TR/payment-request/#dfn-valid-decimal-monetary-value
-static bool isValidDecimalMonetaryValue(StringView value)
-{
-    enum class State {
-        Start,
-        Sign,
-        Digit,
-        Dot,
-        DotDigit,
-    };
-
-    auto state = State::Start;
-    for (auto character : value.codeUnits()) {
-        switch (state) {
-        case State::Start:
-            if (character == '-') {
-                state = State::Sign;
-                break;
-            }
-
-            if (isASCIIDigit(character)) {
-                state = State::Digit;
-                break;
-            }
-
-            return false;
-
-        case State::Sign:
-            if (isASCIIDigit(character)) {
-                state = State::Digit;
-                break;
-            }
-
-            return false;
-
-        case State::Digit:
-            if (character == '.') {
-                state = State::Dot;
-                break;
-            }
-
-            if (isASCIIDigit(character)) {
-                state = State::Digit;
-                break;
-            }
-
-            return false;
-
-        case State::Dot:
-            if (isASCIIDigit(character)) {
-                state = State::DotDigit;
-                break;
-            }
-
-            return false;
-
-        case State::DotDigit:
-            if (isASCIIDigit(character)) {
-                state = State::DotDigit;
-                break;
-            }
-
-            return false;
-        }
-    }
-
-    if (state == State::Digit || state == State::DotDigit)
-        return true;
-
-    return false;
-}
-
 template<typename T>
 static ExceptionOr<String> checkAndCanonicalizeData(ScriptExecutionContext& context, T& value)
 {

Added: trunk/Source/WebCore/Modules/paymentrequest/PaymentRequestUtilities.cpp (0 => 273922)


--- trunk/Source/WebCore/Modules/paymentrequest/PaymentRequestUtilities.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/paymentrequest/PaymentRequestUtilities.cpp	2021-03-04 23:06:39 UTC (rev 273922)
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 2017-2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PaymentRequestUtilities.h"
+
+#if ENABLE(PAYMENT_REQUEST)
+
+namespace WebCore {
+
+// Implements the "valid decimal monetary value" validity checker
+// https://www.w3.org/TR/payment-request/#dfn-valid-decimal-monetary-value
+bool isValidDecimalMonetaryValue(StringView value)
+{
+    enum class State {
+        Start,
+        Sign,
+        Digit,
+        Dot,
+        DotDigit,
+    };
+
+    auto state = State::Start;
+    for (auto character : value.codeUnits()) {
+        switch (state) {
+        case State::Start:
+            if (character == '-') {
+                state = State::Sign;
+                break;
+            }
+
+            if (isASCIIDigit(character)) {
+                state = State::Digit;
+                break;
+            }
+
+            return false;
+
+        case State::Sign:
+            if (isASCIIDigit(character)) {
+                state = State::Digit;
+                break;
+            }
+
+            return false;
+
+        case State::Digit:
+            if (character == '.') {
+                state = State::Dot;
+                break;
+            }
+
+            if (isASCIIDigit(character)) {
+                state = State::Digit;
+                break;
+            }
+
+            return false;
+
+        case State::Dot:
+            if (isASCIIDigit(character)) {
+                state = State::DotDigit;
+                break;
+            }
+
+            return false;
+
+        case State::DotDigit:
+            if (isASCIIDigit(character)) {
+                state = State::DotDigit;
+                break;
+            }
+
+            return false;
+        }
+    }
+
+    return state == State::Digit || state == State::DotDigit;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(PAYMENT_REQUEST)

Copied: trunk/Source/WebCore/Modules/paymentrequest/PaymentRequestUtilities.h (from rev 273919, trunk/Source/WebCore/Modules/applepay/cocoa/PaymentAPIVersionCocoa.mm) (0 => 273922)


--- trunk/Source/WebCore/Modules/paymentrequest/PaymentRequestUtilities.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/paymentrequest/PaymentRequestUtilities.h	2021-03-04 23:06:39 UTC (rev 273922)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(PAYMENT_REQUEST)
+
+#include <wtf/text/StringView.h>
+
+namespace WebCore {
+
+bool isValidDecimalMonetaryValue(StringView);
+
+} // namespace WebCore
+
+#endif // ENABLE(PAYMENT_REQUEST)

Modified: trunk/Source/WebCore/Sources.txt (273921 => 273922)


--- trunk/Source/WebCore/Sources.txt	2021-03-04 23:06:01 UTC (rev 273921)
+++ trunk/Source/WebCore/Sources.txt	2021-03-04 23:06:39 UTC (rev 273922)
@@ -196,6 +196,7 @@
 Modules/paymentrequest/PaymentMethodChangeEvent.cpp
 Modules/paymentrequest/PaymentRequest.cpp
 Modules/paymentrequest/PaymentRequestUpdateEvent.cpp
+Modules/paymentrequest/PaymentRequestUtilities.cpp
 Modules/paymentrequest/PaymentResponse.cpp
 Modules/pictureinpicture/DocumentPictureInPicture.cpp
 Modules/pictureinpicture/EnterPictureInPictureEvent.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (273921 => 273922)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2021-03-04 23:06:01 UTC (rev 273921)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2021-03-04 23:06:39 UTC (rev 273922)
@@ -2943,6 +2943,7 @@
 		9527D7AB25D5FDE200A6E176 /* ApplePayDetailsUpdateData.h in Headers */ = {isa = PBXBuildFile; fileRef = 9527D7A825D5FDE100A6E176 /* ApplePayDetailsUpdateData.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		9527D7AF25D5FE6C00A6E176 /* JSApplePayDetailsUpdateData.h in Headers */ = {isa = PBXBuildFile; fileRef = 9527D7AD25D5FE6B00A6E176 /* JSApplePayDetailsUpdateData.h */; };
 		953BCEB225D6283D00A4A2A1 /* JSApplePayDetailsUpdateBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 953BCEAF25D6283C00A4A2A1 /* JSApplePayDetailsUpdateBase.h */; };
+		9562EEDD25F18DE700334442 /* PaymentRequestUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 9562EEDB25F18DE600334442 /* PaymentRequestUtilities.h */; };
 		956FC4BB25D49C7B00F7B3A2 /* ApplePayLineItemData.h in Headers */ = {isa = PBXBuildFile; fileRef = 956FC4B825D49C7A00F7B3A2 /* ApplePayLineItemData.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		956FC4BB25D49C7B00F7B3A3 /* JSApplePayLineItemData.h in Headers */ = {isa = PBXBuildFile; fileRef = 956FC4BA25D49C7D00F7B3A2 /* JSApplePayLineItemData.h */; };
 		9596B93325DEEEA000ED2CFA /* ApplePayPaymentMethodModeUpdate.h in Headers */ = {isa = PBXBuildFile; fileRef = 9596B93025DEEE9F00ED2CFA /* ApplePayPaymentMethodModeUpdate.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -11797,6 +11798,8 @@
 		9527D7AE25D5FE6B00A6E176 /* JSApplePayDetailsUpdateData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSApplePayDetailsUpdateData.cpp; sourceTree = "<group>"; };
 		953BCEAF25D6283C00A4A2A1 /* JSApplePayDetailsUpdateBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSApplePayDetailsUpdateBase.h; sourceTree = "<group>"; };
 		953BCEB125D6283C00A4A2A1 /* JSApplePayDetailsUpdateBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSApplePayDetailsUpdateBase.cpp; sourceTree = "<group>"; };
+		9562EED925F18DE500334442 /* PaymentRequestUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PaymentRequestUtilities.cpp; sourceTree = "<group>"; };
+		9562EEDB25F18DE600334442 /* PaymentRequestUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaymentRequestUtilities.h; sourceTree = "<group>"; };
 		956FC4B825D49C7A00F7B3A2 /* ApplePayLineItemData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplePayLineItemData.h; sourceTree = "<group>"; };
 		956FC4B825D49C7C00F7B3A2 /* JSApplePayLineItemData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSApplePayLineItemData.cpp; sourceTree = "<group>"; };
 		956FC4BA25D49C7B00F7B3A2 /* ApplePayLineItemData.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ApplePayLineItemData.idl; sourceTree = "<group>"; };
@@ -24471,6 +24474,8 @@
 				A1F600431F4757A90077E83F /* PaymentRequestUpdateEvent.idl */,
 				A1F6004B1F475A5E0077E83F /* PaymentRequestUpdateEventInit.h */,
 				A1F6004C1F475A5E0077E83F /* PaymentRequestUpdateEventInit.idl */,
+				9562EED925F18DE500334442 /* PaymentRequestUtilities.cpp */,
+				9562EEDB25F18DE600334442 /* PaymentRequestUtilities.h */,
 				A1F76B3B1F44CF240014C318 /* PaymentResponse.cpp */,
 				A1F76B3A1F44CF240014C318 /* PaymentResponse.h */,
 				A1F76B3C1F44CF240014C318 /* PaymentResponse.idl */,
@@ -34154,6 +34159,7 @@
 				A1F76B131F44C2450014C318 /* PaymentRequest.h in Headers */,
 				A1F600441F4757A90077E83F /* PaymentRequestUpdateEvent.h in Headers */,
 				A1F6004D1F475A5E0077E83F /* PaymentRequestUpdateEventInit.h in Headers */,
+				9562EEDD25F18DE700334442 /* PaymentRequestUtilities.h in Headers */,
 				1A8A64681D19FDFF00D0E00F /* PaymentRequestValidator.h in Headers */,
 				A1F76B3D1F44CF240014C318 /* PaymentResponse.h in Headers */,
 				A1491DA31F859D870095F5D4 /* PaymentSession.h in Headers */,

Modified: trunk/Source/WebCore/testing/MockPaymentCoordinator.cpp (273921 => 273922)


--- trunk/Source/WebCore/testing/MockPaymentCoordinator.cpp	2021-03-04 23:06:01 UTC (rev 273921)
+++ trunk/Source/WebCore/testing/MockPaymentCoordinator.cpp	2021-03-04 23:06:39 UTC (rev 273922)
@@ -44,6 +44,10 @@
 #include <wtf/RunLoop.h>
 #include <wtf/URL.h>
 
+#if USE(APPLE_INTERNAL_SDK)
+#include <WebKitAdditions/MockPaymentCoordinatorAdditions.cpp>
+#endif
+
 namespace WebCore {
 
 MockPaymentCoordinator::MockPaymentCoordinator(Page& page)
@@ -109,6 +113,9 @@
 #if ENABLE(APPLE_PAY_INSTALLMENTS)
     m_installmentConfiguration = request.installmentConfiguration().applePayInstallmentConfiguration();
 #endif
+#if defined(MockPaymentCoordinatorAdditions_showPaymentUI)
+    MockPaymentCoordinatorAdditions_showPaymentUI
+#endif
 
     ASSERT(showCount == hideCount);
     ++showCount;
@@ -132,6 +139,9 @@
 
     m_total = WTFMove(shippingMethodUpdate->newTotal);
     m_lineItems = WTFMove(shippingMethodUpdate->newLineItems);
+#if defined(MockPaymentCoordinatorAdditions_completeShippingMethodSelection)
+    MockPaymentCoordinatorAdditions_completeShippingMethodSelection
+#endif
 }
 
 static Vector<MockPaymentError> convert(Vector<RefPtr<ApplePayError>>&& errors)
@@ -153,6 +163,9 @@
     m_lineItems = WTFMove(shippingContactUpdate->newLineItems);
     m_errors = convert(WTFMove(shippingContactUpdate->errors));
     m_shippingMethods = WTFMove(shippingContactUpdate->newShippingMethods);
+#if defined(MockPaymentCoordinatorAdditions_completeShippingContactSelection)
+    MockPaymentCoordinatorAdditions_completeShippingContactSelection
+#endif
 }
 
 void MockPaymentCoordinator::completePaymentMethodSelection(Optional<ApplePayPaymentMethodUpdate>&& paymentMethodUpdate)
@@ -162,6 +175,9 @@
 
     m_total = WTFMove(paymentMethodUpdate->newTotal);
     m_lineItems = WTFMove(paymentMethodUpdate->newLineItems);
+#if defined(MockPaymentCoordinatorAdditions_completePaymentMethodSelection)
+    MockPaymentCoordinatorAdditions_completePaymentMethodSelection
+#endif
 }
 
 #if ENABLE(APPLE_PAY_PAYMENT_METHOD_MODE)
@@ -175,6 +191,9 @@
     m_lineItems = WTFMove(paymentMethodModeUpdate->newLineItems);
     m_errors = convert(WTFMove(paymentMethodModeUpdate->errors));
     m_shippingMethods = WTFMove(paymentMethodModeUpdate->newShippingMethods);
+#if defined(MockPaymentCoordinatorAdditions_completePaymentMethodModeChange)
+    MockPaymentCoordinatorAdditions_completePaymentMethodModeChange
+#endif
 }
 
 #endif // ENABLE(APPLE_PAY_PAYMENT_METHOD_MODE)

Modified: trunk/Source/WebCore/testing/MockPaymentCoordinator.h (273921 => 273922)


--- trunk/Source/WebCore/testing/MockPaymentCoordinator.h	2021-03-04 23:06:01 UTC (rev 273921)
+++ trunk/Source/WebCore/testing/MockPaymentCoordinator.h	2021-03-04 23:06:39 UTC (rev 273922)
@@ -36,8 +36,13 @@
 #include "MockPaymentError.h"
 #include "PaymentCoordinatorClient.h"
 #include <wtf/HashSet.h>
+#include <wtf/Optional.h>
 #include <wtf/text/StringHash.h>
 
+#if USE(APPLE_INTERNAL_SDK)
+#include <WebKitAdditions/MockPaymentCoordinatorAdditions.h>
+#endif
+
 namespace WebCore {
 
 class Page;
@@ -117,6 +122,10 @@
 #endif
     ApplePaySetupConfiguration m_setupConfiguration;
     Vector<Ref<ApplePaySetupFeature>> m_setupFeatures;
+
+#if defined(MockPaymentCoordinatorAdditions_members)
+    MockPaymentCoordinatorAdditions_members
+#endif
 };
 
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to