diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations index 52b22b3035619..924ddbfda2507 100644 --- a/LayoutTests/TestExpectations +++ b/LayoutTests/TestExpectations @@ -6239,11 +6239,9 @@ imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-out-of-bounds.html [ S imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-out-of-bounds-translate.html [ Skip ] imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-visibility.html [ Skip ] imported/w3c/web-platform-tests/paint-timing/fcp-only/svg-in-iframe.html [ Skip ] -imported/w3c/web-platform-tests/payment-request/allowpayment/allowpaymentrequest-attribute-cross-origin-bc-containers.https.html [ Skip ] -imported/w3c/web-platform-tests/payment-request/allowpayment/no-attribute-cross-origin-bc-containers.https.html [ Skip ] -imported/w3c/web-platform-tests/payment-request/allowpayment/removing-allowpaymentrequest.https.sub.html [ Skip ] -imported/w3c/web-platform-tests/payment-request/allowpayment/setting-allowpaymentrequest.https.sub.html [ Skip ] +imported/w3c/web-platform-tests/payment-request/delegate-request.https.sub.html [ Skip ] imported/w3c/web-platform-tests/payment-request/payment-is-showing.https.html [ Skip ] +imported/w3c/web-platform-tests/payment-request/payment-request-disallowed-when-hidden.https.html [ Skip ] imported/w3c/web-platform-tests/permissions/permissions-query-feature-policy-attribute.https.sub.html [ Skip ] imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_pointermove_in_pointerlock.html [ Skip ] imported/w3c/web-platform-tests/pointerlock/mouse_buttons_back_forward.html [ Skip ] diff --git a/LayoutTests/imported/w3c/resources/resource-files.json b/LayoutTests/imported/w3c/resources/resource-files.json index 7d21b7572fb17..cf93fb0c85f8a 100644 --- a/LayoutTests/imported/w3c/resources/resource-files.json +++ b/LayoutTests/imported/w3c/resources/resource-files.json @@ -7903,10 +7903,6 @@ "web-platform-tests/mediacapture-streams/support/iframe-MediaStreamTrack-transfer-video.html", "web-platform-tests/mediacapture-streams/support/iframe-MediaStreamTrack-transfer.html", "web-platform-tests/mediasession/helper/artwork-generator.html", - "web-platform-tests/payment-request/allowpayment/echo-PaymentRequest.html", - "web-platform-tests/payment-request/allowpaymentrequest/echo-PaymentRequest.html", - "web-platform-tests/payment-request/blank.html", - "web-platform-tests/payment-request/payment-request-response-id.html", "web-platform-tests/payment-request/show-method-postmessage-iframe.html", "web-platform-tests/permissions/feature-policy-permissions-query.html", "web-platform-tests/quirks/body-fills-html-quirk-ref.html", diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/META.yml b/LayoutTests/imported/w3c/web-platform-tests/payment-request/META.yml index 2440720138d34..1dbe3e5d7edbe 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/META.yml +++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/META.yml @@ -5,4 +5,3 @@ suggested_reviewers: - zouhir - romandev - aestes - - danyao diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentAddress/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentAddress/w3c-import.log deleted file mode 100644 index 4d9043c2812a0..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentAddress/w3c-import.log +++ /dev/null @@ -1,17 +0,0 @@ -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/PaymentAddress/attributes-and-toJSON-method-manual.https.html 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 index e8df7b35a9428..3de0469e9c4b9 100644 --- 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 @@ -6,18 +6,8 @@ - - - - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/active-document-same-origin.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/active-document-same-origin.https-expected.txt deleted file mode 100644 index c286a482f30da..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/active-document-same-origin.https-expected.txt +++ /dev/null @@ -1,4 +0,0 @@ - - -PASS PaymentRequest in non-active document (same-origin) - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/active-document-same-origin.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/active-document-same-origin.https.html deleted file mode 100644 index 11673f65cb705..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/active-document-same-origin.https.html +++ /dev/null @@ -1,23 +0,0 @@ - -PaymentRequest <iframe allow="payment"> in non-active document (same-origin) - - - - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/allowpaymentrequest-attribute-cross-origin-bc-containers.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/allowpaymentrequest-attribute-cross-origin-bc-containers.https-expected.txt deleted file mode 100644 index c9fe6365c2c84..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/allowpaymentrequest-attribute-cross-origin-bc-containers.https-expected.txt +++ /dev/null @@ -1,12 +0,0 @@ -Blocked access to external URL https://www1.localhost:9443/payment-request/allowpayment/echo-PaymentRequest.html?iframe -Blocked access to external URL https://www1.localhost:9443/payment-request/allowpayment/echo-PaymentRequest.html?frame -Blocked access to external URL https://www1.localhost:9443/payment-request/allowpayment/echo-PaymentRequest.html?object -Blocked access to external URL https://www1.localhost:9443/payment-request/allowpayment/echo-PaymentRequest.html?embed - -Harness Error (TIMEOUT), message = null - -TIMEOUT iframe Test timed out -TIMEOUT frame Test timed out -TIMEOUT object Test timed out -TIMEOUT embed Test timed out - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/allowpaymentrequest-attribute-cross-origin-bc-containers.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/allowpaymentrequest-attribute-cross-origin-bc-containers.https.html deleted file mode 100644 index 27d9ea172b417..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/allowpaymentrequest-attribute-cross-origin-bc-containers.https.html +++ /dev/null @@ -1,11 +0,0 @@ - -PaymentRequest allow="payment" attribute cross-origin browsing context containers - - - - - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/common.sub.js b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/common.sub.js deleted file mode 100644 index 60894cba0576b..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/common.sub.js +++ /dev/null @@ -1,61 +0,0 @@ -// Test should set these: -// const expectSuccess = {'iframe': bool, 'frame': bool, 'object': bool, 'embed': bool}; -// const setAllowPayment = bool; -// const testCrossOrigin = bool; - -const tests = {}; - -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"); - if (result.message === "Exception") { - const [, code, name, stack] = result.details; - assert_unreached(`Unexpected exception "${name}" (${code}) ${stack}`); - } - } else { - 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 => { - const elm = document.createElement(tagName); - if (setAllowPayment) { - elm.setAttribute("allow", "payment"); - } - 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(...)?", - "*" - ); - }); - elm.onerror = t.unreached_func("elm.onerror"); - document.body.appendChild(elm); - }, tagName); -}); diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/echo-PaymentRequest.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/echo-PaymentRequest.html deleted file mode 100644 index 5211c7e5ce78c..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/echo-PaymentRequest.html +++ /dev/null @@ -1,25 +0,0 @@ - - -This page echos the result of new PaymentRequest(...). diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/no-attribute-cross-origin-bc-containers.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/no-attribute-cross-origin-bc-containers.https-expected.txt deleted file mode 100644 index c9fe6365c2c84..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/no-attribute-cross-origin-bc-containers.https-expected.txt +++ /dev/null @@ -1,12 +0,0 @@ -Blocked access to external URL https://www1.localhost:9443/payment-request/allowpayment/echo-PaymentRequest.html?iframe -Blocked access to external URL https://www1.localhost:9443/payment-request/allowpayment/echo-PaymentRequest.html?frame -Blocked access to external URL https://www1.localhost:9443/payment-request/allowpayment/echo-PaymentRequest.html?object -Blocked access to external URL https://www1.localhost:9443/payment-request/allowpayment/echo-PaymentRequest.html?embed - -Harness Error (TIMEOUT), message = null - -TIMEOUT iframe Test timed out -TIMEOUT frame Test timed out -TIMEOUT object Test timed out -TIMEOUT embed Test timed out - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/no-attribute-cross-origin-bc-containers.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/no-attribute-cross-origin-bc-containers.https.html deleted file mode 100644 index 86edd6c9cc8eb..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/no-attribute-cross-origin-bc-containers.https.html +++ /dev/null @@ -1,11 +0,0 @@ - -PaymentRequest no attribute cross-origin browsing context containers - - - - - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/no-attribute-same-origin-bc-containers.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/no-attribute-same-origin-bc-containers.https-expected.txt deleted file mode 100644 index 953fc1f65dc0d..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/no-attribute-same-origin-bc-containers.https-expected.txt +++ /dev/null @@ -1,6 +0,0 @@ - -PASS iframe -PASS frame -PASS object -PASS embed - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/no-attribute-same-origin-bc-containers.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/no-attribute-same-origin-bc-containers.https.html deleted file mode 100644 index 1c46525001d20..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/no-attribute-same-origin-bc-containers.https.html +++ /dev/null @@ -1,11 +0,0 @@ - -PaymentRequest no attribute same origin browsing context containers - - - - - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/removing-allowpaymentrequest.https.sub-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/removing-allowpaymentrequest.https.sub-expected.txt deleted file mode 100644 index 301a44b1da503..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/removing-allowpaymentrequest.https.sub-expected.txt +++ /dev/null @@ -1,6 +0,0 @@ -Blocked access to external URL https://www1.localhost:9443/payment-request/allowpayment/echo-PaymentRequest.html - -Harness Error (TIMEOUT), message = null - -TIMEOUT PaymentRequest removing allow="payment" after load and then navigating Test timed out - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/removing-allowpaymentrequest.https.sub.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/removing-allowpaymentrequest.https.sub.html deleted file mode 100644 index 1209f9d92f88a..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/removing-allowpaymentrequest.https.sub.html +++ /dev/null @@ -1,67 +0,0 @@ - -PaymentRequest removing allow="payment" after load and then navigating - - - - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/setting-allowpaymentrequest.https.sub-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/setting-allowpaymentrequest.https.sub-expected.txt deleted file mode 100644 index 28d849a7674da..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/setting-allowpaymentrequest.https.sub-expected.txt +++ /dev/null @@ -1,6 +0,0 @@ -Blocked access to external URL https://www1.localhost:9443/payment-request/allowpayment/echo-PaymentRequest.html - -Harness Error (TIMEOUT), message = null - -TIMEOUT PaymentRequest setting allow="payment" after load and then navigating Test timed out - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/setting-allowpaymentrequest.https.sub.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/setting-allowpaymentrequest.https.sub.html deleted file mode 100644 index 22881cd8933f2..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/setting-allowpaymentrequest.https.sub.html +++ /dev/null @@ -1,43 +0,0 @@ - -PaymentRequest setting allow="payment" after load and then navigating - - - - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/w3c-import.log deleted file mode 100644 index 12f3af98b75bb..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/w3c-import.log +++ /dev/null @@ -1,25 +0,0 @@ -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/allowpayment/active-document-cross-origin.https.sub.html -/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/active-document-same-origin.https.html -/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/allowpaymentrequest-attribute-cross-origin-bc-containers.https.html -/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/common.sub.js -/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/echo-PaymentRequest.html -/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/no-attribute-cross-origin-bc-containers.https.html -/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/no-attribute-same-origin-bc-containers.https.html -/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/removing-allowpaymentrequest.https.sub.html -/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpayment/setting-allowpaymentrequest.https.sub.html diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/active-document-cross-origin.https.sub-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/active-document-cross-origin.https.sub-expected.txt deleted file mode 100644 index 7aaaf1f1aa406..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/active-document-cross-origin.https.sub-expected.txt +++ /dev/null @@ -1,7 +0,0 @@ -Blocked access to external URL https://www1.localhost:9443/common/blank.html - - -FAIL PaymentRequest in non-active document (cross-origin) assert_throws_dom: function "() => { - new grabbedPaymentRequest(...paymentArgs); - }" threw an exception from the wrong global - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/active-document-cross-origin.https.sub.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/active-document-cross-origin.https.sub.html deleted file mode 100644 index 29d7c6010eceb..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/active-document-cross-origin.https.sub.html +++ /dev/null @@ -1,26 +0,0 @@ - -PaymentRequest <iframe allowpaymentrequest> in non-active document (cross-origin) - - - - - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/active-document-same-origin.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/active-document-same-origin.https-expected.txt deleted file mode 100644 index 65d7f1dff14db..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/active-document-same-origin.https-expected.txt +++ /dev/null @@ -1,6 +0,0 @@ - - -FAIL PaymentRequest in non-active document (same-origin) assert_throws_dom: function "() => { - new grabbedPaymentRequest(...paymentArgs); - }" threw an exception from the wrong global - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/active-document-same-origin.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/active-document-same-origin.https.html deleted file mode 100644 index 9d5d30cdcab61..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/active-document-same-origin.https.html +++ /dev/null @@ -1,22 +0,0 @@ - -PaymentRequest <iframe allowpaymentrequest> in non-active document (same-origin) - - - - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/allowpaymentrequest-attribute-cross-origin-bc-containers.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/allowpaymentrequest-attribute-cross-origin-bc-containers.https-expected.txt deleted file mode 100644 index d097c4fb3749c..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/allowpaymentrequest-attribute-cross-origin-bc-containers.https-expected.txt +++ /dev/null @@ -1,9 +0,0 @@ -Blocked access to external URL https://www1.localhost:9443/payment-request/allowpaymentrequest/echo-PaymentRequest.html?iframe -Blocked access to external URL https://www1.localhost:9443/payment-request/allowpaymentrequest/echo-PaymentRequest.html?frame -Blocked access to external URL https://www1.localhost:9443/payment-request/allowpaymentrequest/echo-PaymentRequest.html?object -Blocked access to external URL https://www1.localhost:9443/payment-request/allowpaymentrequest/echo-PaymentRequest.html?embed -#PID UNRESPONSIVE - com.apple.WebKit.WebContent.Development (pid 27890) -FAIL: Timed out waiting for notifyDone to be called - -#EOF -#EOF diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/allowpaymentrequest-attribute-cross-origin-bc-containers.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/allowpaymentrequest-attribute-cross-origin-bc-containers.https.html deleted file mode 100644 index 1426df1a772a7..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/allowpaymentrequest-attribute-cross-origin-bc-containers.https.html +++ /dev/null @@ -1,11 +0,0 @@ - -PaymentRequest allowpaymentrequest attribute cross-origin browsing context containers - - - - - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/allowpaymentrequest-attribute-same-origin-bc-containers.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/allowpaymentrequest-attribute-same-origin-bc-containers.https-expected.txt deleted file mode 100644 index 953fc1f65dc0d..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/allowpaymentrequest-attribute-same-origin-bc-containers.https-expected.txt +++ /dev/null @@ -1,6 +0,0 @@ - -PASS iframe -PASS frame -PASS object -PASS embed - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/allowpaymentrequest-attribute-same-origin-bc-containers.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/allowpaymentrequest-attribute-same-origin-bc-containers.https.html deleted file mode 100644 index b100058cf9237..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/allowpaymentrequest-attribute-same-origin-bc-containers.https.html +++ /dev/null @@ -1,11 +0,0 @@ - -PaymentRequest allowpaymentrequest attribute same origin browsing context containers - - - - - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/basic.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/basic.https-expected.txt deleted file mode 100644 index f9414e07a0d5f..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/basic.https-expected.txt +++ /dev/null @@ -1,4 +0,0 @@ - - -FAIL PaymentRequest basic Trying to start an Apple Pay session from an insecure document. - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/basic.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/basic.https.html deleted file mode 100644 index 80a6a2279d724..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/basic.https.html +++ /dev/null @@ -1,14 +0,0 @@ - -PaymentRequest <iframe allowpaymentrequest> basic - - - - 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 deleted file mode 100644 index a94bac064c943..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/common.sub.js +++ /dev/null @@ -1,61 +0,0 @@ -// Test should set these: -// const expectSuccess = {'iframe': bool, 'frame': bool, 'object': bool, 'embed': bool}; -// const setAllowPaymentRequest = bool; -// const testCrossOrigin = bool; - -const tests = {}; - -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"); - if (result.message === "Exception") { - const [, code, name, stack] = result.details; - assert_unreached(`Unexpected exception "${name}" (${code}) ${stack}`); - } - } else { - 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 => { - const elm = document.createElement(tagName); - if (setAllowPaymentRequest) { - 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") { - elm.data = url; - } else { - elm.src = url; - } - elm.onload = t.step_func(() => { - window[i].postMessage( - "What is the result of new PaymentRequest(...)?", - "*" - ); - }); - 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 deleted file mode 100644 index 5211c7e5ce78c..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/echo-PaymentRequest.html +++ /dev/null @@ -1,25 +0,0 @@ - - -This page echos the result of new PaymentRequest(...). diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/no-attribute-cross-origin-bc-containers.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/no-attribute-cross-origin-bc-containers.https-expected.txt deleted file mode 100644 index b9ddd8ab0133b..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/no-attribute-cross-origin-bc-containers.https-expected.txt +++ /dev/null @@ -1,9 +0,0 @@ -Blocked access to external URL https://www1.localhost:9443/payment-request/allowpaymentrequest/echo-PaymentRequest.html?iframe -Blocked access to external URL https://www1.localhost:9443/payment-request/allowpaymentrequest/echo-PaymentRequest.html?frame -Blocked access to external URL https://www1.localhost:9443/payment-request/allowpaymentrequest/echo-PaymentRequest.html?object -Blocked access to external URL https://www1.localhost:9443/payment-request/allowpaymentrequest/echo-PaymentRequest.html?embed -#PID UNRESPONSIVE - com.apple.WebKit.WebContent.Development (pid 27905) -FAIL: Timed out waiting for notifyDone to be called - -#EOF -#EOF diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/no-attribute-cross-origin-bc-containers.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/no-attribute-cross-origin-bc-containers.https.html deleted file mode 100644 index 6919a54e2d2fa..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/no-attribute-cross-origin-bc-containers.https.html +++ /dev/null @@ -1,11 +0,0 @@ - -PaymentRequest no attribute cross-origin browsing context containers - - - - - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/no-attribute-same-origin-bc-containers.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/no-attribute-same-origin-bc-containers.https-expected.txt deleted file mode 100644 index 953fc1f65dc0d..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/no-attribute-same-origin-bc-containers.https-expected.txt +++ /dev/null @@ -1,6 +0,0 @@ - -PASS iframe -PASS frame -PASS object -PASS embed - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/no-attribute-same-origin-bc-containers.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/no-attribute-same-origin-bc-containers.https.html deleted file mode 100644 index ea3773ba7b6fc..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/no-attribute-same-origin-bc-containers.https.html +++ /dev/null @@ -1,11 +0,0 @@ - -PaymentRequest no attribute same origin browsing context containers - - - - - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/removing-allowpaymentrequest.https.sub-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/removing-allowpaymentrequest.https.sub-expected.txt deleted file mode 100644 index f9d64d317490c..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/removing-allowpaymentrequest.https.sub-expected.txt +++ /dev/null @@ -1,6 +0,0 @@ -Blocked access to external URL https://www1.localhost:9443/payment-request/allowpaymentrequest/echo-PaymentRequest.html -#PID UNRESPONSIVE - com.apple.WebKit.WebContent.Development (pid 27916) -FAIL: Timed out waiting for notifyDone to be called - -#EOF -#EOF diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/removing-allowpaymentrequest.https.sub.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/removing-allowpaymentrequest.https.sub.html deleted file mode 100644 index 64baebb502465..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/removing-allowpaymentrequest.https.sub.html +++ /dev/null @@ -1,67 +0,0 @@ - -PaymentRequest removing allowpaymentrequest after load and then navigating - - - - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/setting-allowpaymentrequest-timing.https.sub-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/setting-allowpaymentrequest-timing.https.sub-expected.txt deleted file mode 100644 index 6afcb05895292..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/setting-allowpaymentrequest-timing.https.sub-expected.txt +++ /dev/null @@ -1,6 +0,0 @@ -Blocked access to external URL https://www1.localhost:9443/payment-request/allowpaymentrequest/echo-PaymentRequest.html?pipe=trickle(d3) -#PID UNRESPONSIVE - com.apple.WebKit.WebContent.Development (pid 27933) -FAIL: Timed out waiting for notifyDone to be called - -#EOF -#EOF diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/setting-allowpaymentrequest-timing.https.sub.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/setting-allowpaymentrequest-timing.https.sub.html deleted file mode 100644 index a741296d5da75..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/setting-allowpaymentrequest-timing.https.sub.html +++ /dev/null @@ -1,42 +0,0 @@ - -PaymentRequest setting allowpaymentrequest after document creation, before response - - - - - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/setting-allowpaymentrequest.https.sub-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/setting-allowpaymentrequest.https.sub-expected.txt deleted file mode 100644 index 028590450549f..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/setting-allowpaymentrequest.https.sub-expected.txt +++ /dev/null @@ -1,6 +0,0 @@ -Blocked access to external URL https://www1.localhost:9443/payment-request/allowpaymentrequest/echo-PaymentRequest.html -#PID UNRESPONSIVE - com.apple.WebKit.WebContent.Development (pid 27993) -FAIL: Timed out waiting for notifyDone to be called - -#EOF -#EOF diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/setting-allowpaymentrequest.https.sub.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/setting-allowpaymentrequest.https.sub.html deleted file mode 100644 index c1d53a4bc2617..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/setting-allowpaymentrequest.https.sub.html +++ /dev/null @@ -1,43 +0,0 @@ - -PaymentRequest setting allowpaymentrequest after load and then navigating - - - - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/w3c-import.log deleted file mode 100644 index 632f466af7cbc..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/w3c-import.log +++ /dev/null @@ -1,28 +0,0 @@ -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/allowpaymentrequest/active-document-cross-origin.https.sub.html -/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/active-document-same-origin.https.html -/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/allowpaymentrequest-attribute-cross-origin-bc-containers.https.html -/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/allowpaymentrequest-attribute-same-origin-bc-containers.https.html -/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/basic.https.html -/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/common.sub.js -/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/echo-PaymentRequest.html -/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/no-attribute-cross-origin-bc-containers.https.html -/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/no-attribute-same-origin-bc-containers.https.html -/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/removing-allowpaymentrequest.https.sub.html -/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/setting-allowpaymentrequest-timing.https.sub.html -/LayoutTests/imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/setting-allowpaymentrequest.https.sub.html diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/blank.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/blank.html deleted file mode 100644 index edeaa45bb6207..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/blank.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Blank Page - - - - - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/delegate-request.https.sub-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/delegate-request.https.sub-expected.txt new file mode 100644 index 0000000000000..4946201171dd3 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/delegate-request.https.sub-expected.txt @@ -0,0 +1,10 @@ +Verifies that PaymentRequest.show() call from a cross-origin subframe without user activation works if and only if the top frame has user activation and it delegates the capability to the subframe. + + +Harness Error (TIMEOUT), message = null + +NOTRUN Payment-request from a subframe fails without delegation when the top frame has no user activation +NOTRUN Payment-request from a subframe fails without delegation when the top frame has user activation +NOTRUN Payment-request from a subframe succeeds with delegation when the top frame has user activation +NOTRUN Payment-request from a subframe fails with delegation when the top frame has no user activation + diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/delegate-request.https.sub.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/delegate-request.https.sub.html new file mode 100644 index 0000000000000..988550036ca9d --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/delegate-request.https.sub.html @@ -0,0 +1,81 @@ + +Payment request delegation test + + + + + + + + Verifies that PaymentRequest.show() call from a cross-origin subframe without user activation + works if and only if the top frame has user activation and it delegates the capability to the + subframe. + + + + + + diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/historical.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/historical.https-expected.txt index 6f96c596dd0a0..d53c8168f3fec 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/historical.https-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/historical.https-expected.txt @@ -1,11 +1,11 @@ PASS paymentRequestID in PaymentRequest PASS paymentRequestID in PaymentResponse -PASS careOf in PaymentAddress +FAIL careOf in ContactAddress undefined is not an object (evaluating 'window[interf].prototype') PASS totalAmount in PaymentResponse PASS paymentRequestId in PaymentRequest PASS paymentRequestId in PaymentResponse -PASS languageCode in PaymentAddress +FAIL languageCode in ContactAddress undefined is not an object (evaluating 'window[interf].prototype') PASS allowPaymentRequest in HTMLIFrameElement PASS supportedMethods must not support sequence diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/historical.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/historical.https.html index aa183a58cdb9f..3e881d0122b41 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/historical.https.html +++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/historical.https.html @@ -10,7 +10,7 @@ ["paymentRequestID", "PaymentResponse"], // https://github.com/w3c/browser-payment-api/pull/258 - ["careOf", "PaymentAddress"], + ["careOf", "ContactAddress"], // https://github.com/w3c/browser-payment-api/pull/219 ["totalAmount", "PaymentResponse"], @@ -20,7 +20,7 @@ ["paymentRequestId", "PaymentResponse"], // https://github.com/w3c/payment-request/pull/765 - ["languageCode", "PaymentAddress"], + ["languageCode", "ContactAddress"], //https://github.com/whatwg/html/pull/5915 ["allowPaymentRequest", "HTMLIFrameElement"], diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-is-showing.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-is-showing.https.html index 34b9ae82b6530..a30029458f5f2 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-is-showing.https.html +++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-is-showing.https.html @@ -39,7 +39,7 @@ * @param {String} src Optional resource URL to load. * @returns {Promise} Resolves when the src loads. */ - async function attachIframe(src = "blank.html") { + async function attachIframe(src = "./resources/blank.html") { const iframe = document.createElement("iframe"); iframe.allow = "payment"; iframe.src = src; @@ -150,7 +150,7 @@ // and the request is showing boolean to become false. await new Promise((resolve) => { iframe.onload = resolve; - iframe.src = "blank.html?test=123"; + iframe.src = "./resources/blank.html?test=123"; }); iframe.remove(); diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-constructor-thcrash.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-constructor-thcrash.https.html index 80ee1606852a9..b600307085145 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-constructor-thcrash.https.html +++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-constructor-thcrash.https.html @@ -6,24 +6,6 @@ + + + + + + diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-show-method.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-show-method.https.html index a03121692b1a8..3926b3e92827e 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-show-method.https.html +++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-show-method.https.html @@ -35,12 +35,6 @@ }, }); -promise_test(async (t) => { - const request = new PaymentRequest(defaultMethods, defaultDetails); - const acceptPromise = request.show(); - await promise_rejects_dom(t, "SecurityError", acceptPromise); -}, `Calling show() without being triggered by user interaction throws`); - promise_test(async (t) => { const request = new PaymentRequest(defaultMethods, defaultDetails); await promise_rejects_dom(t, "SecurityError", request.show()); @@ -63,11 +57,8 @@ await test_driver.bless(); const acceptPromise1 = request1.show(); - // User activation consumed, so... - const request2 = new PaymentRequest(defaultMethods, defaultDetails); - await promise_rejects_dom(t, "SecurityError", request2.show()); - // Payment request already showing, so... + const request2 = new PaymentRequest(defaultMethods, defaultDetails); await test_driver.bless(); await promise_rejects_dom(t, "AbortError", request2.show()); @@ -109,6 +100,5 @@ tag one of the suggested reviewers. + >suggested reviewers. diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-update-event-constructor.http-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-update-event-constructor.http-expected.txt deleted file mode 100644 index d91e665a50b1d..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-update-event-constructor.http-expected.txt +++ /dev/null @@ -1,3 +0,0 @@ - -PASS PaymentRequestUpdateEvent constructor must not be exposed in insecure context - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-update-event-constructor.http.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-update-event-constructor.http.html deleted file mode 100644 index e6e505ff0c1ba..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-update-event-constructor.http.html +++ /dev/null @@ -1,12 +0,0 @@ - - - -Test for PaymentRequestUpdateEvent Constructor (insecure) - - - - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-update-event-constructor.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-update-event-constructor.https-expected.txt deleted file mode 100644 index 6a695bf3f4891..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-update-event-constructor.https-expected.txt +++ /dev/null @@ -1,5 +0,0 @@ - -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/payment-request-update-event-constructor.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-update-event-constructor.https.html deleted file mode 100644 index 77ef2281b1d0e..0000000000000 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-request-update-event-constructor.https.html +++ /dev/null @@ -1,51 +0,0 @@ - - - -Test for PaymentRequestUpdateEvent Constructor - - - - diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/rejects_if_not_active.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/rejects_if_not_active.https.html index 84f299db9be1d..32feccb2655f3 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/rejects_if_not_active.https.html +++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/rejects_if_not_active.https.html @@ -7,83 +7,136 @@ - + // We navigate the iframe again, putting request1's document into an non-fully active state. + const request2 = await getLoadedPaymentRequest( + iframe, + "./resources/page2.html" + ); + + // Now, request1's relevant global object's document is no longer active. + // So, call .show(), and make sure it rejects appropriately. + await promise_rejects_dom( + t, + "AbortError", + frameDOMException1, + request1.show(), + "Inactive document, so must throw AbortError" + ); + // request2 has an active document tho, so confirm it's working as expected: + // Get transient activation + await test_driver.bless("payment 2", () => {}, iframe.contentWindow); + request2.show(); + await request2.abort(); + await promise_rejects_dom( + t, + "InvalidStateError", + iframe.contentWindow.DOMException, + request2.show(), + "Abort already called, so InvalidStateError" + ); + }, "PaymentRequest.show() aborts if the document is not active."); + + promise_test(async (t) => { + // We nest two iframes and wait for them to load. + const outerIframe = document.createElement("iframe"); + outerIframe.allow = "payment"; + document.body.appendChild(outerIframe); + t.add_cleanup(() => { + outerIframe.remove(); + }); + // Load the outer iframe (we don't care about the awaited request) + await getLoadedPaymentRequest(outerIframe, "./resources/page1.html"); + + // Now we create the inner iframe + const innerIframe = outerIframe.contentDocument.createElement("iframe"); + innerIframe.allow = "payment"; + + // nest them + outerIframe.contentDocument.body.appendChild(innerIframe); + + // load innerIframe, and get the PaymentRequest instance + const request = await getLoadedPaymentRequest( + innerIframe, + "./resources/page2.html" + ); + // Save DOMException from innerIframe before navigating away. + const innerIframeDOMException = innerIframe.contentWindow.DOMException; + + // Navigate the outer iframe to a new location. + // Wait for the load event to fire. + await new Promise((resolve) => { + outerIframe.addEventListener("load", resolve); + outerIframe.src = "./resources/page2.html"; + }); + + await test_driver.bless("", () => {}, innerIframe.contentWindow); + const showPromise = request.show(); + // Now, request's relevant global object's document is still active + // (it is the active document of the inner iframe), but is not fully active + // (since the parent of the inner iframe is itself no longer active). + // So, call request.show() and make sure it rejects appropriately. + await promise_rejects_dom( + t, + "AbortError", + innerIframeDOMException, + showPromise, + "Active, but not fully active, so must throw AbortError" + ); + }, "PaymentRequest.show() aborts if the document is active, but not fully active."); + diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/resources/delegate-request-subframe.sub.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/resources/delegate-request-subframe.sub.html new file mode 100644 index 0000000000000..aeda1f00d4feb --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/resources/delegate-request-subframe.sub.html @@ -0,0 +1,38 @@ + +Payment request delegation test: subframe + + diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/resources/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/payment-request/resources/w3c-import.log index 149fb58cd24c7..7e711cf5d54f4 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/resources/w3c-import.log +++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/resources/w3c-import.log @@ -14,5 +14,6 @@ Property values requiring vendor prefixes: None ------------------------------------------------------------------------ List of files: +/LayoutTests/imported/w3c/web-platform-tests/payment-request/resources/delegate-request-subframe.sub.html /LayoutTests/imported/w3c/web-platform-tests/payment-request/resources/page1.html /LayoutTests/imported/w3c/web-platform-tests/payment-request/resources/page2.html diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/show-consume-activation.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/show-consume-activation.https-expected.txt index 0ec14ed1aaa85..a70f27f98d343 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/show-consume-activation.https-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/show-consume-activation.https-expected.txt @@ -1,3 +1,3 @@ -FAIL Calling share consumes user activation promise_rejects_dom: function "function() { throw e }" threw object "SecurityError: show() must be triggered by user activation." that is not a DOMException NotAllowedError: property "code" is equal to 18, expected 0 +PASS Calling show consumes user activation, if present diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/show-consume-activation.https.html b/LayoutTests/imported/w3c/web-platform-tests/payment-request/show-consume-activation.https.html index 0b92c4c15cf15..6f629489e4af4 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/show-consume-activation.https.html +++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/show-consume-activation.https.html @@ -37,22 +37,16 @@ promise_test(async t => { const pr = new PaymentRequest(defaultMethods, defaultDetails); - // Not activated by user gesture, so not allowed! - await promise_rejects_dom(t, "NotAllowedError", pr.show()); - await test_driver.bless("Calls show() method"); - - // Activated by user gesture, so all good. const showPromise = pr.show(); - // The activation has been consumed, so calling show() again would require - // a new gesture. - await promise_rejects_dom(t, "NotAllowedError", pr.show()); + // The activation has been consumed. + assert_false(navigator.userActivation.isActive); // Abort the payment request pr.abort() await promise_rejects_dom(t, "AbortError", showPromise); - }, "Calling share consumes user activation"); + }, "Calling show consumes user activation, if present");
This page echos the result of new PaymentRequest(...).