WebKit Bugzilla
Attachment 348757 Details for
Bug 189235
: [Payment Request] Implement the MerchantValidationEvent constructor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189235-20180902215015.patch (text/plain), 99.36 KB, created by
Andy Estes
on 2018-09-02 21:50:16 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Andy Estes
Created:
2018-09-02 21:50:16 PDT
Size:
99.36 KB
patch
obsolete
>Subversion Revision: 235589 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index fff37193dfdfd65651632ba6602b7546c4bb2018..f0617390fb528aa5efb88833037b0309e5d982af 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,36 @@ >+2018-09-02 Andy Estes <aestes@apple.com> >+ >+ [Payment Request] Implement the MerchantValidationEvent constructor >+ https://bugs.webkit.org/show_bug.cgi?id=189235 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Implemented the constructor for MerchantValidationEvent as defined in the Payment Request API W3C Editor's Draft of 30 August 2018. >+ >+ Updated the payment-request web platform tests to include MerchantValidationEvent tests. >+ >+ Tests: imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/constructor.http.html >+ imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/constructor.https.html >+ imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.http.html >+ imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.https.html >+ imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updatewith-method.https.html >+ imported/w3c/web-platform-tests/payment-request/onmerchantvalidation-attribute.https.html >+ >+ * CMakeLists.txt: >+ * DerivedSources.make: >+ * Modules/paymentrequest/MerchantValidationEvent.cpp: >+ (WebCore::MerchantValidationEvent::create): >+ (WebCore::MerchantValidationEvent::MerchantValidationEvent): >+ (WebCore::MerchantValidationEvent::complete): >+ * Modules/paymentrequest/MerchantValidationEvent.h: >+ * Modules/paymentrequest/MerchantValidationEvent.idl: >+ * Modules/paymentrequest/MerchantValidationEventInit.h: Added. >+ * Modules/paymentrequest/MerchantValidationEventInit.idl: Added. >+ * Modules/paymentrequest/PaymentRequest.idl: >+ * Sources.txt: >+ * WebCore.xcodeproj/project.pbxproj: >+ * bindings/js/WebCoreBuiltinNames.h: >+ > 2018-09-01 Simon Fraser <simon.fraser@apple.com> > > Rename FilterEffectRenderer to CSSFilter >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index 29bc004149387c176881aa971aecc3ec4a86bf80..b4b85de7b38cc42f3ee51d4e0c88d11acea455a0 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -334,6 +334,7 @@ set(WebCore_NON_SVG_IDL_FILES > Modules/notifications/NotificationPermissionCallback.idl > > Modules/paymentrequest/MerchantValidationEvent.idl >+ Modules/paymentrequest/MerchantValidationEventInit.idl > Modules/paymentrequest/PaymentAddress.idl > Modules/paymentrequest/PaymentComplete.idl > Modules/paymentrequest/PaymentCurrencyAmount.idl >diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make >index f787586edde45fc9126253d630567b46f7667da6..eb8a804c65b254de178f62ba5fa65aa422699d07 100644 >--- a/Source/WebCore/DerivedSources.make >+++ b/Source/WebCore/DerivedSources.make >@@ -254,6 +254,7 @@ JS_BINDING_IDLS = \ > $(WebCore)/Modules/notifications/NotificationPermission.idl \ > $(WebCore)/Modules/notifications/NotificationPermissionCallback.idl \ > $(WebCore)/Modules/paymentrequest/MerchantValidationEvent.idl \ >+ $(WebCore)/Modules/paymentrequest/MerchantValidationEventInit.idl \ > $(WebCore)/Modules/paymentrequest/PaymentAddress.idl \ > $(WebCore)/Modules/paymentrequest/PaymentComplete.idl \ > $(WebCore)/Modules/paymentrequest/PaymentCurrencyAmount.idl \ >diff --git a/Source/WebCore/Modules/paymentrequest/MerchantValidationEvent.cpp b/Source/WebCore/Modules/paymentrequest/MerchantValidationEvent.cpp >index 692757769ac0f382ec6a07b51224e9fe72e1eda9..c77b9b64f0efb7c57da38d8929ea0a8cb797e7fc 100644 >--- a/Source/WebCore/Modules/paymentrequest/MerchantValidationEvent.cpp >+++ b/Source/WebCore/Modules/paymentrequest/MerchantValidationEvent.cpp >@@ -28,6 +28,8 @@ > > #if ENABLE(PAYMENT_REQUEST) > >+#include "Document.h" >+#include "MerchantValidationEventInit.h" > #include "PaymentRequest.h" > > namespace WebCore { >@@ -37,11 +39,28 @@ Ref<MerchantValidationEvent> MerchantValidationEvent::create(const AtomicString& > return adoptRef(*new MerchantValidationEvent(type, validationURL, paymentRequest)); > } > >+ExceptionOr<Ref<MerchantValidationEvent>> MerchantValidationEvent::create(Document& document, const AtomicString& type, MerchantValidationEventInit&& eventInit) >+{ >+ URL validationURL { document.url(), eventInit.validationURL }; >+ if (!validationURL.isValid()) >+ return Exception { TypeError }; >+ >+ return adoptRef(*new MerchantValidationEvent(type, WTFMove(validationURL), WTFMove(eventInit))); >+} >+ > MerchantValidationEvent::MerchantValidationEvent(const AtomicString& type, const URL& validationURL, PaymentRequest& paymentRequest) > : Event { type, Event::CanBubble::No, Event::IsCancelable::No } > , m_validationURL { validationURL } >- , m_paymentRequest { paymentRequest } >+ , m_paymentRequest { &paymentRequest } > { >+ ASSERT(isTrusted()); >+} >+ >+MerchantValidationEvent::MerchantValidationEvent(const AtomicString& type, URL&& validationURL, MerchantValidationEventInit&& eventInit) >+ : Event { type, WTFMove(eventInit), IsTrusted::No } >+ , m_validationURL { WTFMove(validationURL) } >+{ >+ ASSERT(!isTrusted()); > } > > EventInterface MerchantValidationEvent::eventInterface() const >@@ -54,6 +73,8 @@ ExceptionOr<void> MerchantValidationEvent::complete(Ref<DOMPromise>&& merchantSe > if (!isTrusted()) > return Exception { InvalidStateError }; > >+ ASSERT(m_paymentRequest); >+ > if (m_isCompleted) > return Exception { InvalidStateError }; > >diff --git a/Source/WebCore/Modules/paymentrequest/MerchantValidationEvent.h b/Source/WebCore/Modules/paymentrequest/MerchantValidationEvent.h >index e9f924af73685f1707bd38c792266b20ede4e285..dad101c721ee8f10bf581e1d5ceb9caced1b5b77 100644 >--- a/Source/WebCore/Modules/paymentrequest/MerchantValidationEvent.h >+++ b/Source/WebCore/Modules/paymentrequest/MerchantValidationEvent.h >@@ -35,23 +35,26 @@ namespace WebCore { > class DOMPromise; > class Document; > class PaymentRequest; >+struct MerchantValidationEventInit; > > class MerchantValidationEvent final : public Event { > public: > static Ref<MerchantValidationEvent> create(const AtomicString&, const URL&, PaymentRequest&); >+ static ExceptionOr<Ref<MerchantValidationEvent>> create(Document&, const AtomicString&, MerchantValidationEventInit&&); > > const String& validationURL() const { return m_validationURL.string(); } > ExceptionOr<void> complete(Ref<DOMPromise>&&); > > private: > MerchantValidationEvent(const AtomicString&, const URL&, PaymentRequest&); >+ MerchantValidationEvent(const AtomicString&, URL&&, MerchantValidationEventInit&&); > > // Event > EventInterface eventInterface() const final; > > bool m_isCompleted { false }; > URL m_validationURL; >- Ref<PaymentRequest> m_paymentRequest; >+ RefPtr<PaymentRequest> m_paymentRequest; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/Modules/paymentrequest/MerchantValidationEvent.idl b/Source/WebCore/Modules/paymentrequest/MerchantValidationEvent.idl >index cb80bf598ed53fe3e8191f58dcbe560ae602c058..56fea86fab6cf804698f979319510d7e10dd52e0 100644 >--- a/Source/WebCore/Modules/paymentrequest/MerchantValidationEvent.idl >+++ b/Source/WebCore/Modules/paymentrequest/MerchantValidationEvent.idl >@@ -25,7 +25,11 @@ > > [ > Conditional=PAYMENT_REQUEST, >- NoInterfaceObject, >+ Constructor(DOMString type, optional MerchantValidationEventInit eventInitDict), >+ ConstructorCallWith=Document, >+ ConstructorMayThrowException, >+ Exposed=Window, >+ SecureContext, > ] interface MerchantValidationEvent : Event { > readonly attribute DOMString validationURL; > [MayThrowException] void complete(Promise<any> merchantSessionPromise); >diff --git a/Source/WebCore/Modules/paymentrequest/MerchantValidationEventInit.h b/Source/WebCore/Modules/paymentrequest/MerchantValidationEventInit.h >new file mode 100644 >index 0000000000000000000000000000000000000000..8ad0e86d9ea75168f35c39a9a0b25ffb7521d60f >--- /dev/null >+++ b/Source/WebCore/Modules/paymentrequest/MerchantValidationEventInit.h >@@ -0,0 +1,40 @@ >+/* >+ * Copyright (C) 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 "EventInit.h" >+ >+namespace WebCore { >+ >+struct MerchantValidationEventInit final : EventInit { >+ String validationURL; >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(PAYMENT_REQUEST) >diff --git a/Source/WebCore/Modules/paymentrequest/MerchantValidationEventInit.idl b/Source/WebCore/Modules/paymentrequest/MerchantValidationEventInit.idl >new file mode 100644 >index 0000000000000000000000000000000000000000..053167d7b2c027a814f26ba7301fbb6f1ca10fdc >--- /dev/null >+++ b/Source/WebCore/Modules/paymentrequest/MerchantValidationEventInit.idl >@@ -0,0 +1,30 @@ >+/* >+ * Copyright (C) 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. >+ */ >+ >+[ >+ Conditional=PAYMENT_REQUEST, >+] dictionary MerchantValidationEventInit : EventInit { >+ USVString validationURL = ""; >+}; >diff --git a/Source/WebCore/Modules/paymentrequest/PaymentRequest.idl b/Source/WebCore/Modules/paymentrequest/PaymentRequest.idl >index f99226759da8d253d8917d5c5d21904e9048c99d..7fc3e7cce8ab45cdb65a7a04b15f70db5ceb9344 100644 >--- a/Source/WebCore/Modules/paymentrequest/PaymentRequest.idl >+++ b/Source/WebCore/Modules/paymentrequest/PaymentRequest.idl >@@ -41,8 +41,8 @@ > readonly attribute DOMString? shippingOption; > readonly attribute PaymentShippingType? shippingType; > >+ attribute EventHandler onmerchantvalidation; > attribute EventHandler onshippingaddresschange; > attribute EventHandler onshippingoptionchange; > attribute EventHandler onpaymentmethodchange; >- attribute EventHandler onmerchantvalidation; > }; >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index 0dcaa831e7fd763632efaa51026a4ed60f21cb07..56bf39bc2bfd4523eb8670c9f32c29b01e81f59f 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -2764,6 +2764,7 @@ JSMediaStreamTrackEvent.cpp > JSMediaTrackConstraints.cpp > JSMediaTrackSupportedConstraints.cpp > JSMerchantValidationEvent.cpp >+JSMerchantValidationEventInit.cpp > JSMessageChannel.cpp > JSMessageEvent.cpp > JSMessagePort.cpp >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 1ae6827adcc00ca0fb041436490999c054cdb613..fd5fbfa3f4c545bdc294cfc079a5f777047260d7 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -2923,6 +2923,8 @@ > A164A24E2134BDD800509156 /* PaymentMethodChangeEventInit.h in Headers */ = {isa = PBXBuildFile; fileRef = A164A24B2134BDD800509156 /* PaymentMethodChangeEventInit.h */; }; > A164A2552134C1CC00509156 /* JSPaymentMethodChangeEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A164A2512134C1CB00509156 /* JSPaymentMethodChangeEvent.h */; }; > A164A2562134C1CC00509156 /* JSPaymentMethodChangeEventInit.h in Headers */ = {isa = PBXBuildFile; fileRef = A164A2522134C1CB00509156 /* JSPaymentMethodChangeEventInit.h */; }; >+ A1677DE9213CDFAA00A08C34 /* MerchantValidationEventInit.h in Headers */ = {isa = PBXBuildFile; fileRef = A1677DE6213CDFAA00A08C34 /* MerchantValidationEventInit.h */; }; >+ A1677DF0213CE0B100A08C34 /* JSMerchantValidationEventInit.h in Headers */ = {isa = PBXBuildFile; fileRef = A1677DEE213CE0B000A08C34 /* JSMerchantValidationEventInit.h */; }; > A1763F3F1E205234001D58DE /* WebArchiveDumpSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = A1763F3D1E205234001D58DE /* WebArchiveDumpSupport.h */; settings = {ATTRIBUTES = (Private, ); }; }; > A1763F411E20586E001D58DE /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1763F401E20586E001D58DE /* CFNetwork.framework */; }; > A17C81230F2A5CF7005DAAEB /* HTMLElementFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = A17C81210F2A5CF7005DAAEB /* HTMLElementFactory.h */; }; >@@ -10934,6 +10936,10 @@ > A164A2522134C1CB00509156 /* JSPaymentMethodChangeEventInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPaymentMethodChangeEventInit.h; sourceTree = "<group>"; }; > A164A2532134C1CB00509156 /* JSPaymentMethodChangeEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPaymentMethodChangeEvent.cpp; sourceTree = "<group>"; }; > A164A2542134C1CC00509156 /* JSPaymentMethodChangeEventInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPaymentMethodChangeEventInit.cpp; sourceTree = "<group>"; }; >+ A1677DE6213CDFAA00A08C34 /* MerchantValidationEventInit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MerchantValidationEventInit.h; sourceTree = "<group>"; }; >+ A1677DE8213CDFAA00A08C34 /* MerchantValidationEventInit.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = MerchantValidationEventInit.idl; sourceTree = "<group>"; }; >+ A1677DED213CE0AF00A08C34 /* JSMerchantValidationEventInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMerchantValidationEventInit.cpp; sourceTree = "<group>"; }; >+ A1677DEE213CE0B000A08C34 /* JSMerchantValidationEventInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMerchantValidationEventInit.h; sourceTree = "<group>"; }; > A1763F3C1E205234001D58DE /* WebArchiveDumpSupport.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebArchiveDumpSupport.mm; sourceTree = "<group>"; }; > A1763F3D1E205234001D58DE /* WebArchiveDumpSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebArchiveDumpSupport.h; sourceTree = "<group>"; }; > A1763F401E20586E001D58DE /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; }; >@@ -21236,6 +21242,8 @@ > children = ( > A11AE0D01FFD61DE0047348B /* JSMerchantValidationEvent.cpp */, > A11AE0D11FFD61DF0047348B /* JSMerchantValidationEvent.h */, >+ A1677DED213CE0AF00A08C34 /* JSMerchantValidationEventInit.cpp */, >+ A1677DEE213CE0B000A08C34 /* JSMerchantValidationEventInit.h */, > A1CC565F1F46146100A4555B /* JSPaymentAddress.cpp */, > A1CC56651F46146800A4555B /* JSPaymentAddress.h */, > A1CC56601F46146200A4555B /* JSPaymentComplete.cpp */, >@@ -21295,6 +21303,8 @@ > A11AE0CA1FFD60530047348B /* MerchantValidationEvent.cpp */, > A11AE0C91FFD60530047348B /* MerchantValidationEvent.h */, > A11AE0CB1FFD60530047348B /* MerchantValidationEvent.idl */, >+ A1677DE6213CDFAA00A08C34 /* MerchantValidationEventInit.h */, >+ A1677DE8213CDFAA00A08C34 /* MerchantValidationEventInit.idl */, > A1CFE0311F9E71290065C345 /* PaymentAddress.cpp */, > A1F76B401F44CF7F0014C318 /* PaymentAddress.h */, > A1F76B421F44CF7F0014C318 /* PaymentAddress.idl */, >@@ -28749,6 +28759,7 @@ > 932CC0D51DFFD667004C0F9F /* JSMediaTrackConstraints.h in Headers */, > 0787C46A1BFBDF6F006DCD7F /* JSMediaTrackSupportedConstraints.h in Headers */, > A11AE0D31FFD61DF0047348B /* JSMerchantValidationEvent.h in Headers */, >+ A1677DF0213CE0B100A08C34 /* JSMerchantValidationEventInit.h in Headers */, > E107400E0E77BDC00033AF24 /* JSMessageChannel.h in Headers */, > 75793EC90D0CE72D007FC0AC /* JSMessageEvent.h in Headers */, > E1ADEDDA0E76BD93004A1A5E /* JSMessagePort.h in Headers */, >@@ -29386,6 +29397,7 @@ > 517139061BF64DEC000D5F01 /* MemoryObjectStoreCursor.h in Headers */, > 413E00791DB0E4F2002341D2 /* MemoryRelease.h in Headers */, > A11AE0CC1FFD60530047348B /* MerchantValidationEvent.h in Headers */, >+ A1677DE9213CDFAA00A08C34 /* MerchantValidationEventInit.h in Headers */, > 93309DFA099E64920056E581 /* MergeIdenticalElementsCommand.h in Headers */, > E1ADECCE0E76AD8B004A1A5E /* MessageChannel.h in Headers */, > 75793E840D0CE0B3007FC0AC /* MessageEvent.h in Headers */, >diff --git a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >index ec5bee6ba5467383d505cb30508ead7650f2695e..484e6ba56096d172fbc5908f25decc7b0b788233 100644 >--- a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >+++ b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >@@ -100,6 +100,7 @@ namespace WebCore { > macro(MediaSource) \ > macro(MediaStream) \ > macro(MediaStreamTrack) \ >+ macro(MerchantValidationEvent) \ > macro(ModernMediaControls) \ > macro(NavigatorCredentials) \ > macro(NavigatorMediaDevices) \ >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 2c2f481af1fcaf10ddfe88d8f3b625d8b3b3e027..46108a430f56f49c92be1f05590a39fee663f088 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2018-09-02 Andy Estes <aestes@apple.com> >+ >+ [Payment Request] Implement the MerchantValidationEvent constructor >+ https://bugs.webkit.org/show_bug.cgi?id=189235 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Skipped new manual tests. >+ >+ * platform/ios-wk2/TestExpectations: >+ * platform/mac-wk2/TestExpectations: >+ > 2018-09-02 Yusuke Suzuki <yusukesuzuki@slowstart.org> > > Implement Object.fromEntries >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index 17011ac7723749e549a69570fdd3b065e5c6a866..d24e17895ae6dce52bfbe9e65a7568d372540c3c 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,43 @@ >+2018-09-02 Andy Estes <aestes@apple.com> >+ >+ [Payment Request] Implement the MerchantValidationEvent constructor >+ https://bugs.webkit.org/show_bug.cgi?id=189235 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Updated payment-request web platform tests to 0313d9f. >+ >+ * resources/TestRepositories: >+ * resources/import-expectations.json: >+ * web-platform-tests/payment-request/MerchantValidationEvent/complete-method-manual.https.html: Added. >+ * web-platform-tests/payment-request/MerchantValidationEvent/constructor.http-expected.txt: Added. >+ * web-platform-tests/payment-request/MerchantValidationEvent/constructor.http.html: Added. >+ * web-platform-tests/payment-request/MerchantValidationEvent/constructor.https-expected.txt: Added. >+ * web-platform-tests/payment-request/MerchantValidationEvent/constructor.https.html: Added. >+ * web-platform-tests/payment-request/MerchantValidationEvent/w3c-import.log: Added. >+ * web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.http-expected.txt: Added. >+ * web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.http.html: Added. >+ * web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.https-expected.txt: Added. >+ * web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.https.html: Added. >+ * web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-call-immediate-manual.https.html: Added. >+ * web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-duplicate-shipping-options-manual.https.html: Added. >+ * web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-incremental-update-manual.https.html: Added. >+ * web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-method-abort-update-manual.https.html: Added. >+ * web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-state-checks-manual.https.html: Added. >+ * web-platform-tests/payment-request/PaymentRequestUpdateEvent/updatewith-method.https-expected.txt: Added. >+ * web-platform-tests/payment-request/PaymentRequestUpdateEvent/updatewith-method.https.html: Added. >+ * web-platform-tests/payment-request/PaymentRequestUpdateEvent/w3c-import.log: Added. >+ * web-platform-tests/payment-request/allowpaymentrequest/common.sub.js: >+ (window.onmessage.e.t.step): >+ (string_appeared_here.forEach): >+ (window.onmessage): Deleted. >+ * web-platform-tests/payment-request/allowpaymentrequest/echo-PaymentRequest.html: >+ * web-platform-tests/payment-request/onmerchantvalidation-attribute.https-expected.txt: Added. >+ * web-platform-tests/payment-request/onmerchantvalidation-attribute.https.html: Added. >+ * web-platform-tests/payment-request/payment-request-abort-method.https-expected.txt: >+ * web-platform-tests/payment-request/payment-request-canmakepayment-method.https-expected.txt: >+ * web-platform-tests/payment-request/w3c-import.log: >+ > 2018-08-30 Ryosuke Niwa <rniwa@webkit.org> > > Add assignedElements to HTMLSlotElement >diff --git a/LayoutTests/imported/w3c/resources/TestRepositories b/LayoutTests/imported/w3c/resources/TestRepositories >index 75818b120becb82167292357b6bd35b8e96c723d..9b3f853c0d188fa60131a6c22e23c86cead57565 100644 >--- a/LayoutTests/imported/w3c/resources/TestRepositories >+++ b/LayoutTests/imported/w3c/resources/TestRepositories >@@ -2,7 +2,7 @@ > { > "name": "web-platform-tests", > "url": "https://github.com/web-platform-tests/wpt.git", >- "revision": "94b33b5", >+ "revision": "0313d9f", > "paths_to_skip": [ > "conformance-checkers", > "docs", >diff --git a/LayoutTests/imported/w3c/resources/import-expectations.json b/LayoutTests/imported/w3c/resources/import-expectations.json >index 8e738cd58b8796548624d029b2c3d5583a31d6bc..43385b03b2caab95eb39a4858c094df1a4b20c97 100644 >--- a/LayoutTests/imported/w3c/resources/import-expectations.json >+++ b/LayoutTests/imported/w3c/resources/import-expectations.json >@@ -274,7 +274,6 @@ > "web-platform-tests/payment-method-basic-card": "skip", > "web-platform-tests/payment-method-id": "skip", > "web-platform-tests/payment-request": "import", >- "web-platform-tests/payment-request/PaymentRequestUpdateEvent": "skip", > "web-platform-tests/performance-timeline": "skip", > "web-platform-tests/pointerevents": "skip", > "web-platform-tests/pointerlock": "skip", >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/complete-method-manual.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/complete-method-manual.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..99a10e9dc79bd957a030f26c114f3ee51bb190d8 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/complete-method-manual.https.html >@@ -0,0 +1,15 @@ >+<!DOCTYPE html> >+<meta charset="utf-8"> >+<link rel="help" href="https://w3c.github.io/browser-payment-api/#dom-merchantvalidationevent-complete"> >+<title>Test for the MerchantValidationEvent's complete() method.</title> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<body> >+<script> >+test(() => { >+ const event = new MerchantValidationEvent("test"); >+ assert_throws(() => { >+ event.complete(""); >+ }) >+}, "If event's isTrusted attribute is false, then then throw an InvalidStateError DOMException."); >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/constructor.http-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/constructor.http-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..e35398bdff3597172c4fe670b1fd79c7599d5e02 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/constructor.http-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS MerchantValidationEvent constructor must not be exposed in insecure context >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/constructor.http.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/constructor.http.html >new file mode 100644 >index 0000000000000000000000000000000000000000..8368c79a3b1dea2df26bbc804208002ec97fbf09 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/constructor.http.html >@@ -0,0 +1,11 @@ >+<!DOCTYPE html> >+<meta charset="utf-8"> >+<title>Test for MerchantValidationEvent Constructor (insecure)</title> >+<link rel="help" href="https://w3c.github.io/browser-payment-api/#merchantvalidationevent-interface"> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script> >+test(() => { >+ assert_false("MerchantValidationEvent" in Window); >+}, "MerchantValidationEvent constructor must not be exposed in insecure context"); >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/constructor.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/constructor.https-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..21c3b38df89ae71d9d0dbf8135ff48a785db9aa9 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/constructor.https-expected.txt >@@ -0,0 +1,8 @@ >+ >+PASS MerchantValidationEvent can be constructed in secure-context. >+PASS MerchantValidationEvent can be constructed with an EventInitDict, even if not trusted. >+PASS MerchantValidationEvent can be dispatched, even if not trusted. >+PASS Must have a validationURL IDL attribute, which is initialized with to the validationURL dictionary value. >+PASS Must throw TypeError if initialized with an invalid URL. >+PASS Relative validationURLs use the document as the base. >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/constructor.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/constructor.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..952c0f734a30f170964053bb00e55225d57cce0b >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/constructor.https.html >@@ -0,0 +1,76 @@ >+<!DOCTYPE html> >+<!-- Copyright © 2017 Chromium authors and World Wide Web Consortium, (Massachusetts Institute of Technology, ERCIM, Keio University, Beihang). --> >+<meta charset="utf-8"> >+<title>Test for MerchantValidationEvent Constructor</title> >+<link rel="help" href="https://w3c.github.io/browser-payment-api/#merchantvalidationevent-constructor"> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script> >+const applePay = Object.freeze({ supportedMethods: "https://apple.com/apple-pay"}); >+const basicCard = Object.freeze({ supportedMethods: "basic-card" }); >+const defaultMethods = Object.freeze([basicCard, applePay]); >+const defaultDetails = Object.freeze({ >+ total: { >+ label: "Total", >+ amount: { >+ currency: "USD", >+ value: "1.00", >+ }, >+ }, >+}); >+ >+test(() => { >+ new MerchantValidationEvent("test"); >+}, "MerchantValidationEvent can be constructed in secure-context."); >+ >+test(() => { >+ const ev = new MerchantValidationEvent("test", { >+ bubbles: true, >+ cancelable: true, >+ composed: true, >+ }); >+ assert_false(ev.isTrusted, "constructed in script, so not trusted"); >+ assert_true(ev.bubbles, "set by EventInitDict"); >+ assert_true(ev.cancelable, "set by EventInitDict"); >+ assert_true(ev.composed, "set by EventInitDict"); >+ assert_equals(ev.target, null, "initially null"); >+ assert_equals(ev.type, "test"); >+}, "MerchantValidationEvent can be constructed with an EventInitDict, even if not trusted."); >+ >+test(() => { >+ const request = new PaymentRequest(defaultMethods, defaultDetails); >+ const ev = new MerchantValidationEvent("test"); >+ request.addEventListener("test", evt => { >+ assert_equals(ev, evt); >+ }); >+ request.dispatchEvent(ev); >+}, "MerchantValidationEvent can be dispatched, even if not trusted."); >+ >+test(() => { >+ const validationURL = "https://pass.com"; >+ const event = new MerchantValidationEvent("test", { validationURL }); >+ assert_idl_attribute(event, "validationURL"); >+ assert_equals(event.validationURL, "https://pass.com/"); >+}, "Must have a validationURL IDL attribute, which is initialized with to the validationURL dictionary value."); >+ >+test(() => { >+ const validationURL = "http://\u005B"; // invalid URL >+ assert_throws(new TypeError(), () => { >+ new MerchantValidationEvent("test", { validationURL }) >+ }); >+}, "Must throw TypeError if initialized with an invalid URL."); >+ >+test(() => { >+ const validationURL = ""; >+ const relativePaths = [ >+ "", >+ ".", >+ "/test", >+ ] >+ for(const path of relativePaths ) { >+ const event = new MerchantValidationEvent("test", { validationURL: path }); >+ const expected = new URL(path, document.location.href).href; >+ assert_equals(event.validationURL, expected); >+ } >+}, "Relative validationURLs use the document as the base."); >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/w3c-import.log >new file mode 100644 >index 0000000000000000000000000000000000000000..d211084d1abb4c7533b6c4f36f3854b056b7229a >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/w3c-import.log >@@ -0,0 +1,19 @@ >+The tests in this directory were imported from the W3C repository. >+Do NOT modify these tests directly in WebKit. >+Instead, create a pull request on the WPT github: >+ https://github.com/web-platform-tests/wpt >+ >+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport >+ >+Do NOT modify or remove this file. >+ >+------------------------------------------------------------------------ >+Properties requiring vendor prefixes: >+None >+Property values requiring vendor prefixes: >+None >+------------------------------------------------------------------------ >+List of files: >+/LayoutTests/imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/complete-method-manual.https.html >+/LayoutTests/imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/constructor.http.html >+/LayoutTests/imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/constructor.https.html >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.http-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.http-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..41c9a40453bd00ebe1c14c76ccb7d6ed110e57bb >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.http-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS PaymentRequestUpdateEvent constructor must not be exposed in insecure context >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.http.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.http.html >new file mode 100644 >index 0000000000000000000000000000000000000000..db7765f7bf98c38935804c2588614911a97a2290 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.http.html >@@ -0,0 +1,12 @@ >+<!DOCTYPE html> >+<!-- Copyright © 2017 Chromium authors and World Wide Web Consortium, (Massachusetts Institute of Technology, ERCIM, Keio University, Beihang). --> >+<meta charset="utf-8"> >+<title>Test for PaymentRequestUpdateEvent Constructor (insecure)</title> >+<link rel="help" href="https://w3c.github.io/browser-payment-api/#paymentrequestupdateevent-interface"> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script> >+test(() => { >+ assert_false("PaymentRequestUpdateEvent" in Window); >+}, "PaymentRequestUpdateEvent constructor must not be exposed in insecure context"); >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.https-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..704adb5653646b948d33be9f54b140dcae734d5e >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.https-expected.txt >@@ -0,0 +1,5 @@ >+ >+PASS PaymentRequestUpdateEvent can be constructed in secure-context >+PASS PaymentRequestUpdateEvent can be constructed with an EventInitDict, even if not trusted >+PASS PaymentRequestUpdateEvent can be dispatched, even if not trusted >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..fd66493bf4f2aa006e99198094d1b7afd34f4543 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.https.html >@@ -0,0 +1,52 @@ >+<!DOCTYPE html> >+<!-- Copyright © 2017 Chromium authors and World Wide Web Consortium, (Massachusetts Institute of Technology, ERCIM, Keio University, Beihang). --> >+<meta charset="utf-8"> >+<title>Test for PaymentRequestUpdateEvent Constructor</title> >+<link rel="help" href="https://w3c.github.io/browser-payment-api/#constructor"> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script> >+const basicCard = Object.freeze({ supportedMethods: "basic-card" }); >+const defaultMethods = Object.freeze([basicCard]); >+const defaultDetails = Object.freeze({ >+ total: { >+ label: "Total", >+ amount: { >+ currency: "USD", >+ value: "1.00", >+ }, >+ }, >+}); >+ >+test(() => { >+ try { >+ new PaymentRequestUpdateEvent("test"); >+ } catch (err) { >+ assert_unreached(`Unexpected exception: ${err.message}`); >+ } >+}, "PaymentRequestUpdateEvent can be constructed in secure-context"); >+ >+test(() => { >+ const ev = new PaymentRequestUpdateEvent("test", { >+ bubbles: true, >+ cancelable: true, >+ composed: true, >+ }); >+ assert_false(ev.isTrusted, "constructed in script, so not be trusted"); >+ assert_true(ev.bubbles, "set by EventInitDict"); >+ assert_true(ev.cancelable, "set by EventInitDict"); >+ assert_true(ev.composed, "set by EventInitDict"); >+ assert_equals(ev.target, null, "initially null"); >+ assert_equals(ev.type, "test"); >+}, "PaymentRequestUpdateEvent can be constructed with an EventInitDict, even if not trusted"); >+ >+test(() => { >+ const request = new PaymentRequest(defaultMethods, defaultDetails); >+ const ev = new PaymentRequestUpdateEvent("test"); >+ request.addEventListener("test", evt => { >+ assert_equals(ev, evt); >+ }); >+ request.dispatchEvent(ev); >+}, "PaymentRequestUpdateEvent can be dispatched, even if not trusted"); >+ >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-call-immediate-manual.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-call-immediate-manual.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..cd928d4be1d8609a34d06e0a960306fc95b84e32 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-call-immediate-manual.https.html >@@ -0,0 +1,193 @@ >+<!doctype html> >+<meta charset="utf8"> >+<link rel="help" href="https://www.w3.org/TR/payment-request/#updatewith()-method"> >+<link rel="help" href="https://github.com/w3c/payment-request/pull/591"> >+<title> >+ PaymentRequestUpdateEvent.updateWith() needs to be called immediately >+</title> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script> >+setup({ explicit_done: true, explicit_timeout: true }); >+const validMethod = Object.freeze({ supportedMethods: "basic-card" }); >+const validMethods = Object.freeze([validMethod]); >+const validAmount = Object.freeze({ currency: "USD", value: "5.00" }); >+const validTotal = Object.freeze({ >+ label: "label", >+ amount: validAmount, >+}); >+const validShippingOptionA = Object.freeze({ >+ id: "a-shipping-option", >+ label: "A shipping option", >+ amount: validAmount, >+ selected: true, >+}); >+const validShippingOptionB = Object.freeze({ >+ id: "b-shipping-option", >+ label: "B shipping option", >+ amount: validAmount, >+}); >+const validDetails = Object.freeze({ >+ total: validTotal, >+ shippingOptions: [validShippingOptionA, validShippingOptionB], >+}); >+const validOptions = Object.freeze({ >+ requestShipping: true, >+}); >+ >+function testImmediateUpdate({ textContent: testName }) { >+ promise_test(async t => { >+ const request = new PaymentRequest( >+ validMethods, >+ validDetails, >+ validOptions >+ ); >+ const eventPromise = new Promise((resolve, reject) => { >+ request.addEventListener( >+ "shippingaddresschange", >+ async ev => { >+ // spin the event loop, sets [[waitForUpdate]] to true. >+ await Promise.resolve(); >+ try { >+ ev.updateWith(validDetails); >+ resolve(); // This is bad. >+ } catch (err) { >+ reject(err); // this is good. >+ } >+ }, >+ { once: true } >+ ); >+ }); >+ const response = await request.show(); >+ await promise_rejects( >+ t, >+ "InvalidStateError", >+ eventPromise, >+ "The event loop already spun, so [[waitForUpdate]] is now true" >+ ); >+ await response.complete(); >+ }, testName.trim()); >+} >+ >+function testSubsequentUpdateWithCalls({ textContent: testName }) { >+ promise_test(async t => { >+ const request = new PaymentRequest( >+ validMethods, >+ validDetails, >+ validOptions >+ ); >+ const eventPromise = new Promise((resolve, reject) => { >+ request.addEventListener("shippingaddresschange", async ev => { >+ const p = Promise.resolve(validDetails); >+ ev.updateWith(p); >+ await p; >+ try { >+ ev.updateWith(validDetails); >+ resolve(); // this is bad, we should never get to here. >+ } catch (err) { >+ reject(err); // this is good! >+ } >+ }); >+ }); >+ const responsePromise = request.show(); >+ await promise_rejects( >+ t, >+ "InvalidStateError", >+ eventPromise, >+ "Expected eventPromise to have rejected, because updateWith() was a called twice" >+ ); >+ const response = await responsePromise; >+ await response.complete(); >+ }, testName.trim()); >+} >+ >+function testRecycleEvents({ textContent: testName }) { >+ promise_test(async t => { >+ const request = new PaymentRequest( >+ validMethods, >+ validDetails, >+ validOptions >+ ); >+ >+ // Register both listeners. >+ const addressChangedPromise = new Promise(resolve => { >+ request.addEventListener("shippingaddresschange", resolve, { >+ once: true, >+ }); >+ }); >+ >+ const optionChangedPromise = new Promise(resolve => { >+ request.addEventListener("shippingoptionchange", resolve, { >+ once: true, >+ }); >+ }); >+ >+ const responsePromise = request.show(); >+ >+ // Let's wait for the address to change. >+ const addressChangeEvent = await addressChangedPromise; >+ >+ // Sets [[waitingForUpdate]] to true. >+ addressChangeEvent.updateWith(validDetails); >+ >+ // Let's wait for the shippingOption. >+ const optionChangeEvent = await optionChangedPromise; >+ >+ // Here, we try to be sneaky, and reuse the addressChangeEvent to perform the update. >+ // However, addressChangeEvent [[waitingForUpdate]] is true, so it throws. >+ assert_throws( >+ "InvalidStateError", >+ () => { >+ addressChangeEvent.updateWith(validDetails); >+ }, >+ "addressChangeEvent [[waitingForUpdate]] is true, so it must throw" >+ ); >+ >+ // But optionChangeEvent is still usable tho, so... >+ optionChangeEvent.updateWith(validDetails); >+ >+ assert_throws( >+ "InvalidStateError", >+ () => { >+ optionChangeEvent.updateWith(validDetails); >+ }, >+ "optionChangeEvent [[waitingForUpdate]] is true, so it must throw" >+ ); >+ >+ const response = await responsePromise; >+ await response.complete(); >+ }, testName.trim()); >+} >+</script> >+<h2>updateWith() method</h2> >+<p> >+ Click on each button in sequence from top to bottom without refreshing the page. >+ Each button will bring up the Payment Request UI window. >+</p> >+<p> >+ When the payment sheet is shown, select a different shipping address once. Then pay. >+</p> >+<ol> >+ <li id="test-0"> >+ <button onclick="testImmediateUpdate(this);"> >+ updateWith() must be called immediately, otherwise must throw an InvalidStateError. >+ </button> >+ </li> >+ <li id="test-1"> >+ <button onclick="testSubsequentUpdateWithCalls(this);"> >+ Once the event has performed an update, subsequent calls to updateWith() must throw InvalidStateError. >+ </button> >+ </li> >+ <li id="test-2"> >+ <button onclick="testRecycleEvents(this);"> >+ Recycling events must not be possible. >+ </button> When the payment sheet is shown, select a different shipping address once, then change shipping option once. Then pay. >+ </li> >+ <li> >+ <button onclick="done();">Done!</button> >+ </li> >+</ol> >+<small> >+ If you find a buggy test, please <a href="https://github.com/web-platform-tests/wpt/issues">file a bug</a> >+ and tag one of the <a href="https://github.com/web-platform-tests/wpt/blob/master/payment-request/META.yml">suggested reviewers</a>. >+</small> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-duplicate-shipping-options-manual.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-duplicate-shipping-options-manual.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..40ba3057e0cb10412df759516ee19392ae70f1c3 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-duplicate-shipping-options-manual.https.html >@@ -0,0 +1,97 @@ >+<!doctype html> >+<meta charset="utf8"> >+<link rel="help" href="https://w3c.github.io/payment-request/#updatewith()-method"> >+<title> >+ updateWith() method - duplicate shippingOption ids >+</title> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script> >+setup({ explicit_done: true, explicit_timeout: true }); >+ >+const validMethod = Object.freeze({ supportedMethods: "basic-card" }); >+const validMethods = [validMethod]; >+const validAmount = Object.freeze({ >+ currency: "USD", >+ value: "5.00", >+}); >+const validShippingOption = Object.freeze({ >+ id: "option1", >+ label: "Option 1", >+ amount: validAmount, >+ selected: true, >+}); >+const validShippingOptions = Object.freeze([validShippingOption]); >+const validDetails = Object.freeze({ >+ total: { >+ label: "Total due", >+ amount: validAmount, >+ }, >+ shippingOptions: validShippingOptions, >+}); >+const validOptions = Object.freeze({ >+ requestShipping: true, >+}); >+ >+test(() => { >+ try { >+ const request = new PaymentRequest(validMethods, validDetails); >+ } catch (err) { >+ done(); >+ throw err; >+ } >+}, "Must construct a PaymentRequest (smoke test)"); >+ >+function testFireEvents(button) { >+ button.disabled = true; >+ promise_test(async t => { >+ const request = new PaymentRequest( >+ validMethods, >+ validDetails, >+ validOptions >+ ); >+ request.addEventListener("shippingaddresschange", event => { >+ // Same option, so duplicate ids >+ const otherShippingOption = Object.assign({}, validShippingOption, { >+ id: "other", >+ }); >+ const shippingOptions = [ >+ validShippingOption, >+ otherShippingOption, >+ validShippingOption, >+ ]; >+ const newDetails = Object.assign({}, validDetails, { shippingOptions }); >+ event.updateWith(newDetails); >+ }); >+ const acceptPromise = request.show(); >+ await promise_rejects( >+ t, >+ new TypeError(), >+ acceptPromise, >+ "Duplicate shippingOption ids must abort with TypeError" >+ ); >+ }, button.textContent.trim()); >+ done(); >+} >+</script> >+<h2>updateWith() method - duplicate shippingOptions ids</h2> >+<p> >+ Click on each button in sequence from top to bottom without refreshing the page. >+ Each button will bring up the Payment Request UI window. >+</p> >+<p> >+ When the payment sheet is shown, select a different shipping address. >+ If you have to manually abort the test from the payment sheet, then the >+ test has failed. >+</p> >+<ol> >+ <li> >+ <button onclick="testFireEvents(this)"> >+ If there are duplicate shippingOption ids, then abort payment request. >+ </button> >+ </li> >+</ol> >+<small> >+ If you find a buggy test, please <a href="https://github.com/web-platform-tests/wpt/issues">file a bug</a> >+ and tag one of the <a href="https://github.com/web-platform-tests/wpt/blob/master/payment-request/META.yml">suggested reviewers</a>. >+</small> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-incremental-update-manual.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-incremental-update-manual.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..3d1bfb41b84d6b0ecc2d4bde25eab2dead465e34 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-incremental-update-manual.https.html >@@ -0,0 +1,187 @@ >+<!doctype html> >+<meta charset="utf8"> >+<link rel="help" href="https://w3c.github.io/payment-request/#updatewith-method"> >+<title> >+ Incremental updates via updateWith() >+</title> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script> >+setup({ >+ explicit_done: true, >+ explicit_timeout: true, >+}); >+ >+const methods = [{ >+ supportedMethods: "basic-card", >+}]; >+ >+const options = { >+ requestShipping: true, >+}; >+ >+const initialDetails = { >+ total: { >+ label: "Initial total", >+ amount: { >+ currency: "USD", >+ value: "1.0", >+ }, >+ }, >+ shippingOptions: [ >+ { >+ id: "neutral", >+ label: "NEUTRAL SHIPPING OPTION", >+ selected: true, >+ amount: { >+ currency: "USD", >+ value: "0.00", >+ }, >+ }, >+ ], >+}; >+ >+function testFireEvent(button, updateDetails) { >+ button.disabled = true; >+ const request = new PaymentRequest(methods, initialDetails, options); >+ const handlerPromise = new Promise(resolve => { >+ request.onshippingaddresschange = event => { >+ event.updateWith(updateDetails); >+ resolve(event); >+ }; >+ }); >+ promise_test(async t => { >+ const response = await request.show(); >+ const event = await handlerPromise; >+ await response.complete("success"); >+ }, button.textContent.trim()); >+} >+ >+</script> >+<h2> >+ Incremental updates >+</h2> >+<p> >+ Click on each button in sequence from top to bottom without refreshing the page. >+ Each button will bring up the Payment Request UI window. >+</p> >+<p> >+ Unless stated otherwise, each test will update some part of the displayed payment sheet in >+ a manner indicated below. When prompted, please change or enter a new >+ shipping address, look for the tested change, and complete the payment. >+</p> >+<p> >+ If the payment request locks up or otherwise aborts, the test has failed. >+</p> >+<ol> >+ <li> >+ <button onclick="testFireEvent(this, {});"> >+ Passing an empty dictionary does not cause the sheet to change. >+ No values in the sheet must change. >+ </button> >+ </li> >+</ol> >+ >+<section> >+ <h3>Incremental updates via PaymentDetailsUpdate.total</h3> >+ <ol> >+ <li> >+ <button onclick=" >+ const total = { >+ label: 'PASS', >+ amount: { >+ currency: 'XXX', >+ value: '20', >+ }, >+ }; >+ const updatedDetails = { total }; >+ testFireEvent(this, updatedDetails);"> >+ After changing shipping address, the total becomes XXX20, with the label "PASS". >+ </button> >+ </li> >+ </ol> >+</section> >+ >+<section> >+ <h3>Incremental updates via PaymentDetailsBase.displayItems</h3> >+ <ol> >+ <li> >+ <button onclick=" >+ const item = { >+ label: 'PASS', >+ amount: { currency: 'ABC', value: '55.00' }, >+ }; >+ const updatedDetails = { >+ displayItems: [ item ] >+ }; >+ testFireEvent(this, updatedDetails);"> >+ After changing shipping address, a new display item is shown >+ with a with label PASS, and value of ABC55.00. >+ </button> >+ </li> >+ </ol> >+</section> >+ >+<section> >+ <h3>Incremental updates via PaymentDetailsBase.shippingOptions</h3> >+ <ol> >+ <li> >+ <button onclick=" >+ const shippingOptions = [ >+ { >+ id: 'pass', >+ label: 'PASS', >+ amount: { currency: 'USD', value: '1.00' }, >+ selected: true, >+ }, >+ { >+ id: 'fail', >+ label: 'FAIL IF THIS IS SELECTED', >+ amount: { currency: 'USD', value: '25.00' } >+ }, >+ ]; >+ const updatedDetails = { >+ shippingOptions >+ }; >+ testFireEvent(this, updatedDetails);"> >+ After changing shipping address, two new shipping options appear. >+ The shipping option labelled "PASS" with a value of USD1.0 is selected. >+ </button> >+ </li> >+ </ol> >+</section> >+ >+<section> >+ <h3>Incremental updates via PaymentDetailsBase.modifiers</h3> >+ <ol> >+ <li> >+ <button onclick=" >+ const additionalItem = { >+ label: 'PASS-DISPLAY-ITEM', >+ amount: { currency: 'USD', value: '3.00' }, >+ }; >+ const modifiers = [{ >+ additionalDisplayItems: [ additionalItem ], >+ supportedMethods: 'basic-card', >+ total: { >+ label: 'PASS-TOTAL', >+ amount: { currency: 'USD', value: '123.00' }, >+ }, >+ }]; >+ const updatedDetails = { modifiers }; >+ testFireEvent(this, updatedDetails);"> >+ After changing shipping address, a new display item is shown >+ with a with label PASS-DISPLAY-ITEM, and value of ABC55.00 and the total is >+ labelled PASS-TOTAL with a value of USD123.0 >+ </button> >+ </li> >+ <li> >+ <button onclick="done()">DONE - see results</button> >+ </li> >+ </ol> >+</section> >+ >+<small> >+ If you find a buggy test, please <a href="https://github.com/web-platform-tests/wpt/issues">file a bug</a> >+ and tag one of the <a href="https://github.com/web-platform-tests/wpt/blob/master/payment-request/META.yml">suggested reviewers</a>. >+</small> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-method-abort-update-manual.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-method-abort-update-manual.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..0ff7f23b6479695907aee3e479436b5ff13e165a >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-method-abort-update-manual.https.html >@@ -0,0 +1,269 @@ >+<!doctype html> >+<meta charset="utf8"> >+<link rel="help" href="https://w3c.github.io/payment-request/#dfn-abort-the-update"> >+<title> >+ updateWith() method - "abort the update" >+</title> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script> >+setup({ explicit_done: true, explicit_timeout: true }); >+ >+// PaymentMethod >+const validMethod = Object.freeze({ >+ supportedMethods: "valid-but-wont-ever-match", >+}); >+ >+const validMethodBasicCard = Object.freeze({ >+ supportedMethods: "basic-card", >+}); >+ >+// Methods >+const validMethods = Object.freeze([validMethodBasicCard, validMethod]); >+ >+// Amounts >+const validAmount = Object.freeze({ >+ currency: "USD", >+ value: "1.00", >+}); >+ >+const invalidAmount = Object.freeze({ >+ currency: "¡INVALID!", >+ value: "A1.0", >+}); >+ >+const negativeAmount = Object.freeze({ >+ currency: "USD", >+ value: "-1.00", >+}); >+ >+// Totals >+const validTotal = Object.freeze({ >+ label: "Valid Total", >+ amount: validAmount, >+}); >+ >+const invalidTotal = Object.freeze({ >+ label: "Invalid Total", >+ amount: invalidAmount, >+}); >+ >+const invalidNegativeTotal = Object.freeze({ >+ label: "Invalid negative total", >+ amount: negativeAmount, >+}); >+ >+// PaymentDetailsInit >+const validDetails = Object.freeze({ >+ total: validTotal, >+}); >+ >+const invalidDetailsNegativeTotal = Object.freeze({ >+ total: invalidNegativeTotal, >+}); >+ >+// PaymentOptions >+const validOptions = Object.freeze({ >+ requestShipping: true, >+}); >+ >+// PaymentItem >+const validPaymentItem = Object.freeze({ >+ amount: validAmount, >+ label: "Valid payment item", >+}); >+ >+const invalidPaymentItem = Object.freeze({ >+ amount: invalidAmount, >+ label: "Invalid payment item", >+}); >+ >+// PaymentItem >+const validPaymentItems = Object.freeze([validPaymentItem]); >+const invalidPaymentItems = Object.freeze([invalidPaymentItem]); >+ >+// PaymentShippingOption >+const invalidShippingOption = Object.freeze({ >+ id: "abc", >+ label: "Invalid shipping option", >+ amount: invalidAmount, >+ selected: true, >+}); >+ >+// PaymentShippingOptions >+const validShippingOption = Object.freeze({ >+ id: "abc", >+ label: "valid shipping option", >+ amount: validAmount, >+}); >+ >+const validShippingOptions = Object.freeze([validShippingOption]); >+const invalidShippingOptions = Object.freeze([invalidShippingOption]); >+ >+// PaymentDetailsModifier >+const validModifier = Object.freeze({ >+ additionalDisplayItems: validPaymentItems, >+ supportedMethods: "valid-but-wont-ever-match", >+ total: validTotal, >+}); >+ >+const modifierWithInvalidDisplayItems = Object.freeze({ >+ additionalDisplayItems: invalidPaymentItems, >+ supportedMethods: "basic-card", >+ total: validTotal, >+}); >+ >+const modifierWithValidDisplayItems = Object.freeze({ >+ additionalDisplayItems: validPaymentItems, >+ supportedMethods: "basic-card", >+ total: validTotal, >+}); >+ >+const modifierWithInvalidTotal = Object.freeze({ >+ additionalDisplayItems: validPaymentItems, >+ supportedMethods: "basic-card", >+ total: invalidTotal, >+}); >+ >+const recursiveData = {}; >+recursiveData.foo = recursiveData; >+Object.freeze(recursiveData); >+ >+const modifierWithRecursiveData = Object.freeze({ >+ supportedMethods: validMethodBasicCard, >+ total: validTotal, >+ data: recursiveData, >+}); >+ >+function testBadUpdate(button, badDetails, expectedError, errorCode) { >+ button.disabled = true; >+ promise_test(async t => { >+ const request = new PaymentRequest( >+ validMethods, >+ validDetails, >+ validOptions >+ ); >+ request.onshippingaddresschange = event => { >+ event.updateWith(badDetails); >+ }; >+ // First we check the bad update. >+ const acceptPromise = request.show(); >+ await promise_rejects( >+ t, >+ expectedError, >+ acceptPromise, >+ "badDetails must cause acceptPromise to reject with expectedError" >+ ); >+ // The request [[state]] is now "closed", so let's check for InvalidStateError >+ await promise_rejects( >+ t, >+ "InvalidStateError", >+ request.show(), >+ "show() must reject with InvalidStateError" >+ ); >+ }, button.innerText.trim()); >+} >+</script> >+<h2>updateWith() method - "abort the update"</h2> >+<p> >+ Click on each button in sequence from top to bottom without refreshing the page. >+ Each button will bring up the Payment Request UI window. >+</p> >+<p> >+ When the payment sheet is shown, change the shipping address. >+</p> >+<ol> >+ <li> >+ <button onclick=" >+ const rejectedPromise = Promise.reject(new SyntaxError('test')).catch(err => err); >+ testBadUpdate(this, rejectedPromise, 'AbortError'); >+ "> >+ Rejection of detailsPromise must abort the update with an "AbortError" DOMException. >+ </button> >+ </li> >+ <li> >+ <button onclick=" >+ const invalidDetails = { total: `this will cause a TypeError!` }; >+ testBadUpdate(this, invalidDetails, new TypeError()); >+ "> >+ Total in the update is a string, so converting to IDL must abort the update with a TypeError. >+ </button> >+ </li> >+ <li> >+ <button onclick=" >+ const invalidDetails = { total: recursiveData }; >+ testBadUpdate(this, invalidDetails, new TypeError()); >+ "> >+ Total is recursive, so converting to IDL must abort the update with a TypeError. >+ </button> >+ </li> >+ <li> >+ <button onclick=" >+ testBadUpdate(this, invalidDetailsNegativeTotal, new TypeError()); >+ "> >+ Updating with a negative total results in a TypeError. >+ </button> >+ </li> >+ <li> >+ <button onclick=" >+ const badDetails = Object.assign({}, validDetails, { displayItems: invalidPaymentItems }); >+ testBadUpdate(this, badDetails, new RangeError()); >+ "> >+ Updating with a displayItem with an invalid currency results in TypeError. >+ </button> >+ </li> >+ <li> >+ <button onclick=" >+ const duplicateShippingOptions = [validShippingOption, validShippingOption]; >+ const badDetails = Object.assign({}, validDetails, { shippingOptions: duplicateShippingOptions }); >+ testBadUpdate(this, badDetails, new TypeError()); >+ "> >+ Updating with duplicate shippingOptions (same IDs) results in a TypeError. >+ </button> >+ </li> >+ <li> >+ <button onclick=" >+ const badDetails = Object.assign({}, validDetails, { shippingOptions: invalidShippingOptions }); >+ testBadUpdate(this, badDetails, new RangeError()); >+ "> >+ Updating with a shippingOption with an invalid currency value results in a RangError. >+ </button> >+ </li> >+ <li> >+ <button onclick=" >+ // validModifier is there as to avoid false positives - it should just get ignored >+ const badModifiers = { modifiers: [ modifierWithInvalidTotal, validModifier ] }; >+ const badDetails = Object.assign({}, validDetails, badModifiers); >+ testBadUpdate(this, badDetails, new RangeError()); >+ "> >+ Must throw a RangeError when a modifier's total item has an invalid currency. >+ </button> >+ </li> >+ <li> >+ <button onclick=" >+ // validModifier is there as to avoid false positives - it should just get ignored >+ const badModifiers = { modifiers: [ modifierWithInvalidDisplayItems, validModifier ] }; >+ const badDetails = Object.assign({}, validDetails, badModifiers); >+ testBadUpdate(this, badDetails, new RangeError()); >+ "> >+ Must throw a RangeError when a modifier display item has an invalid currency. >+ </button> >+ </li> >+ <li> >+ <button onclick=" >+ // validModifier is there as to avoid false positives - it should just get ignored >+ const badModifiers = { modifiers: [ modifierWithRecursiveData, validModifier ] }; >+ const badDetails = Object.assign({}, validDetails, badModifiers); >+ testBadUpdate(this, badDetails, new TypeError()); >+ "> >+ Must throw as Modifier has a recursive dictionary. >+ </button> >+ </li> >+ <li> >+ <button onclick="done();">Done!</button> >+ </li> >+</ol> >+<small> >+ If you find a buggy test, please <a href="https://github.com/web-platform-tests/wpt/issues">file a bug</a> >+ and tag one of the <a href="https://github.com/web-platform-tests/wpt/blob/master/payment-request/META.yml">suggested reviewers</a>. >+</small> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-state-checks-manual.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-state-checks-manual.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..4d4ef73949dd1dd271521c5005ca4e93108ab844 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-state-checks-manual.https.html >@@ -0,0 +1,115 @@ >+<!doctype html> >+<meta charset="utf8"> >+<link rel="help" href="https://www.w3.org/TR/payment-request/#updatewith()-method"> >+<title>updateWith() method - state machine checks</title> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script> >+setup({ explicit_done: true, explicit_timeout: true }); >+const validMethod = Object.freeze({ supportedMethods: "basic-card" }); >+const validMethods = Object.freeze([validMethod]); >+const validAmount = Object.freeze({ currency: "USD", value: "5.00" }); >+const validTotal = Object.freeze({ >+ label: "label", >+ amount: validAmount, >+}); >+const validShippingOption = Object.freeze({ >+ id: "a-shipping-option", >+ label: "A shipping option", >+ amount: validAmount, >+ selected: true, >+}); >+const validDetails = Object.freeze({ >+ total: validTotal, >+ shippingOptions: [validShippingOption], >+}); >+const validOptions = Object.freeze({ >+ requestShipping: true, >+}); >+ >+function getPaymentPromises() { >+ const request = new PaymentRequest(validMethods, validDetails, validOptions); >+ const eventPromise = new Promise(resolve => { >+ request.addEventListener("shippingaddresschange", resolve); >+ }); >+ const responsePromise = request.show(); >+ return { eventPromise, responsePromise }; >+} >+ >+function testRequestIsClosed(button) { >+ button.disabled = "true"; >+ promise_test(async t => { >+ const { eventPromise, responsePromise } = getPaymentPromises(); >+ const event = await eventPromise; >+ // We are going to abort the responsePromise, so we can ignore error. >+ responsePromise.catch(err => err); >+ // Set request.[[state]] to closed >+ await event.target.abort(); >+ assert_throws( >+ "InvalidStateError", >+ () => { >+ event.updateWith(validDetails); >+ }, >+ "request.[[state]] is not interactive, must throw an InvalidStateError." >+ ); >+ responsePromise.catch(err => err); >+ }, button.textContent.trim()); >+} >+ >+function testRequestIsUpdating(button) { >+ button.disabled = "true"; >+ promise_test(async t => { >+ const { eventPromise, responsePromise } = getPaymentPromises(); >+ const event = await eventPromise; >+ // We are going to put a promise into a pending state >+ // check that a second call to updateWith() throws, >+ // then resolve the pending promise below. >+ let resolver; >+ const pendingPromise = new Promise(resolve => { >+ resolver = resolve; >+ }); >+ // Set request.[[updating]] to true >+ event.updateWith(pendingPromise); >+ assert_throws( >+ "InvalidStateError", >+ () => { >+ event.updateWith(validDetails); >+ }, >+ "request.[[updating]] to true, must throw an InvalidStateError." >+ ); >+ // We got the error we wanted, so let's resolve with valid details. >+ resolver(validDetails); >+ await pendingPromise; >+ await event.target.abort(); >+ responsePromise.catch(err => err); >+ }, button.textContent.trim()); >+} >+ >+</script> >+<h2>updateWith() method - state machine checks</h2> >+<p> >+ Click on each button in sequence from top to bottom without refreshing the page. >+ Each button will bring up the Payment Request UI window. >+</p> >+<p> >+ When the payment sheet is shown, select a different shipping address once. Then pay. >+</p> >+<ol> >+ <li id="test-0"> >+ <button onclick="testRequestIsClosed(this);"> >+ When updateWith() is called, if request.[[state]] is not "interactive", then throw an " InvalidStateError" DOMException. >+ </button> >+ </li> >+ <li id="test-1"> >+ <button onclick="testRequestIsUpdating(this);"> >+ When updateWith() is called, If request.[[updating]] is true, then throw an "InvalidStateError" DOMException. >+ </button> >+ </li> >+ <li> >+ <button onclick="done();">Done!</button> >+ </li> >+</ol> >+<small> >+ If you find a buggy test, please <a href="https://github.com/web-platform-tests/wpt/issues">file a bug</a> >+ and tag one of the <a href="https://github.com/web-platform-tests/wpt/blob/master/payment-request/META.yml">suggested reviewers</a>. >+</small> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updatewith-method.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updatewith-method.https-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..7c6a657befec57cdda4e1d973aee4996198c6b7b >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updatewith-method.https-expected.txt >@@ -0,0 +1,5 @@ >+ >+PASS Let target be the request which is dispatching the event. >+PASS Calling .updateWith() with an undispatched untrusted event throws "InvalidStateError" >+PASS Calling .updateWith() with a dispatched, untrusted event, throws "InvalidStateError" >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updatewith-method.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updatewith-method.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..adacdf3f06d1c1adb50a65585b64441c5e00de63 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updatewith-method.https.html >@@ -0,0 +1,66 @@ >+<!DOCTYPE html> >+<!-- Copyright © 2017 Chromium authors and World Wide Web Consortium, (Massachusetts Institute of Technology, ERCIM, Keio University, Beihang). --> >+<meta charset="utf-8"> >+<title>Test for PaymentRequestUpdateEvent's updateWith() method</title> >+<link rel="help" href="https://w3c.github.io/browser-payment-api/#updatewith-method"> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script> >+const basicCard = Object.freeze({ supportedMethods: "basic-card" }); >+const defaultMethods = Object.freeze([basicCard]); >+const defaultDetails = Object.freeze({ >+ total: { >+ label: "Total", >+ amount: { >+ currency: "USD", >+ value: "1.00", >+ }, >+ }, >+}); >+ >+test(() => { >+ // Smoke test - checks target is set as expected >+ const request = new PaymentRequest(defaultMethods, defaultDetails); >+ const ev = new PaymentRequestUpdateEvent("test"); >+ request.dispatchEvent(ev); >+ assert_equals(ev.target, request, "The request and the target at the same"); >+}, "Let target be the request which is dispatching the event."); >+ >+// Github issue: https://github.com/w3c/browser-payment-api/issues/546 >+test(() => { >+ const untrustedEvents = [ >+ new PaymentRequestUpdateEvent("just a test"), >+ new PaymentRequestUpdateEvent("shippingaddresschange"), >+ new PaymentRequestUpdateEvent("shippingoptionchange"), >+ ].forEach(ev => { >+ assert_throws( >+ "InvalidStateError", >+ () => { >+ ev.updateWith(Promise.resolve()); >+ }, >+ `untrusted event of type "${ev.type}" must throw "InvalidStateError"` >+ ); >+ }); >+}, `Calling .updateWith() with an undispatched untrusted event throws "InvalidStateError"`); >+ >+// Github issue: https://github.com/w3c/browser-payment-api/issues/546 >+test(() => { >+ const request = new PaymentRequest(defaultMethods, defaultDetails); >+ const untrustedEvents = [ >+ new PaymentRequestUpdateEvent("just a test"), >+ new PaymentRequestUpdateEvent("shippingaddresschange"), >+ new PaymentRequestUpdateEvent("shippingoptionchange"), >+ ].map(ev => { >+ request.dispatchEvent(ev); // set .target and dispatch flag >+ // unstrusted event. >+ assert_throws( >+ "InvalidStateError", >+ () => { >+ ev.updateWith(Promise.resolve()) >+ }, >+ `untrusted event of type "${ev.type}" must throw "InvalidStateError"` >+ ); >+ }); >+}, `Calling .updateWith() with a dispatched, untrusted event, throws "InvalidStateError"`); >+ >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/w3c-import.log >new file mode 100644 >index 0000000000000000000000000000000000000000..d468993971f5a1f9526e7461ba183c344081b961 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/w3c-import.log >@@ -0,0 +1,24 @@ >+The tests in this directory were imported from the W3C repository. >+Do NOT modify these tests directly in WebKit. >+Instead, create a pull request on the WPT github: >+ https://github.com/web-platform-tests/wpt >+ >+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport >+ >+Do NOT modify or remove this file. >+ >+------------------------------------------------------------------------ >+Properties requiring vendor prefixes: >+None >+Property values requiring vendor prefixes: >+None >+------------------------------------------------------------------------ >+List of files: >+/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.http.html >+/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.https.html >+/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-call-immediate-manual.https.html >+/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-duplicate-shipping-options-manual.https.html >+/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-incremental-update-manual.https.html >+/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-method-abort-update-manual.https.html >+/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-state-checks-manual.https.html >+/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updatewith-method.https.html >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/common.sub.js b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/common.sub.js >index 85a08461fcb0197ed2259d77035e696c1c69d6d8..a94bac064c9432980d437a98b72d4843f1b40bbe 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/common.sub.js >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/common.sub.js >@@ -5,41 +5,57 @@ > > const tests = {}; > >-window.onmessage = (e) => { >+window.onmessage = e => { > const result = e.data; > const tagName = result.urlQuery; > const t = tests[tagName]; > t.step(() => { > if (expectSuccess[tagName]) { >- assert_equals(result.message, 'Success'); >+ assert_equals(result.message, "Success"); >+ if (result.message === "Exception") { >+ const [, code, name, stack] = result.details; >+ assert_unreached(`Unexpected exception "${name}" (${code}) ${stack}`); >+ } > } else { >- assert_equals(result.message, 'Exception'); >- assert_array_equals(result.details, [true /*ex instanceof DOMException*/, >- DOMException.SECURITY_ERR /*ex.code*/, >- 'SecurityError' /*ex.name*/]); >+ assert_equals(result.message, "Exception"); >+ const detailsArray = result.details.slice(0,3); >+ assert_array_equals(detailsArray, [ >+ true /*ex instanceof DOMException*/, >+ DOMException.SECURITY_ERR /*ex.code*/, >+ "SecurityError" /*ex.name*/, >+ ]); > } > t.done(); > }); > }; > >-['iframe', 'frame', 'object', 'embed'].forEach((tagName, i) => { >- tests[tagName] = async_test((t) => { >+["iframe", "frame", "object", "embed"].forEach((tagName, i) => { >+ tests[tagName] = async_test(t => { > const elm = document.createElement(tagName); > if (setAllowPaymentRequest) { >- elm.setAttribute('allowpaymentrequest', ''); >+ elm.setAttribute("allowpaymentrequest", ""); > } >- const path = location.pathname.substring(0, location.pathname.lastIndexOf('/') + 1); >- const url = (testCrossOrigin ? "https://{{domains[www1]}}:{{ports[https][0]}}" : "") + >- path + "echo-PaymentRequest.html?" + tagName; >- if (tagName === 'object') { >+ const path = location.pathname.substring( >+ 0, >+ location.pathname.lastIndexOf("/") + 1 >+ ); >+ const url = >+ (testCrossOrigin ? "https://{{domains[www1]}}:{{ports[https][0]}}" : "") + >+ path + >+ "echo-PaymentRequest.html?" + >+ tagName; >+ if (tagName === "object") { > elm.data = url; > } else { > elm.src = url; > } > elm.onload = t.step_func(() => { >- window[i].postMessage('What is the result of new PaymentRequest(...)?', '*'); >+ window[i].postMessage( >+ "What is the result of new PaymentRequest(...)?", >+ "*" >+ ); > }); >- elm.onerror = t.unreached_func('elm.onerror'); >+ elm.onerror = t.unreached_func("elm.onerror"); > document.body.appendChild(elm); > }, tagName); > }); >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/echo-PaymentRequest.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/echo-PaymentRequest.html >index f18b16ee31bf7e3eb868d073ab5e0fb0061bbd88..5211c7e5ce78c0621036578fef79aeb2c98f2a27 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/echo-PaymentRequest.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/echo-PaymentRequest.html >@@ -11,7 +11,9 @@ window.onmessage = (e) => { > e.source.postMessage(result, '*'); > } catch(ex) { > result.message = 'Exception'; >- result.details = [ex instanceof DOMException, ex.code, ex.name]; >+ const isDomException = ex instanceof DOMException; >+ const stack = "stack" in ex ? ex.stack : ""; >+ result.details = [ isDomException, ex.code, ex.name, stack ]; > e.source.postMessage(result, '*'); > } > } else { >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/onmerchantvalidation-attribute.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/onmerchantvalidation-attribute.https-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..cb666c8430b0c43efe4c0e5116aa21127f7e2320 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/onmerchantvalidation-attribute.https-expected.txt >@@ -0,0 +1,6 @@ >+ >+PASS Must have a onmerchantvalidation IDL attribute >+PASS onmerchantvalidation attribute is a generic handler for "merchantvalidation" >+PASS onmerchantvalidation attribute is a handler for MerchantValidationEvent >+PASS onmerchantvalidation attribute and listeners both work >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/onmerchantvalidation-attribute.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/onmerchantvalidation-attribute.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..c0ed23167ed9378ec32e769bd4f3e3afaef5040c >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/onmerchantvalidation-attribute.https.html >@@ -0,0 +1,69 @@ >+<!DOCTYPE html> >+<meta charset="utf-8"> >+<title>Test for PaymentRequest's onmerchantvalidation attribute</title> >+<link rel="help" href="https://w3c.github.io/browser-payment-api/#dom-paymentrequest-onmerchantvalidation"> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script> >+"use strict"; >+const testMethod = Object.freeze({ supportedMethods: "not-a-real-method" }); >+const applePay = Object.freeze({ supportedMethods: "https://apple.com/apple-pay" }); >+const defaultMethods = Object.freeze([testMethod, applePay]); >+const defaultDetails = Object.freeze({ >+ total: { >+ label: "Total", >+ amount: { >+ currency: "USD", >+ value: "1.00", >+ }, >+ }, >+}); >+const validationURL = "https://example.com"; >+ >+test(() => { >+ const request = new PaymentRequest(defaultMethods, defaultDetails); >+ assert_idl_attribute(request, "onmerchantvalidation"); >+}, "Must have a onmerchantvalidation IDL attribute"); >+ >+test(() => { >+ const request = new PaymentRequest(defaultMethods, defaultDetails); >+ const ev = new Event("merchantvalidation"); >+ let didHandle = false; >+ request.onmerchantvalidation = evt => { >+ assert_equals(ev, evt, "must be same event"); >+ didHandle = true; >+ }; >+ request.dispatchEvent(ev); >+ assert_true(didHandle, "event did not fire"); >+}, `onmerchantvalidation attribute is a generic handler for "merchantvalidation"`); >+ >+test(() => { >+ const request = new PaymentRequest(defaultMethods, defaultDetails); >+ const ev = new MerchantValidationEvent("merchantvalidation", { validationURL }); >+ let didHandle = false; >+ request.onmerchantvalidation = evt => { >+ assert_equals(ev, evt, "must be same event"); >+ didHandle = true; >+ }; >+ request.dispatchEvent(ev); >+ assert_true(didHandle, "event did not fire"); >+}, `onmerchantvalidation attribute is a handler for MerchantValidationEvent`); >+ >+test(() => { >+ const request = new PaymentRequest(defaultMethods, defaultDetails); >+ const ev = new MerchantValidationEvent("merchantvalidation", { validationURL }); >+ let didHandle = false; >+ let didListen = false; >+ request.onmerchantvalidation = evt => { >+ assert_equals(ev, evt, "must be same event"); >+ didHandle = true; >+ }; >+ request.addEventListener("merchantvalidation", evt => { >+ assert_equals(ev, evt, "must be same event"); >+ didListen = true; >+ }); >+ request.dispatchEvent(ev); >+ assert_true(didHandle, "onmerchantvalidation must receive the event"); >+ assert_true(didListen, "addEventListener must receive the event"); >+}, `onmerchantvalidation attribute and listeners both work`); >+</script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-abort-method.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-abort-method.https-expected.txt >index 3a5f0f90790bc507e1a21d4e17c1862b368b50a3..6b8594b930bf10572313c507f0e1695adf4cbce8 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-abort-method.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-abort-method.https-expected.txt >@@ -1,9 +1,9 @@ >-CONSOLE MESSAGE: Unhandled Promise Rejection: InvalidStateError: The object is in an invalid state. >-CONSOLE MESSAGE: Unhandled Promise Rejection: InvalidStateError: The object is in an invalid state. >-CONSOLE MESSAGE: Unhandled Promise Rejection: InvalidStateError: The object is in an invalid state. >+This test requires user interaction. >+Please click here to allow show payment request.This test requires user interaction. >+Please click here to allow show payment request. > > PASS Throws if the promise [[state]] is not "interactive" >-FAIL Test for PaymentRequest.abort() method promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: test_driver" >-FAIL Test for PaymentRequest.abort() method 1 promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: test_driver" >+FAIL Test for PaymentRequest.abort() method promise_test: Unhandled rejection with value: object "Error: unimplemented" >+FAIL Test for PaymentRequest.abort() method 1 promise_test: Unhandled rejection with value: object "Error: unimplemented" > PASS Calling abort() multiple times is always a new object. > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-canmakepayment-method.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-canmakepayment-method.https-expected.txt >index 724030ea29a4702b48a4dae226fe41db579ac582..173a223907125f4cd835b7fea8445828231e95ae 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-canmakepayment-method.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-canmakepayment-method.https-expected.txt >@@ -1,10 +1,12 @@ >-If you find a buggy test, please file a bug and tag one of the suggested reviewers. >+This test requires user interaction. >+Please click here to allow show payment request.This test requires user interaction. >+Please click here to allow show payment request. If you find a buggy test, please file a bug and tag one of the suggested reviewers. > > FAIL If request.[[state]] is "created", then return a promise that resolves to true for known method. assert_equals: if it throws, then it must be a NotAllowedError. expected "NotAllowedError" but got "Error" > FAIL If payment method identifier and serialized parts are supported, resolve promise with true. assert_true: basic-card should be supported expected true got false > PASS If payment method identifier is unknown, resolve promise with false. > PASS Optionally, at the user agent's discretion, return a promise rejected with a "NotAllowedError" DOMException. >-FAIL If request.[[state]] is "interactive", then return a promise rejected with an "InvalidStateError" DOMException. Can't find variable: test_driver >-FAIL If request.[[state]] is "closed", then return a promise rejected with an "InvalidStateError" DOMException. Can't find variable: test_driver >+FAIL If request.[[state]] is "interactive", then return a promise rejected with an "InvalidStateError" DOMException. promise_test: Unhandled rejection with value: object "Error: unimplemented" >+FAIL If request.[[state]] is "closed", then return a promise rejected with an "InvalidStateError" DOMException. promise_test: Unhandled rejection with value: object "Error: unimplemented" > PASS Calling canMakePayment() multiple times is always a new object. > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/payment-request/w3c-import.log >index 151f01c4bf25e09ac96fc903162e84dbe862800a..17eab6ba3c30c171db95ea64bb70639b45f2c557 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/w3c-import.log >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/w3c-import.log >@@ -20,6 +20,7 @@ List of files: > /LayoutTests/imported/w3c/web-platform-tests/payment-request/change-shipping-option-select-last-manual.https.html > /LayoutTests/imported/w3c/web-platform-tests/payment-request/historical.https.html > /LayoutTests/imported/w3c/web-platform-tests/payment-request/idlharness.https.window.js >+/LayoutTests/imported/w3c/web-platform-tests/payment-request/onmerchantvalidation-attribute.https.html > /LayoutTests/imported/w3c/web-platform-tests/payment-request/onpaymentmenthodchange-attribute.https.html > /LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-abort-method.https.html > /LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-canmakepayment-method.https.html >diff --git a/LayoutTests/platform/ios-wk2/TestExpectations b/LayoutTests/platform/ios-wk2/TestExpectations >index 49b5bc67cc110f6f3b9f6694892499437aec2d9a..54f7a6b5ac8495f9606401fd646ccef1b1843c8f 100644 >--- a/LayoutTests/platform/ios-wk2/TestExpectations >+++ b/LayoutTests/platform/ios-wk2/TestExpectations >@@ -1263,31 +1263,37 @@ webkit.org/b/184783 compositing/ios/overflow-scroll-touch-tiles.html [ Pass Fail > webkit.org/b/179853 [ Debug ] imported/blink/fast/text/international-iteration-simple-text.html [ Pass Failure ] > > # skip manual payment-request tests >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/PaymentValidationErrors/retry-shows-error-member-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/PaymentValidationErrors/retry-shows-payer-member-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/PaymentValidationErrors/retry-shows-shippingAddress-member-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/algorithms-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/change-shipping-option-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/change-shipping-option-select-last-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/payment-response/complete-method-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/payment-response/methodName-attribute-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/payment-response/onpayerdetailchange-attribute.manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/payment-response/payerEmail-attribute-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/payment-response/payerName-attribute-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/payment-response/payerPhone-attribute-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/payment-response/rejects_if_not_active-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/payment-response/requestId-attribute-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/payment-response/retry-method-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/payment-response/shippingAddress-attribute-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/payment-response/shippingOption-attribute-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/PaymentAddress/attributes-and-toJSON-method-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/shipping-address-changed-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/show-method-optional-promise-rejects-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/show-method-optional-promise-resolves-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/show-method-postmessage-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/updateWith-method-pmi-handling-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/user-abort-algorithm-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/user-accepts-payment-request-algo-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/complete-method-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-call-immediate-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-duplicate-shipping-options-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-incremental-update-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-method-abort-update-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-state-checks-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/PaymentValidationErrors/retry-shows-error-member-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/PaymentValidationErrors/retry-shows-payer-member-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/PaymentValidationErrors/retry-shows-shippingAddress-member-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/algorithms-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/change-shipping-option-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/change-shipping-option-select-last-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/payment-response/complete-method-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/payment-response/methodName-attribute-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/payment-response/onpayerdetailchange-attribute.manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/payment-response/payerEmail-attribute-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/payment-response/payerName-attribute-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/payment-response/payerPhone-attribute-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/payment-response/rejects_if_not_active-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/payment-response/requestId-attribute-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/payment-response/retry-method-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/payment-response/shippingAddress-attribute-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/payment-response/shippingOption-attribute-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/PaymentAddress/attributes-and-toJSON-method-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/shipping-address-changed-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/show-method-optional-promise-rejects-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/show-method-optional-promise-resolves-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/show-method-postmessage-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/updateWith-method-pmi-handling-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/user-abort-algorithm-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/user-accepts-payment-request-algo-manual.https.html [ Skip ] > > webkit.org/b/189087 svg/animations/animate-end-attribute-numeric-precision.html [ Pass Failure ] > >diff --git a/LayoutTests/platform/mac-wk2/TestExpectations b/LayoutTests/platform/mac-wk2/TestExpectations >index e1fefc2b86a1213d119a121c0da3b4625b3a8e0e..dd9fa6bd96c950cc839284f95ba169683a0dc75a 100644 >--- a/LayoutTests/platform/mac-wk2/TestExpectations >+++ b/LayoutTests/platform/mac-wk2/TestExpectations >@@ -836,28 +836,34 @@ webkit.org/b/187658 http/tests/security/bypassing-cors-checks-for-extension-urls > [ Mojave+ ] fast/canvas/webgl/context-update-on-display-configuration.html [ Pass ] > > # skip manual payment-request tests >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/PaymentValidationErrors/retry-shows-error-member-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/PaymentValidationErrors/retry-shows-payer-member-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/PaymentValidationErrors/retry-shows-shippingAddress-member-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/algorithms-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/change-shipping-option-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/change-shipping-option-select-last-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/payment-response/complete-method-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/payment-response/methodName-attribute-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/payment-response/onpayerdetailchange-attribute.manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/payment-response/payerEmail-attribute-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/payment-response/payerName-attribute-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/payment-response/payerPhone-attribute-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/payment-response/rejects_if_not_active-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/payment-response/requestId-attribute-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/payment-response/retry-method-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/payment-response/shippingAddress-attribute-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/payment-response/shippingOption-attribute-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/PaymentAddress/attributes-and-toJSON-method-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/shipping-address-changed-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/show-method-optional-promise-rejects-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/show-method-optional-promise-resolves-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/show-method-postmessage-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/updateWith-method-pmi-handling-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/user-abort-algorithm-manual.https.html [ Skip ] >-webkit.org/b/188985 imported/w3c/web-platform-tests/payment-request/user-accepts-payment-request-algo-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/complete-method-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-call-immediate-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-duplicate-shipping-options-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-incremental-update-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-method-abort-update-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updateWith-state-checks-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/PaymentValidationErrors/retry-shows-error-member-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/PaymentValidationErrors/retry-shows-payer-member-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/PaymentValidationErrors/retry-shows-shippingAddress-member-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/algorithms-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/change-shipping-option-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/change-shipping-option-select-last-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/payment-response/complete-method-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/payment-response/methodName-attribute-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/payment-response/onpayerdetailchange-attribute.manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/payment-response/payerEmail-attribute-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/payment-response/payerName-attribute-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/payment-response/payerPhone-attribute-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/payment-response/rejects_if_not_active-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/payment-response/requestId-attribute-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/payment-response/retry-method-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/payment-response/shippingAddress-attribute-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/payment-response/shippingOption-attribute-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/PaymentAddress/attributes-and-toJSON-method-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/shipping-address-changed-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/show-method-optional-promise-rejects-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/show-method-optional-promise-resolves-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/show-method-postmessage-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/updateWith-method-pmi-handling-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/user-abort-algorithm-manual.https.html [ Skip ] >+imported/w3c/web-platform-tests/payment-request/user-accepts-payment-request-algo-manual.https.html [ Skip ]
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189235
:
348754
|
348755
|
348757
|
348759
|
348760
|
348763
|
348773