Diff
Modified: trunk/LayoutTests/ChangeLog (261872 => 261873)
--- trunk/LayoutTests/ChangeLog 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/LayoutTests/ChangeLog 2020-05-19 18:19:24 UTC (rev 261873)
@@ -1,3 +1,15 @@
+2020-05-19 Andy Estes <[email protected]>
+
+ [Apple Pay] Add testing and logging for ApplePaySetup
+ https://bugs.webkit.org/show_bug.cgi?id=211972
+ <rdar://problem/63291965>
+
+ Reviewed by Alex Christensen.
+
+ * http/tests/ssl/applepay/ApplePaySetup.https-expected.txt: Added.
+ * http/tests/ssl/applepay/ApplePaySetup.https.html: Added.
+ * platform/mac-wk2/TestExpectations:
+
2020-05-19 Simon Fraser <[email protected]>
[ macOS wk2 ] fast/scrolling/rtl-point-in-iframe.html sometimes fails
Added: trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySetup.https-expected.txt (0 => 261873)
--- trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySetup.https-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySetup.https-expected.txt 2020-05-19 18:19:24 UTC (rev 261873)
@@ -0,0 +1,26 @@
+Test ApplePaySetup.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS internals.mockPaymentCoordinator.setupConfiguration.merchantIdentifier is expectedMerchantIdentifier
+PASS internals.mockPaymentCoordinator.setupConfiguration.referrerIdentifier is expectedReferrerIdentifier
+PASS internals.mockPaymentCoordinator.setupConfiguration.signature is expectedSignature
+PASS typeof internals.mockPaymentCoordinator.setupConfiguration.signedFields is "object"
+PASS internals.mockPaymentCoordinator.setupConfiguration.signedFields.length is expectedSignedFields.length
+PASS internals.mockPaymentCoordinator.setupConfiguration.signedFields[0] is expectedSignedFields[0]
+PASS typeof features is "object"
+PASS features.length is 1
+PASS features[0].state is expectedSetupFeatureState
+PASS features[0].type is expectedSetupFeatureType
+PASS features[0].supportsInstallments is expectedSetupFeatureSupportsInstallments
+PASS internals.mockPaymentCoordinator.setupConfiguration.merchantIdentifier is expectedMerchantIdentifier
+PASS internals.mockPaymentCoordinator.setupConfiguration.referrerIdentifier is expectedReferrerIdentifier
+PASS internals.mockPaymentCoordinator.setupConfiguration.signature is expectedSignature
+PASS typeof internals.mockPaymentCoordinator.setupConfiguration.signedFields is "object"
+PASS internals.mockPaymentCoordinator.setupConfiguration.signedFields.length is expectedSignedFields.length
+PASS internals.mockPaymentCoordinator.setupConfiguration.signedFields[0] is expectedSignedFields[0]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySetup.https.html (0 => 261873)
--- trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySetup.https.html (rev 0)
+++ trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySetup.https.html 2020-05-19 18:19:24 UTC (rev 261873)
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<script>
+
+description("Test ApplePaySetup.");
+
+window.jsTestIsAsync = true;
+
+expectedMerchantIdentifier = 'merchant';
+expectedReferrerIdentifier = 'referrer';
+expectedSignature = 'signature';
+expectedSignedFields = ['field1'];
+expectedSetupFeatureState = 'supported';
+expectedSetupFeatureType = 'appleCard';
+expectedSetupFeatureSupportsInstallments = true;
+
+testSetupConfiguration = () => {
+ shouldBe('internals.mockPaymentCoordinator.setupConfiguration.merchantIdentifier', 'expectedMerchantIdentifier');
+ shouldBe('internals.mockPaymentCoordinator.setupConfiguration.referrerIdentifier', 'expectedReferrerIdentifier');
+ shouldBe('internals.mockPaymentCoordinator.setupConfiguration.signature', 'expectedSignature');
+ shouldBe('typeof internals.mockPaymentCoordinator.setupConfiguration.signedFields', '"object"');
+ shouldBe('internals.mockPaymentCoordinator.setupConfiguration.signedFields.length', 'expectedSignedFields.length');
+ shouldBe('internals.mockPaymentCoordinator.setupConfiguration.signedFields[0]', 'expectedSignedFields[0]');
+}
+
+(async () => {
+
+ let setup = new ApplePaySetup({
+ merchantIdentifier: expectedMerchantIdentifier,
+ referrerIdentifier: expectedReferrerIdentifier,
+ signature: expectedSignature,
+ signedFields: expectedSignedFields,
+ });
+
+ internals.mockPaymentCoordinator.addSetupFeature(expectedSetupFeatureState, expectedSetupFeatureType, expectedSetupFeatureSupportsInstallments);
+
+ features = await setup.getSetupFeatures();
+ testSetupConfiguration();
+ shouldBe('typeof features', '"object"');
+ shouldBe('features.length', '1');
+ shouldBe('features[0].state', 'expectedSetupFeatureState');
+ shouldBe('features[0].type', 'expectedSetupFeatureType');
+ shouldBe('features[0].supportsInstallments', 'expectedSetupFeatureSupportsInstallments');
+
+ activateThen(async () => {
+ let success = await setup.begin(features);
+ testSetupConfiguration();
+ finishJSTest();
+ });
+
+})();
+</script>
+<script src=""
+</body>
+</html>
Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (261872 => 261873)
--- trunk/LayoutTests/platform/mac-wk2/TestExpectations 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations 2020-05-19 18:19:24 UTC (rev 261873)
@@ -36,8 +36,9 @@
http/tests/ssl/applepay/ [ Pass ]
-# ApplePayInstallmentConfiguration was first available in Catalina.
+# ApplePayInstallmentConfiguration and ApplePaySetup were first available in Catalina.
[ Mojave ] http/tests/ssl/applepay/ApplePayInstallmentConfiguration.https.html [ Skip ]
+[ Mojave ] http/tests/ssl/applepay/ApplePaySetup.https.html [ Skip ]
fast/visual-viewport/rubberbanding-viewport-rects.html [ Pass ]
fast/visual-viewport/rubberbanding-viewport-rects-header-footer.html [ Pass ]
Modified: trunk/Source/WebCore/ChangeLog (261872 => 261873)
--- trunk/Source/WebCore/ChangeLog 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/Source/WebCore/ChangeLog 2020-05-19 18:19:24 UTC (rev 261873)
@@ -1,3 +1,55 @@
+2020-05-19 Andy Estes <[email protected]>
+
+ [Apple Pay] Add testing and logging for ApplePaySetup
+ https://bugs.webkit.org/show_bug.cgi?id=211972
+ <rdar://problem/63291965>
+
+ Reviewed by Alex Christensen.
+
+ Test: http/tests/ssl/applepay/ApplePaySetup.https.html
+
+ * DerivedSources-input.xcfilelist:
+ * DerivedSources-output.xcfilelist:
+ * DerivedSources.make:
+ * Modules/applepay/ApplePaySetup.cpp:
+ (WebCore::ApplePaySetup::getSetupFeatures):
+ (WebCore::ApplePaySetup::begin):
+ (WebCore::ApplePaySetup::ApplePaySetup):
+ (WebCore::ApplePaySetup::stop):
+ * Modules/applepay/ApplePaySetup.idl:
+ * Modules/applepay/ApplePaySetupConfiguration.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl.
+ * Modules/applepay/ApplePaySetupConfiguration.idl: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl.
+ * Modules/applepay/ApplePaySetupFeature.idl:
+ * Modules/applepay/ApplePaySetupFeature.mm:
+ (WebCore::ApplePaySetupFeature::state const):
+ * Modules/applepay/ApplePaySetupFeatureState.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl.
+ * Modules/applepay/ApplePaySetupFeatureState.idl: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl.
+ * Modules/applepay/ApplePaySetupFeatureType.idl:
+ * Modules/applepay/ApplePaySetupFeatureWebCore.h:
+ * Modules/applepay/ApplePaySetupWebCore.h:
+ (WebCore::ApplePaySetup::create):
+ * Modules/applepay/PaymentCoordinator.cpp:
+ (WebCore::PaymentCoordinator::setApplePayIsActiveIfAllowed const):
+ (WebCore::PaymentCoordinator::getSetupFeatures):
+ (WebCore::PaymentCoordinator::beginApplePaySetup):
+ (WebCore::PaymentCoordinator::endApplePaySetup):
+ * Modules/applepay/PaymentCoordinator.h:
+ * Modules/applepay/PaymentCoordinatorClient.h:
+ (WebCore::PaymentCoordinatorClient::getSetupFeatures):
+ (WebCore::PaymentCoordinatorClient::beginApplePaySetup):
+ * SourcesCocoa.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * testing/MockApplePaySetupFeature.cpp: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h.
+ (WebCore::MockApplePaySetupFeature::create):
+ (WebCore::MockApplePaySetupFeature::MockApplePaySetupFeature):
+ * testing/MockApplePaySetupFeature.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h.
+ * testing/MockPaymentCoordinator.cpp:
+ (WebCore::MockPaymentCoordinator::addSetupFeature):
+ (WebCore::MockPaymentCoordinator::getSetupFeatures):
+ (WebCore::MockPaymentCoordinator::beginApplePaySetup):
+ * testing/MockPaymentCoordinator.h:
+ * testing/MockPaymentCoordinator.idl:
+
2020-05-19 Sergio Villar Senin <[email protected]>
[WebXR] Implement requestSession()
Modified: trunk/Source/WebCore/DerivedSources-input.xcfilelist (261872 => 261873)
--- trunk/Source/WebCore/DerivedSources-input.xcfilelist 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/Source/WebCore/DerivedSources-input.xcfilelist 2020-05-19 18:19:24 UTC (rev 261873)
@@ -41,7 +41,9 @@
$(PROJECT_DIR)/Modules/applepay/ApplePaySession.idl
$(PROJECT_DIR)/Modules/applepay/ApplePaySessionError.idl
$(PROJECT_DIR)/Modules/applepay/ApplePaySetup.idl
+$(PROJECT_DIR)/Modules/applepay/ApplePaySetupConfiguration.idl
$(PROJECT_DIR)/Modules/applepay/ApplePaySetupFeature.idl
+$(PROJECT_DIR)/Modules/applepay/ApplePaySetupFeatureState.idl
$(PROJECT_DIR)/Modules/applepay/ApplePaySetupFeatureType.idl
$(PROJECT_DIR)/Modules/applepay/ApplePayShippingContactSelectedEvent.idl
$(PROJECT_DIR)/Modules/applepay/ApplePayShippingContactUpdate.idl
@@ -1133,6 +1135,7 @@
$(PROJECT_DIR)/testing/InternalsSetLike.idl
$(PROJECT_DIR)/testing/MallocStatistics.idl
$(PROJECT_DIR)/testing/MemoryInfo.idl
+$(PROJECT_DIR)/testing/MockApplePaySetupFeature.idl
$(PROJECT_DIR)/testing/MockCDMFactory.idl
$(PROJECT_DIR)/testing/MockContentFilterSettings.idl
$(PROJECT_DIR)/testing/MockPageOverlay.idl
Modified: trunk/Source/WebCore/DerivedSources-output.xcfilelist (261872 => 261873)
--- trunk/Source/WebCore/DerivedSources-output.xcfilelist 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/Source/WebCore/DerivedSources-output.xcfilelist 2020-05-19 18:19:24 UTC (rev 261873)
@@ -115,8 +115,12 @@
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePaySessionError.h
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePaySetup.cpp
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePaySetup.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePaySetupConfiguration.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePaySetupConfiguration.h
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePaySetupFeature.cpp
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePaySetupFeature.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePaySetupFeatureState.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePaySetupFeatureState.h
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePaySetupFeatureType.cpp
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePaySetupFeatureType.h
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePayShippingContactSelectedEvent.cpp
@@ -1086,6 +1090,8 @@
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMessageEvent.h
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMessagePort.cpp
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMessagePort.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMockApplePaySetupFeature.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMockApplePaySetupFeature.h
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMockCDMFactory.cpp
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMockCDMFactory.h
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMockContentFilterSettings.cpp
Modified: trunk/Source/WebCore/DerivedSources.make (261872 => 261873)
--- trunk/Source/WebCore/DerivedSources.make 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/Source/WebCore/DerivedSources.make 2020-05-19 18:19:24 UTC (rev 261873)
@@ -120,7 +120,9 @@
$(WebCore)/Modules/applepay/ApplePaySession.idl \
$(WebCore)/Modules/applepay/ApplePaySessionError.idl \
$(WebCore)/Modules/applepay/ApplePaySetup.idl \
+ $(WebCore)/Modules/applepay/ApplePaySetupConfiguration.idl \
$(WebCore)/Modules/applepay/ApplePaySetupFeature.idl \
+ $(WebCore)/Modules/applepay/ApplePaySetupFeatureState.idl \
$(WebCore)/Modules/applepay/ApplePaySetupFeatureType.idl \
$(WebCore)/Modules/applepay/ApplePayShippingContactSelectedEvent.idl \
$(WebCore)/Modules/applepay/ApplePayShippingContactUpdate.idl \
Modified: trunk/Source/WebCore/Modules/applepay/ApplePaySetup.cpp (261872 => 261873)
--- trunk/Source/WebCore/Modules/applepay/ApplePaySetup.cpp 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySetup.cpp 2020-05-19 18:19:24 UTC (rev 261873)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -76,7 +76,7 @@
m_setupFeaturesPromise = WTFMove(promise);
- page->paymentCoordinator().client().getSetupFeatures(m_configuration, document.url(), [this, pendingActivity = makePendingActivity(*this)](Vector<Ref<ApplePaySetupFeature>>&& setupFeatures) {
+ page->paymentCoordinator().getSetupFeatures(m_configuration, document.url(), [this, pendingActivity = makePendingActivity(*this)](Vector<Ref<ApplePaySetupFeature>>&& setupFeatures) {
if (m_setupFeaturesPromise)
std::exchange(m_setupFeaturesPromise, WTF::nullopt)->settle(WTFMove(setupFeatures));
});
@@ -109,13 +109,13 @@
m_beginPromise = WTFMove(promise);
m_pendingActivity = makePendingActivity(*this);
- page->paymentCoordinator().client().beginApplePaySetup(m_configuration, document.url(), WTFMove(features), [this](bool result) {
+ page->paymentCoordinator().beginApplePaySetup(m_configuration, document.url(), WTFMove(features), [this](bool result) {
if (m_beginPromise)
std::exchange(m_beginPromise, WTF::nullopt)->settle(result);
});
}
-ApplePaySetup::ApplePaySetup(ScriptExecutionContext& context, Configuration&& configuration)
+ApplePaySetup::ApplePaySetup(ScriptExecutionContext& context, ApplePaySetupConfiguration&& configuration)
: ActiveDOMObject(&context)
, m_configuration(WTFMove(configuration))
{
@@ -131,7 +131,7 @@
std::exchange(m_beginPromise, WTF::nullopt)->settle(Exception { AbortError });
if (auto page = downcast<Document>(*scriptExecutionContext()).page())
- page->paymentCoordinator().client().endApplePaySetup();
+ page->paymentCoordinator().endApplePaySetup();
m_pendingActivity = nullptr;
}
Modified: trunk/Source/WebCore/Modules/applepay/ApplePaySetup.idl (261872 => 261873)
--- trunk/Source/WebCore/Modules/applepay/ApplePaySetup.idl 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySetup.idl 2020-05-19 18:19:24 UTC (rev 261873)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -24,15 +24,6 @@
*/
[
- Conditional=APPLE_PAY_SETUP,
-] dictionary ApplePaySetupConfiguration {
- DOMString merchantIdentifier;
- DOMString referrerIdentifier;
- DOMString signature;
- sequence<DOMString> signedFields;
-};
-
-[
ActiveDOMObject,
Conditional=APPLE_PAY_SETUP,
Constructor(ApplePaySetupConfiguration configuration),
@@ -43,3 +34,4 @@
[CallWith=Document] Promise<sequence<ApplePaySetupFeature>> getSetupFeatures();
[CallWith=Document] Promise<boolean> begin(sequence<ApplePaySetupFeature> setupFeatures);
};
+
Copied: trunk/Source/WebCore/Modules/applepay/ApplePaySetupConfiguration.h (from rev 261871, trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl) (0 => 261873)
--- trunk/Source/WebCore/Modules/applepay/ApplePaySetupConfiguration.h (rev 0)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySetupConfiguration.h 2020-05-19 18:19:24 UTC (rev 261873)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2018-2020 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(APPLE_PAY_SETUP)
+
+#include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+struct ApplePaySetupConfiguration {
+ String merchantIdentifier;
+ String referrerIdentifier;
+ String signature;
+ Vector<String> signedFields;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(APPLE_PAY_SETUP)
Copied: trunk/Source/WebCore/Modules/applepay/ApplePaySetupConfiguration.idl (from rev 261871, trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl) (0 => 261873)
--- trunk/Source/WebCore/Modules/applepay/ApplePaySetupConfiguration.idl (rev 0)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySetupConfiguration.idl 2020-05-19 18:19:24 UTC (rev 261873)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2018-2020 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.
+ */
+
+[
+ Conditional=APPLE_PAY_SETUP,
+ ExportMacro=WEBCORE_EXPORT,
+ JSGenerateToJSObject,
+] dictionary ApplePaySetupConfiguration {
+ DOMString merchantIdentifier;
+ DOMString referrerIdentifier;
+ DOMString signature;
+ sequence<DOMString> signedFields;
+};
+
Modified: trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeature.idl (261872 => 261873)
--- trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeature.idl 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeature.idl 2020-05-19 18:19:24 UTC (rev 261873)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -25,20 +25,13 @@
[
Conditional=APPLE_PAY_SETUP,
-] enum ApplePaySetupFeatureState {
- "unsupported",
- "supported",
- "supplementarySupported",
- "completed"
-};
-
-[
- Conditional=APPLE_PAY_SETUP,
EnabledBySetting=ApplePay,
- ImplementationLacksVTable,
+ ExportMacro=WEBCORE_EXPORT,
SecureContext,
+ SkipVTableValidation,
] interface ApplePaySetupFeature {
[CachedAttribute] readonly attribute ApplePaySetupFeatureType type;
[CachedAttribute] readonly attribute ApplePaySetupFeatureState state;
[CachedAttribute, Conditional=APPLE_PAY_INSTALLMENTS] readonly attribute boolean supportsInstallments;
};
+
Modified: trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeature.mm (261872 => 261873)
--- trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeature.mm 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeature.mm 2020-05-19 18:19:24 UTC (rev 261873)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,11 +28,15 @@
#if ENABLE(APPLE_PAY_SETUP)
+#import "ApplePaySetupFeatureState.h"
#import "ApplePaySetupFeatureTypeWebCore.h"
#import <pal/spi/cocoa/PassKitSPI.h>
namespace WebCore {
+ApplePaySetupFeature::ApplePaySetupFeature() = default;
+ApplePaySetupFeature::~ApplePaySetupFeature() = default;
+
ApplePaySetupFeatureType ApplePaySetupFeature::type() const
{
switch ([m_feature type]) {
@@ -45,17 +49,17 @@
}
}
-ApplePaySetupFeature::State ApplePaySetupFeature::state() const
+ApplePaySetupFeatureState ApplePaySetupFeature::state() const
{
switch ([m_feature state]) {
case PKPaymentSetupFeatureStateUnsupported:
- return State::Unsupported;
+ return ApplePaySetupFeatureState::Unsupported;
case PKPaymentSetupFeatureStateSupported:
- return State::Supported;
+ return ApplePaySetupFeatureState::Supported;
case PKPaymentSetupFeatureStateSupplementarySupported:
- return State::SupplementarySupported;
+ return ApplePaySetupFeatureState::SupplementarySupported;
case PKPaymentSetupFeatureStateCompleted:
- return State::Completed;
+ return ApplePaySetupFeatureState::Completed;
}
}
Copied: trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeatureState.h (from rev 261871, trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl) (0 => 261873)
--- trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeatureState.h (rev 0)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeatureState.h 2020-05-19 18:19:24 UTC (rev 261873)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2018-2020 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(APPLE_PAY_SETUP)
+
+namespace WebCore {
+
+enum class ApplePaySetupFeatureState : uint8_t {
+ Unsupported,
+ Supported,
+ SupplementarySupported,
+ Completed,
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(APPLE_PAY_SETUP)
Copied: trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeatureState.idl (from rev 261871, trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl) (0 => 261873)
--- trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeatureState.idl (rev 0)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeatureState.idl 2020-05-19 18:19:24 UTC (rev 261873)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2018-2020 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.
+ */
+
+[
+ Conditional=APPLE_PAY_SETUP,
+ ExportMacro=WEBCORE_EXPORT,
+] enum ApplePaySetupFeatureState {
+ "unsupported",
+ "supported",
+ "supplementarySupported",
+ "completed"
+};
+
Modified: trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl (261872 => 261873)
--- trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl 2020-05-19 18:19:24 UTC (rev 261873)
@@ -25,7 +25,9 @@
[
Conditional=APPLE_PAY_SETUP,
+ ExportMacro=WEBCORE_EXPORT,
] enum ApplePaySetupFeatureType {
"applePay",
"appleCard"
};
+
Modified: trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h (261872 => 261873)
--- trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h 2020-05-19 18:19:24 UTC (rev 261873)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -34,6 +34,7 @@
namespace WebCore {
+enum class ApplePaySetupFeatureState : uint8_t;
enum class ApplePaySetupFeatureType : uint8_t;
class ApplePaySetupFeature : public RefCounted<ApplePaySetupFeature> {
@@ -42,23 +43,21 @@
{
return adoptRef(*new ApplePaySetupFeature(feature));
}
+
+ WEBCORE_EXPORT virtual ~ApplePaySetupFeature();
- ApplePaySetupFeatureType type() const;
+ virtual ApplePaySetupFeatureState state() const;
+ virtual ApplePaySetupFeatureType type() const;
- enum class State : uint8_t {
- Unsupported,
- Supported,
- SupplementarySupported,
- Completed,
- };
- State state() const;
-
PKPaymentSetupFeature *platformFeature() const { return m_feature.get(); }
#if ENABLE(APPLE_PAY_INSTALLMENTS)
- bool supportsInstallments() const;
+ virtual bool supportsInstallments() const;
#endif
+protected:
+ WEBCORE_EXPORT ApplePaySetupFeature();
+
private:
WEBCORE_EXPORT explicit ApplePaySetupFeature(PKPaymentSetupFeature *);
Modified: trunk/Source/WebCore/Modules/applepay/ApplePaySetupWebCore.h (261872 => 261873)
--- trunk/Source/WebCore/Modules/applepay/ApplePaySetupWebCore.h 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySetupWebCore.h 2020-05-19 18:19:24 UTC (rev 261873)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,6 +27,7 @@
#if ENABLE(APPLE_PAY_SETUP)
+#include "ApplePaySetupConfiguration.h"
#include <WebCore/ActiveDOMObject.h>
#include <WebCore/JSDOMPromiseDeferred.h>
#include <wtf/Forward.h>
@@ -42,14 +43,7 @@
class ApplePaySetup : public ActiveDOMObject, public RefCounted<ApplePaySetup> {
public:
- struct Configuration {
- String merchantIdentifier;
- String referrerIdentifier;
- String signature;
- Vector<String> signedFields;
- };
-
- static Ref<ApplePaySetup> create(ScriptExecutionContext& context, Configuration&& configuration)
+ static Ref<ApplePaySetup> create(ScriptExecutionContext& context, ApplePaySetupConfiguration&& configuration)
{
return adoptRef(*new ApplePaySetup(context, WTFMove(configuration)));
}
@@ -61,7 +55,7 @@
void begin(Document&, Vector<RefPtr<ApplePaySetupFeature>>&&, BeginPromise&&);
private:
- ApplePaySetup(ScriptExecutionContext&, Configuration&&);
+ ApplePaySetup(ScriptExecutionContext&, ApplePaySetupConfiguration&&);
// ActiveDOMObject
const char* activeDOMObjectName() const final { return "ApplePaySetup"; }
@@ -68,7 +62,7 @@
void stop() final;
void suspend(ReasonForSuspension) final;
- Configuration m_configuration;
+ ApplePaySetupConfiguration m_configuration;
Optional<SetupFeaturesPromise> m_setupFeaturesPromise;
Optional<BeginPromise> m_beginPromise;
RefPtr<PendingActivity<ApplePaySetup>> m_pendingActivity;
Modified: trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp (261872 => 261873)
--- trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp 2020-05-19 18:19:24 UTC (rev 261873)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -284,7 +284,6 @@
return false;
}
- RELEASE_LOG_IF_ALLOWED("setApplePayIsActiveIfAllowed() -> true (supportsUnrestrictedApplePay: %d)", supportsUnrestrictedApplePay);
document.setApplePayIsActive();
return true;
}
@@ -300,6 +299,38 @@
return makeUnexpected(ExceptionDetails { m_client.userAgentScriptsBlockedErrorMessage() });
}
+#if ENABLE(APPLE_PAY_SETUP)
+
+void PaymentCoordinator::getSetupFeatures(const ApplePaySetupConfiguration& configuration, const URL& url, CompletionHandler<void(Vector<Ref<ApplePaySetupFeature>>&&)>&& completionHandler)
+{
+ RELEASE_LOG_IF_ALLOWED("getSetupFeatures()");
+ m_client.getSetupFeatures(configuration, url, [this, weakThis = makeWeakPtr(*this), completionHandler = WTFMove(completionHandler)](Vector<Ref<ApplePaySetupFeature>>&& features) mutable {
+ if (!weakThis)
+ return;
+ RELEASE_LOG_IF_ALLOWED("getSetupFeatures() completed (features: %zu)", features.size());
+ completionHandler(WTFMove(features));
+ });
+}
+
+void PaymentCoordinator::beginApplePaySetup(const ApplePaySetupConfiguration& configuration, const URL& url, Vector<RefPtr<ApplePaySetupFeature>>&& features, CompletionHandler<void(bool)>&& completionHandler)
+{
+ RELEASE_LOG_IF_ALLOWED("beginApplePaySetup()");
+ m_client.beginApplePaySetup(configuration, url, WTFMove(features), [this, weakThis = makeWeakPtr(*this), completionHandler = WTFMove(completionHandler)](bool success) mutable {
+ if (!weakThis)
+ return;
+ RELEASE_LOG_IF_ALLOWED("beginApplePaySetup() completed (success: %d)", success);
+ completionHandler(success);
+ });
+}
+
+void PaymentCoordinator::endApplePaySetup()
+{
+ RELEASE_LOG_IF_ALLOWED("endApplePaySetup()");
+ m_client.endApplePaySetup();
+}
+
+#endif
+
} // namespace WebCore
#undef RELEASE_LOG_ERROR_IF_ALLOWED
Modified: trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.h (261872 => 261873)
--- trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.h 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.h 2020-05-19 18:19:24 UTC (rev 261873)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -34,6 +34,7 @@
namespace WebCore {
+class ApplePaySetupFeature;
class Document;
class Payment;
class PaymentCoordinatorClient;
@@ -44,6 +45,7 @@
class PaymentSession;
class PaymentSessionError;
enum class PaymentAuthorizationStatus;
+struct ApplePaySetupConfiguration;
struct ExceptionDetails;
struct PaymentAuthorizationResult;
struct ShippingContactUpdate;
@@ -85,6 +87,12 @@
bool shouldEnableApplePayAPIs(Document&) const;
WEBCORE_EXPORT Expected<void, ExceptionDetails> shouldAllowUserAgentScripts(Document&) const;
+#if ENABLE(APPLE_PAY_SETUP)
+ void getSetupFeatures(const ApplePaySetupConfiguration&, const URL&, CompletionHandler<void(Vector<Ref<ApplePaySetupFeature>>&&)>&&);
+ void beginApplePaySetup(const ApplePaySetupConfiguration&, const URL&, Vector<RefPtr<ApplePaySetupFeature>>&&, CompletionHandler<void(bool)>&&);
+ void endApplePaySetup();
+#endif
+
private:
bool setApplePayIsActiveIfAllowed(Document&) const;
Modified: trunk/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h (261872 => 261873)
--- trunk/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h 2020-05-19 18:19:24 UTC (rev 261873)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -29,7 +29,6 @@
#include "ApplePaySessionPaymentRequest.h"
#include "ApplePaySetupFeatureWebCore.h"
-#include "ApplePaySetupWebCore.h"
#include <wtf/CompletionHandler.h>
#include <wtf/Forward.h>
#include <wtf/Function.h>
@@ -39,6 +38,7 @@
class Document;
class PaymentMerchantSession;
class PaymentMethodUpdate;
+struct ApplePaySetupConfiguration;
struct PaymentAuthorizationResult;
struct ShippingContactUpdate;
struct ShippingMethodUpdate;
@@ -71,8 +71,8 @@
virtual bool isAlwaysOnLoggingAllowed() const { return false; }
#if ENABLE(APPLE_PAY_SETUP)
- virtual void getSetupFeatures(const ApplePaySetup::Configuration&, const URL&, CompletionHandler<void(Vector<Ref<ApplePaySetupFeature>>&&)>&& completionHandler) { completionHandler({ }); }
- virtual void beginApplePaySetup(const ApplePaySetup::Configuration&, const URL&, Vector<RefPtr<ApplePaySetupFeature>>&&, CompletionHandler<void(bool)>&& completionHandler) { completionHandler(false); }
+ virtual void getSetupFeatures(const ApplePaySetupConfiguration&, const URL&, CompletionHandler<void(Vector<Ref<ApplePaySetupFeature>>&&)>&& completionHandler) { completionHandler({ }); }
+ virtual void beginApplePaySetup(const ApplePaySetupConfiguration&, const URL&, Vector<RefPtr<ApplePaySetupFeature>>&&, CompletionHandler<void(bool)>&& completionHandler) { completionHandler(false); }
virtual void endApplePaySetup() { }
#endif
Modified: trunk/Source/WebCore/SourcesCocoa.txt (261872 => 261873)
--- trunk/Source/WebCore/SourcesCocoa.txt 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/Source/WebCore/SourcesCocoa.txt 2020-05-19 18:19:24 UTC (rev 261873)
@@ -641,7 +641,9 @@
JSApplePaySession.cpp
JSApplePaySessionError.cpp
JSApplePaySetup.cpp
+ JSApplePaySetupConfiguration.cpp
JSApplePaySetupFeature.cpp
+ JSApplePaySetupFeatureState.cpp
JSApplePaySetupFeatureType.cpp
JSApplePayShippingContactSelectedEvent.cpp
JSApplePayShippingContactUpdate.cpp
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (261872 => 261873)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2020-05-19 18:19:24 UTC (rev 261873)
@@ -2961,6 +2961,11 @@
A110DB9B14F5DF7700A03B93 /* StyleGridItemData.h in Headers */ = {isa = PBXBuildFile; fileRef = A110DB9A14F5DF7700A03B93 /* StyleGridItemData.h */; settings = {ATTRIBUTES = (Private, ); }; };
A113E02823318293009C33A0 /* PaymentSessionError.h in Headers */ = {isa = PBXBuildFile; fileRef = A113E02723318293009C33A0 /* PaymentSessionError.h */; settings = {ATTRIBUTES = (Private, ); }; };
A113E02E2331A134009C33A0 /* ApplePayCancelEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A113E02B2331A0E4009C33A0 /* ApplePayCancelEvent.h */; };
+ A11750872474403100D4D26C /* JSApplePayInstallmentConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = A11750832474400200D4D26C /* JSApplePayInstallmentConfiguration.h */; };
+ A11750882474405500D4D26C /* JSApplePaySetup.h in Headers */ = {isa = PBXBuildFile; fileRef = A11750842474400300D4D26C /* JSApplePaySetup.h */; };
+ A11750892474407C00D4D26C /* JSApplePaySetupFeature.h in Headers */ = {isa = PBXBuildFile; fileRef = A11750822474400100D4D26C /* JSApplePaySetupFeature.h */; };
+ A117508A247440A400D4D26C /* JSApplePaySetupFeatureType.h in Headers */ = {isa = PBXBuildFile; fileRef = A11750802474400000D4D26C /* JSApplePaySetupFeatureType.h */; };
+ A117508B247440B600D4D26C /* JSApplePayValidateMerchantEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A11750852474400400D4D26C /* JSApplePayValidateMerchantEvent.h */; };
A11AE0CC1FFD60530047348B /* MerchantValidationEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A11AE0C91FFD60530047348B /* MerchantValidationEvent.h */; };
A11AE0D31FFD61DF0047348B /* JSMerchantValidationEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A11AE0D11FFD61DF0047348B /* JSMerchantValidationEvent.h */; };
A11E8C051B1E28F40003A7C7 /* copyCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = A11E8C001B1E28BE0003A7C7 /* copyCursor.png */; };
@@ -3038,6 +3043,10 @@
A180AD5B219F81B000DC039A /* WebCoreAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = A17E4F26219BC01600E1C7EE /* WebCoreAdditions.mm */; };
A185B42A1E8211A100DC9118 /* LegacyPreviewLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = A185B4281E8211A100DC9118 /* LegacyPreviewLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
A18890AF1AA13F250026C301 /* ParentalControlsContentFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = A18890AD1AA13F250026C301 /* ParentalControlsContentFilter.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ A1891045246DF6C6006BA9FC /* ApplePaySetupFeatureState.h in Headers */ = {isa = PBXBuildFile; fileRef = A1891042246DF6C6006BA9FC /* ApplePaySetupFeatureState.h */; };
+ A1891053246E1A34006BA9FC /* MockApplePaySetupFeature.h in Headers */ = {isa = PBXBuildFile; fileRef = A1891051246E1A34006BA9FC /* MockApplePaySetupFeature.h */; };
+ A1891054246E1A34006BA9FC /* MockApplePaySetupFeature.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1891052246E1A34006BA9FC /* MockApplePaySetupFeature.cpp */; };
+ A1891059246F2C1B006BA9FC /* ApplePaySetupConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = A1891056246F2BC8006BA9FC /* ApplePaySetupConfiguration.h */; settings = {ATTRIBUTES = (Private, ); }; };
A1956F1C2331A6770057E9D2 /* JSApplePayCancelEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A1956F1B2331A6460057E9D2 /* JSApplePayCancelEvent.h */; };
A1956F202331A8C70057E9D2 /* ApplePaySessionError.h in Headers */ = {isa = PBXBuildFile; fileRef = A1956F1D2331A8C70057E9D2 /* ApplePaySessionError.h */; };
A1956F232331ACF20057E9D2 /* WHLSLReplaceWith.h in Headers */ = {isa = PBXBuildFile; fileRef = 3351F70B22CAD8DA0015B40D /* WHLSLReplaceWith.h */; };
@@ -11474,6 +11483,15 @@
A113E02A23318EBC009C33A0 /* PaymentSessionErrorCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PaymentSessionErrorCocoa.mm; sourceTree = "<group>"; };
A113E02B2331A0E4009C33A0 /* ApplePayCancelEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ApplePayCancelEvent.h; sourceTree = "<group>"; };
A113E02C2331A0E4009C33A0 /* ApplePayCancelEvent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ApplePayCancelEvent.cpp; sourceTree = "<group>"; };
+ A117507D24743FFE00D4D26C /* JSApplePayInstallmentConfiguration.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSApplePayInstallmentConfiguration.cpp; sourceTree = "<group>"; };
+ A117507F24743FFF00D4D26C /* JSApplePaySetup.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSApplePaySetup.cpp; sourceTree = "<group>"; };
+ A11750802474400000D4D26C /* JSApplePaySetupFeatureType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSApplePaySetupFeatureType.h; sourceTree = "<group>"; };
+ A11750812474400100D4D26C /* JSApplePaySetupFeatureType.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSApplePaySetupFeatureType.cpp; sourceTree = "<group>"; };
+ A11750822474400100D4D26C /* JSApplePaySetupFeature.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSApplePaySetupFeature.h; sourceTree = "<group>"; };
+ A11750832474400200D4D26C /* JSApplePayInstallmentConfiguration.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSApplePayInstallmentConfiguration.h; sourceTree = "<group>"; };
+ A11750842474400300D4D26C /* JSApplePaySetup.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSApplePaySetup.h; sourceTree = "<group>"; };
+ A11750852474400400D4D26C /* JSApplePayValidateMerchantEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSApplePayValidateMerchantEvent.h; sourceTree = "<group>"; };
+ A11750862474400500D4D26C /* JSApplePaySetupFeature.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSApplePaySetupFeature.cpp; sourceTree = "<group>"; };
A11AE0C91FFD60530047348B /* MerchantValidationEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MerchantValidationEvent.h; sourceTree = "<group>"; };
A11AE0CA1FFD60530047348B /* MerchantValidationEvent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MerchantValidationEvent.cpp; sourceTree = "<group>"; };
A11AE0CB1FFD60530047348B /* MerchantValidationEvent.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = MerchantValidationEvent.idl; sourceTree = "<group>"; };
@@ -11575,6 +11593,12 @@
A185B4281E8211A100DC9118 /* LegacyPreviewLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyPreviewLoader.h; sourceTree = "<group>"; };
A18890AC1AA13F250026C301 /* ParentalControlsContentFilter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ParentalControlsContentFilter.mm; sourceTree = "<group>"; };
A18890AD1AA13F250026C301 /* ParentalControlsContentFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParentalControlsContentFilter.h; sourceTree = "<group>"; };
+ A1891042246DF6C6006BA9FC /* ApplePaySetupFeatureState.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ApplePaySetupFeatureState.h; sourceTree = "<group>"; };
+ A1891044246DF6C6006BA9FC /* ApplePaySetupFeatureState.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = ApplePaySetupFeatureState.idl; sourceTree = "<group>"; };
+ A1891051246E1A34006BA9FC /* MockApplePaySetupFeature.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MockApplePaySetupFeature.h; sourceTree = "<group>"; };
+ A1891052246E1A34006BA9FC /* MockApplePaySetupFeature.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MockApplePaySetupFeature.cpp; sourceTree = "<group>"; };
+ A1891056246F2BC8006BA9FC /* ApplePaySetupConfiguration.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ApplePaySetupConfiguration.h; sourceTree = "<group>"; };
+ A1891058246F2BC8006BA9FC /* ApplePaySetupConfiguration.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = ApplePaySetupConfiguration.idl; sourceTree = "<group>"; };
A18F7A351ECA73640059E1E1 /* RuntimeApplicationChecks.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RuntimeApplicationChecks.cpp; sourceTree = "<group>"; };
A1956F182331A4680057E9D2 /* ApplePayCancelEvent.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = ApplePayCancelEvent.idl; sourceTree = "<group>"; };
A1956F1A2331A6460057E9D2 /* JSApplePayCancelEvent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSApplePayCancelEvent.cpp; sourceTree = "<group>"; };
@@ -17400,8 +17424,12 @@
1A58E8641D19D4DF00C0EA73 /* ApplePaySessionPaymentRequest.h */,
5C53DCD22446449A00A93124 /* ApplePaySetup.cpp */,
5C53DCC62446449700A93124 /* ApplePaySetup.idl */,
+ A1891056246F2BC8006BA9FC /* ApplePaySetupConfiguration.h */,
+ A1891058246F2BC8006BA9FC /* ApplePaySetupConfiguration.idl */,
5C53DCCA2446449800A93124 /* ApplePaySetupFeature.idl */,
5C53DCC92446449800A93124 /* ApplePaySetupFeature.mm */,
+ A1891042246DF6C6006BA9FC /* ApplePaySetupFeatureState.h */,
+ A1891044246DF6C6006BA9FC /* ApplePaySetupFeatureState.idl */,
5C53DCD62446449C00A93124 /* ApplePaySetupFeatureType.idl */,
5C53DCD42446449B00A93124 /* ApplePaySetupFeatureTypeWebCore.h */,
5C53DCCF2446449900A93124 /* ApplePaySetupFeatureWebCore.h */,
@@ -17557,6 +17585,8 @@
A1BB85AE2159B1A00067E07D /* JSApplePayErrorCode.h */,
A1BB85AC2159B19F0067E07D /* JSApplePayErrorContactField.cpp */,
A1BB85AF2159B1A00067E07D /* JSApplePayErrorContactField.h */,
+ A117507D24743FFE00D4D26C /* JSApplePayInstallmentConfiguration.cpp */,
+ A11750832474400200D4D26C /* JSApplePayInstallmentConfiguration.h */,
7C6579E91E00856600E3A27A /* JSApplePayLineItem.cpp */,
7C6579EA1E00856600E3A27A /* JSApplePayLineItem.h */,
A1DF5A891F7EC0000058A477 /* JSApplePayMerchantCapability.cpp */,
@@ -17591,6 +17621,12 @@
1AE96A7F1D1A0A8000B86768 /* JSApplePaySession.h */,
A1D506132331ED970014EE4E /* JSApplePaySessionError.cpp */,
A1D506112331ED960014EE4E /* JSApplePaySessionError.h */,
+ A117507F24743FFF00D4D26C /* JSApplePaySetup.cpp */,
+ A11750842474400300D4D26C /* JSApplePaySetup.h */,
+ A11750862474400500D4D26C /* JSApplePaySetupFeature.cpp */,
+ A11750822474400100D4D26C /* JSApplePaySetupFeature.h */,
+ A11750812474400100D4D26C /* JSApplePaySetupFeatureType.cpp */,
+ A11750802474400000D4D26C /* JSApplePaySetupFeatureType.h */,
1AE96A801D1A0A8000B86768 /* JSApplePayShippingContactSelectedEvent.cpp */,
1AE96A811D1A0A8000B86768 /* JSApplePayShippingContactSelectedEvent.h */,
1ADFDFE71E71DCA0008F5D34 /* JSApplePayShippingContactUpdate.cpp */,
@@ -17602,6 +17638,7 @@
1ADFDFE91E71DCA0008F5D34 /* JSApplePayShippingMethodUpdate.cpp */,
1ADFDFEA1E71DCA0008F5D34 /* JSApplePayShippingMethodUpdate.h */,
1AE96A841D1A0A8000B86768 /* JSApplePayValidateMerchantEvent.cpp */,
+ A11750852474400400D4D26C /* JSApplePayValidateMerchantEvent.h */,
);
name = ApplePay;
sourceTree = "<group>";
@@ -18457,6 +18494,8 @@
A7BE7EDE14C9175A0014489D /* MallocStatistics.idl */,
CD5393CB175DCCE600C07123 /* MemoryInfo.h */,
CD5393CC175DCCE600C07123 /* MemoryInfo.idl */,
+ A1891052246E1A34006BA9FC /* MockApplePaySetupFeature.cpp */,
+ A1891051246E1A34006BA9FC /* MockApplePaySetupFeature.h */,
CDF4B7211E03BF8100E235A2 /* MockCDMFactory.cpp */,
CDF4B7221E03BF8100E235A2 /* MockCDMFactory.h */,
CDF4B71F1E03BF6F00E235A2 /* MockCDMFactory.idl */,
@@ -29469,6 +29508,7 @@
427DA71E13735DFA007C57FB /* JSServiceWorkerInternals.h in Headers */,
EBF5121D1696496C0056BD25 /* JSTypeConversions.h in Headers */,
CDC26B41160A8CCE0026757B /* LegacyMockCDM.h in Headers */,
+ A1891053246E1A34006BA9FC /* MockApplePaySetupFeature.h in Headers */,
A1BF6B831AA96C7D00AF4A8A /* MockContentFilter.h in Headers */,
A1B5B29F1AAA846F008B6042 /* MockContentFilterSettings.h in Headers */,
51058ADC1D6792C1009A538C /* MockGamepad.h in Headers */,
@@ -29587,6 +29627,8 @@
1A8A64591D19FCFC00D0E00F /* ApplePaySession.h in Headers */,
A1956F202331A8C70057E9D2 /* ApplePaySessionError.h in Headers */,
1A58E8651D19D4EB00C0EA73 /* ApplePaySessionPaymentRequest.h in Headers */,
+ A1891059246F2C1B006BA9FC /* ApplePaySetupConfiguration.h in Headers */,
+ A1891045246DF6C6006BA9FC /* ApplePaySetupFeatureState.h in Headers */,
5C53DCE124465DFC00A93124 /* ApplePaySetupFeatureWebCore.h in Headers */,
5C53DCEA24468FB400A93124 /* ApplePaySetupWebCore.h in Headers */,
1A8A645C1D19FCFC00D0E00F /* ApplePayShippingContactSelectedEvent.h in Headers */,
@@ -31033,6 +31075,7 @@
A12C59F920360ACB0012236B /* JSApplePayError.h in Headers */,
A1BB85B22159B1A10067E07D /* JSApplePayErrorCode.h in Headers */,
A1BB85B32159B1A10067E07D /* JSApplePayErrorContactField.h in Headers */,
+ A11750872474403100D4D26C /* JSApplePayInstallmentConfiguration.h in Headers */,
7C6579F01E00856600E3A27A /* JSApplePayLineItem.h in Headers */,
A1DF5A8E1F7EC0020058A477 /* JSApplePayMerchantCapability.h in Headers */,
A1F6D0121FE099B40018078C /* JSApplePayModifier.h in Headers */,
@@ -31050,11 +31093,15 @@
A1DF5AB31F8077530058A477 /* JSApplePayRequestBase.h in Headers */,
1AE96A8F1D1A0DDD00B86768 /* JSApplePaySession.h in Headers */,
A1D506142331EDD40014EE4E /* JSApplePaySessionError.h in Headers */,
+ A11750882474405500D4D26C /* JSApplePaySetup.h in Headers */,
+ A11750892474407C00D4D26C /* JSApplePaySetupFeature.h in Headers */,
+ A117508A247440A400D4D26C /* JSApplePaySetupFeatureType.h in Headers */,
1AE96A911D1A0DDD00B86768 /* JSApplePayShippingContactSelectedEvent.h in Headers */,
A12C59FD20360B3E0012236B /* JSApplePayShippingContactUpdate.h in Headers */,
7C6579F41E00856600E3A27A /* JSApplePayShippingMethod.h in Headers */,
1AE96A931D1A0DDD00B86768 /* JSApplePayShippingMethodSelectedEvent.h in Headers */,
A12C59FE20360B4A0012236B /* JSApplePayShippingMethodUpdate.h in Headers */,
+ A117508B247440B600D4D26C /* JSApplePayValidateMerchantEvent.h in Headers */,
57D1352C2294AA3D00827401 /* JSAttestationConveyancePreference.h in Headers */,
65DF31DB09D1C123000BE325 /* JSAttr.h in Headers */,
FDA15E9E12B03EE1003A583A /* JSAudioBuffer.h in Headers */,
@@ -34164,6 +34211,7 @@
427DA71D13735DFA007C57FB /* JSServiceWorkerInternals.cpp in Sources */,
EBF5121C1696496C0056BD25 /* JSTypeConversions.cpp in Sources */,
CDC26B40160A8CC60026757B /* LegacyMockCDM.cpp in Sources */,
+ A1891054246E1A34006BA9FC /* MockApplePaySetupFeature.cpp in Sources */,
CDF4B7311E03D00700E235A2 /* MockCDMFactory.cpp in Sources */,
A1BF6B821AA96C7D00AF4A8A /* MockContentFilter.cpp in Sources */,
A1B5B29E1AAA846E008B6042 /* MockContentFilterSettings.cpp in Sources */,
Copied: trunk/Source/WebCore/testing/MockApplePaySetupFeature.cpp (from rev 261871, trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h) (0 => 261873)
--- trunk/Source/WebCore/testing/MockApplePaySetupFeature.cpp (rev 0)
+++ trunk/Source/WebCore/testing/MockApplePaySetupFeature.cpp 2020-05-19 18:19:24 UTC (rev 261873)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2020 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 "MockApplePaySetupFeature.h"
+
+#if ENABLE(APPLE_PAY_SETUP)
+
+namespace WebCore {
+
+Ref<MockApplePaySetupFeature> MockApplePaySetupFeature::create(ApplePaySetupFeatureState state, ApplePaySetupFeatureType type, bool supportsInstallments)
+{
+ return adoptRef(*new MockApplePaySetupFeature(state, type, supportsInstallments));
+}
+
+MockApplePaySetupFeature::MockApplePaySetupFeature(ApplePaySetupFeatureState state, ApplePaySetupFeatureType type, bool supportsInstallments)
+ : ApplePaySetupFeature()
+ , m_state(state)
+ , m_type(type)
+#if ENABLE(APPLE_PAY_INSTALLMENTS)
+ , m_supportsInstallments(supportsInstallments)
+#endif
+{
+ UNUSED_PARAM(supportsInstallments);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(APPLE_PAY_SETUP)
Copied: trunk/Source/WebCore/testing/MockApplePaySetupFeature.h (from rev 261871, trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h) (0 => 261873)
--- trunk/Source/WebCore/testing/MockApplePaySetupFeature.h (rev 0)
+++ trunk/Source/WebCore/testing/MockApplePaySetupFeature.h 2020-05-19 18:19:24 UTC (rev 261873)
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2020 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(APPLE_PAY_SETUP)
+
+#include "ApplePaySetupFeatureWebCore.h"
+
+namespace WebCore {
+
+class MockApplePaySetupFeature final : public ApplePaySetupFeature {
+public:
+ static Ref<MockApplePaySetupFeature> create(ApplePaySetupFeatureState, ApplePaySetupFeatureType, bool supportsInstallments);
+
+ ApplePaySetupFeatureState state() const final { return m_state; }
+ ApplePaySetupFeatureType type() const final { return m_type; }
+
+#if ENABLE(APPLE_PAY_INSTALLMENTS)
+ bool supportsInstallments() const final { return m_supportsInstallments; }
+#endif
+
+private:
+ MockApplePaySetupFeature(ApplePaySetupFeatureState, ApplePaySetupFeatureType, bool supportsInstallments);
+
+ ApplePaySetupFeatureState m_state;
+ ApplePaySetupFeatureType m_type;
+#if ENABLE(APPLE_PAY_INSTALLMENTS)
+ bool m_supportsInstallments;
+#endif
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(APPLE_PAY_SETUP)
Modified: trunk/Source/WebCore/testing/MockPaymentCoordinator.cpp (261872 => 261873)
--- trunk/Source/WebCore/testing/MockPaymentCoordinator.cpp 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/Source/WebCore/testing/MockPaymentCoordinator.cpp 2020-05-19 18:19:24 UTC (rev 261873)
@@ -29,6 +29,7 @@
#if ENABLE(APPLE_PAY)
#include "ApplePaySessionPaymentRequest.h"
+#include "MockApplePaySetupFeature.h"
#include "MockPayment.h"
#include "MockPaymentContact.h"
#include "MockPaymentMethod.h"
@@ -231,6 +232,28 @@
delete this;
}
+#if ENABLE(APPLE_PAY_SETUP)
+
+void MockPaymentCoordinator::addSetupFeature(ApplePaySetupFeatureState state, ApplePaySetupFeatureType type, bool supportsInstallments)
+{
+ m_setupFeatures.append(MockApplePaySetupFeature::create(state, type, supportsInstallments));
+}
+
+void MockPaymentCoordinator::getSetupFeatures(const ApplePaySetupConfiguration& configuration, const URL&, CompletionHandler<void(Vector<Ref<ApplePaySetupFeature>>&&)>&& completionHandler)
+{
+ m_setupConfiguration = configuration;
+ auto setupFeaturesCopy = m_setupFeatures;
+ completionHandler(WTFMove(setupFeaturesCopy));
+}
+
+void MockPaymentCoordinator::beginApplePaySetup(const ApplePaySetupConfiguration& configuration, const URL&, Vector<RefPtr<ApplePaySetupFeature>>&&, CompletionHandler<void(bool)>&& completionHandler)
+{
+ m_setupConfiguration = configuration;
+ completionHandler(true);
+}
+
+#endif
+
} // namespace WebCore
#endif // ENABLE(APPLE_PAY)
Modified: trunk/Source/WebCore/testing/MockPaymentCoordinator.h (261872 => 261873)
--- trunk/Source/WebCore/testing/MockPaymentCoordinator.h 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/Source/WebCore/testing/MockPaymentCoordinator.h 2020-05-19 18:19:24 UTC (rev 261873)
@@ -29,6 +29,7 @@
#include "ApplePayInstallmentConfigurationWebCore.h"
#include "ApplePayLineItem.h"
+#include "ApplePaySetupConfiguration.h"
#include "ApplePayShippingMethod.h"
#include "MockPaymentAddress.h"
#include "MockPaymentContactFields.h"
@@ -53,6 +54,11 @@
void changePaymentMethod(ApplePayPaymentMethod&&);
void acceptPayment();
void cancelPayment();
+
+#if ENABLE(APPLE_PAY_SETUP)
+ void addSetupFeature(ApplePaySetupFeatureState, ApplePaySetupFeatureType, bool supportsInstallments);
+ const ApplePaySetupConfiguration& setupConfiguration() const { return m_setupConfiguration; }
+#endif
const ApplePayLineItem& total() const { return m_total; }
const Vector<ApplePayLineItem>& lineItems() const { return m_lineItems; }
@@ -90,6 +96,11 @@
bool isAlwaysOnLoggingAllowed() const final { return true; }
+#if ENABLE(APPLE_PAY_SETUP)
+ void getSetupFeatures(const ApplePaySetupConfiguration&, const URL&, CompletionHandler<void(Vector<Ref<ApplePaySetupFeature>>&&)>&&) final;
+ void beginApplePaySetup(const ApplePaySetupConfiguration&, const URL&, Vector<RefPtr<ApplePaySetupFeature>>&&, CompletionHandler<void(bool)>&&) final;
+#endif
+
void updateTotalAndLineItems(const ApplePaySessionPaymentRequest::TotalAndLineItems&);
Page& m_page;
@@ -107,6 +118,10 @@
#if ENABLE(APPLE_PAY_INSTALLMENTS)
ApplePayInstallmentConfiguration m_installmentConfiguration;
#endif
+#if ENABLE(APPLE_PAY_SETUP)
+ ApplePaySetupConfiguration m_setupConfiguration;
+ Vector<Ref<ApplePaySetupFeature>> m_setupFeatures;
+#endif
};
} // namespace WebCore
Modified: trunk/Source/WebCore/testing/MockPaymentCoordinator.idl (261872 => 261873)
--- trunk/Source/WebCore/testing/MockPaymentCoordinator.idl 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/Source/WebCore/testing/MockPaymentCoordinator.idl 2020-05-19 18:19:24 UTC (rev 261873)
@@ -35,6 +35,8 @@
void acceptPayment();
void cancelPayment();
+ [Conditional=APPLE_PAY_SETUP] void addSetupFeature(ApplePaySetupFeatureState state, ApplePaySetupFeatureType type, boolean supportsInstallments);
+
readonly attribute ApplePayLineItem total;
readonly attribute sequence<ApplePayLineItem> lineItems;
readonly attribute sequence<MockPaymentError> errors;
@@ -42,6 +44,8 @@
readonly attribute MockPaymentContactFields requiredBillingContactFields;
readonly attribute MockPaymentContactFields requiredShippingContactFields;
+ [Conditional=APPLE_PAY_SETUP] readonly attribute ApplePaySetupConfiguration setupConfiguration;
+
attribute boolean supportsUnrestrictedApplePay;
[Conditional=APPLE_PAY_INSTALLMENTS] readonly attribute ApplePayInstallmentConfiguration installmentConfiguration;
Modified: trunk/Source/WebKit/ChangeLog (261872 => 261873)
--- trunk/Source/WebKit/ChangeLog 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/Source/WebKit/ChangeLog 2020-05-19 18:19:24 UTC (rev 261873)
@@ -1,3 +1,20 @@
+2020-05-19 Andy Estes <[email protected]>
+
+ [Apple Pay] Add testing and logging for ApplePaySetup
+ https://bugs.webkit.org/show_bug.cgi?id=211972
+ <rdar://problem/63291965>
+
+ Reviewed by Alex Christensen.
+
+ * Shared/ApplePay/PaymentSetupConfiguration.mm:
+ (WebKit::toPlatformConfiguration):
+ (WebKit::PaymentSetupConfiguration::PaymentSetupConfiguration):
+ * Shared/ApplePay/PaymentSetupConfigurationWebKit.h:
+ * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
+ (WebKit::WebPaymentCoordinator::getSetupFeatures):
+ (WebKit::WebPaymentCoordinator::beginApplePaySetup):
+ * WebProcess/ApplePay/WebPaymentCoordinator.h:
+
2020-05-19 Brent Fulgham <[email protected]>
REGRESSION(r243149): createMediaElementSource not working
Modified: trunk/Source/WebKit/Shared/ApplePay/PaymentSetupConfiguration.mm (261872 => 261873)
--- trunk/Source/WebKit/Shared/ApplePay/PaymentSetupConfiguration.mm 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/Source/WebKit/Shared/ApplePay/PaymentSetupConfiguration.mm 2020-05-19 18:19:24 UTC (rev 261873)
@@ -31,6 +31,7 @@
#import "ArgumentCodersCocoa.h"
#import "Decoder.h"
#import "Encoder.h"
+#import <WebCore/ApplePaySetupConfiguration.h>
#import <wtf/URL.h>
#import <pal/cocoa/PassKitSoftLink.h>
@@ -41,7 +42,7 @@
namespace WebKit {
-static RetainPtr<PKPaymentSetupConfiguration> toPlatformConfiguration(const WebCore::ApplePaySetup::Configuration& coreConfiguration, const URL& url)
+static RetainPtr<PKPaymentSetupConfiguration> toPlatformConfiguration(const WebCore::ApplePaySetupConfiguration& coreConfiguration, const URL& url)
{
#if PLATFORM(MAC)
if (!PAL::getPKPaymentSetupConfigurationClass())
@@ -66,7 +67,7 @@
return configuration;
}
-PaymentSetupConfiguration::PaymentSetupConfiguration(const WebCore::ApplePaySetup::Configuration& configuration, const URL& url)
+PaymentSetupConfiguration::PaymentSetupConfiguration(const WebCore::ApplePaySetupConfiguration& configuration, const URL& url)
: m_configuration { toPlatformConfiguration(configuration, url) }
{
}
Modified: trunk/Source/WebKit/Shared/ApplePay/PaymentSetupConfigurationWebKit.h (261872 => 261873)
--- trunk/Source/WebKit/Shared/ApplePay/PaymentSetupConfigurationWebKit.h 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/Source/WebKit/Shared/ApplePay/PaymentSetupConfigurationWebKit.h 2020-05-19 18:19:24 UTC (rev 261873)
@@ -27,7 +27,6 @@
#if HAVE(PASSKIT_PAYMENT_SETUP)
-#include <WebCore/ApplePaySetupWebCore.h>
#include <wtf/Forward.h>
#include <wtf/RetainPtr.h>
@@ -38,12 +37,16 @@
class Encoder;
}
+namespace WebCore {
+struct ApplePaySetupConfiguration;
+}
+
namespace WebKit {
class PaymentSetupConfiguration {
public:
PaymentSetupConfiguration() = default;
- PaymentSetupConfiguration(const WebCore::ApplePaySetup::Configuration&, const URL&);
+ PaymentSetupConfiguration(const WebCore::ApplePaySetupConfiguration&, const URL&);
void encode(IPC::Encoder&) const;
static Optional<PaymentSetupConfiguration> decode(IPC::Decoder&);
Modified: trunk/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp (261872 => 261873)
--- trunk/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp 2020-05-19 18:19:24 UTC (rev 261873)
@@ -224,12 +224,12 @@
#if ENABLE(APPLE_PAY_SETUP)
-void WebPaymentCoordinator::getSetupFeatures(const WebCore::ApplePaySetup::Configuration& configuration, const URL& url, CompletionHandler<void(Vector<Ref<WebCore::ApplePaySetupFeature>>&&)>&& completionHandler)
+void WebPaymentCoordinator::getSetupFeatures(const WebCore::ApplePaySetupConfiguration& configuration, const URL& url, CompletionHandler<void(Vector<Ref<WebCore::ApplePaySetupFeature>>&&)>&& completionHandler)
{
m_webPage.sendWithAsyncReply(Messages::WebPaymentCoordinatorProxy::GetSetupFeatures(PaymentSetupConfiguration { configuration, url }), WTFMove(completionHandler));
}
-void WebPaymentCoordinator::beginApplePaySetup(const WebCore::ApplePaySetup::Configuration& configuration, const URL& url, Vector<RefPtr<WebCore::ApplePaySetupFeature>>&& features, CompletionHandler<void(bool)>&& completionHandler)
+void WebPaymentCoordinator::beginApplePaySetup(const WebCore::ApplePaySetupConfiguration& configuration, const URL& url, Vector<RefPtr<WebCore::ApplePaySetupFeature>>&& features, CompletionHandler<void(bool)>&& completionHandler)
{
m_webPage.sendWithAsyncReply(Messages::WebPaymentCoordinatorProxy::BeginApplePaySetup(PaymentSetupConfiguration { configuration, url }, PaymentSetupFeatures { WTFMove(features) }), WTFMove(completionHandler));
}
Modified: trunk/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h (261872 => 261873)
--- trunk/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h 2020-05-19 18:10:40 UTC (rev 261872)
+++ trunk/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h 2020-05-19 18:19:24 UTC (rev 261873)
@@ -86,8 +86,8 @@
String userAgentScriptsBlockedErrorMessage() const final;
#if ENABLE(APPLE_PAY_SETUP)
- void getSetupFeatures(const WebCore::ApplePaySetup::Configuration&, const URL&, CompletionHandler<void(Vector<Ref<WebCore::ApplePaySetupFeature>>&&)>&&) final;
- void beginApplePaySetup(const WebCore::ApplePaySetup::Configuration&, const URL&, Vector<RefPtr<WebCore::ApplePaySetupFeature>>&&, CompletionHandler<void(bool)>&&) final;
+ void getSetupFeatures(const WebCore::ApplePaySetupConfiguration&, const URL&, CompletionHandler<void(Vector<Ref<WebCore::ApplePaySetupFeature>>&&)>&&) final;
+ void beginApplePaySetup(const WebCore::ApplePaySetupConfiguration&, const URL&, Vector<RefPtr<WebCore::ApplePaySetupFeature>>&&, CompletionHandler<void(bool)>&&) final;
void endApplePaySetup() final;
#endif