From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../complete-method-manual.https.html | 101 +++++++++++++ .../payment-request/payment-response/helpers.js | 110 ++++++++++++++ .../methodName-attribute-manual.https.html | 28 ++++ ...onpayerdetailchange-attribute-manual.https.html | 73 ++++++++++ .../onpayerdetailchange-attribute.https.html | 14 ++ .../payerEmail-attribute-manual.https.html | 48 +++++++ .../payerName-attribute-manual.https.html | 48 +++++++ .../payerPhone-attribute-manual.https.html | 48 +++++++ ...lschange-updateWith-immediate-manual.https.html | 68 +++++++++ ...payerdetailschange-updateWith-manual.https.html | 56 ++++++++ .../rejects_if_not_active-manual.https.html | 160 +++++++++++++++++++++ .../requestId-attribute-manual.https.html | 34 +++++ 12 files changed, 788 insertions(+) create mode 100644 testing/web-platform/tests/payment-request/payment-response/complete-method-manual.https.html create mode 100644 testing/web-platform/tests/payment-request/payment-response/helpers.js create mode 100644 testing/web-platform/tests/payment-request/payment-response/methodName-attribute-manual.https.html create mode 100644 testing/web-platform/tests/payment-request/payment-response/onpayerdetailchange-attribute-manual.https.html create mode 100644 testing/web-platform/tests/payment-request/payment-response/onpayerdetailchange-attribute.https.html create mode 100644 testing/web-platform/tests/payment-request/payment-response/payerEmail-attribute-manual.https.html create mode 100644 testing/web-platform/tests/payment-request/payment-response/payerName-attribute-manual.https.html create mode 100644 testing/web-platform/tests/payment-request/payment-response/payerPhone-attribute-manual.https.html create mode 100644 testing/web-platform/tests/payment-request/payment-response/payerdetailschange-updateWith-immediate-manual.https.html create mode 100644 testing/web-platform/tests/payment-request/payment-response/payerdetailschange-updateWith-manual.https.html create mode 100644 testing/web-platform/tests/payment-request/payment-response/rejects_if_not_active-manual.https.html create mode 100644 testing/web-platform/tests/payment-request/payment-response/requestId-attribute-manual.https.html (limited to 'testing/web-platform/tests/payment-request/payment-response') diff --git a/testing/web-platform/tests/payment-request/payment-response/complete-method-manual.https.html b/testing/web-platform/tests/payment-request/payment-response/complete-method-manual.https.html new file mode 100644 index 0000000000..f7facd7980 --- /dev/null +++ b/testing/web-platform/tests/payment-request/payment-response/complete-method-manual.https.html @@ -0,0 +1,101 @@ + + + + + PaymentResponse.prototype.complete() method + + + + + + +

+ Manual Tests for PaymentResponse.complete() - Please run in order! +

+

+ Click on each button in sequence from top to bottom without refreshing the page. + Each button will bring up the Payment Request UI window. +

+

+ When presented with the payment sheet, use any credit card select to "Pay". + Also confirm any prompts that come up. +

+
    +
  1. + +
  2. +
  3. + +
  4. +
  5. + +
  6. +
  7. + +
  8. +
  9. + +
  10. +
  11. + +
  12. +
+ + If you find a buggy test, please file a bug + and tag one of the suggested reviewers. + diff --git a/testing/web-platform/tests/payment-request/payment-response/helpers.js b/testing/web-platform/tests/payment-request/payment-response/helpers.js new file mode 100644 index 0000000000..1242ecb743 --- /dev/null +++ b/testing/web-platform/tests/payment-request/payment-response/helpers.js @@ -0,0 +1,110 @@ +setup({ explicit_done: true, explicit_timeout: true }); + +const applePay = Object.freeze({ + supportedMethods: "https://apple.com/apple-pay", + data: { + version: 3, + merchantIdentifier: "merchant.com.example", + countryCode: "US", + merchantCapabilities: ["supports3DS"], + supportedNetworks: ["visa"], + } +}); + +const validMethod = Object.freeze({ + supportedMethods: "basic-card", +}); + +const validMethods = Object.freeze([validMethod, applePay]); + +const validAmount = Object.freeze({ + currency: "USD", + value: "1.00", +}); + +const validTotal = Object.freeze({ + label: "Valid total", + amount: validAmount, +}); +const validDetails = { + total: validTotal, +}; + +test(() => { + try { + new PaymentRequest(validMethods, validDetails); + } catch (err) { + done(); + throw err; + } +}, "Can construct a payment request (smoke test)."); + +/** + * Pops up a payment sheet, allowing options to be + * passed in if particular values are needed. + * + * @param PaymentOptions options + */ +async function getPaymentResponse(options, id) { + const { response } = await getPaymentRequestResponse(options, id); + return response; +} + +/** + * Creates a payment request and response pair. + * It also shows the payment sheet. + * + * @param {PaymentOptions?} options + * @param {String?} id + */ +async function getPaymentRequestResponse(options, id) { + const methods = [{ supportedMethods: "basic-card" }]; + const details = { + id, + total: { + label: "Total due", + amount: { currency: "USD", value: "1.0" }, + }, + }; + const request = new PaymentRequest(methods, details, options); + const response = await request.show(); + return { request, response }; +} + +/** + * Runs a manual test for payment + * + * @param {HTMLButtonElement} button The HTML button. + * @param {PaymentOptions?} options. + * @param {Object} expected What property values are expected to pass the test. + * @param {String?} id And id for the request/response pair. + */ +async function runManualTest(button, options, expected = {}, id = undefined) { + button.disabled = true; + const { request, response } = await getPaymentRequestResponse(options, id); + await response.complete(); + test(() => { + assert_idl_attribute( + response, + "requestId", + "Expected requestId to be an IDL attribute." + ); + assert_equals(response.requestId, request.id, `Expected ids to match`); + for (const [attribute, value] of Object.entries(expected)) { + assert_idl_attribute( + response, + attribute, + `Expected ${attribute} to be an IDL attribute.` + ); + assert_equals( + response[attribute], + value, + `Expected response ${attribute} attribute to be ${value}` + ); + } + assert_idl_attribute(response, "details"); + assert_equals(typeof response.details, "object", "Expected an object"); + // Testing that this does not throw: + response.toJSON(); + }, button.textContent.trim()); +} diff --git a/testing/web-platform/tests/payment-request/payment-response/methodName-attribute-manual.https.html b/testing/web-platform/tests/payment-request/payment-response/methodName-attribute-manual.https.html new file mode 100644 index 0000000000..0a8ef6c77e --- /dev/null +++ b/testing/web-platform/tests/payment-request/payment-response/methodName-attribute-manual.https.html @@ -0,0 +1,28 @@ + + + + + PaymentResponse.prototype.methodName attribute + + + + +

methodName attribute

+

+ Click on each button in sequence from top to bottom without refreshing the page. + Each button will bring up the Payment Request UI window. +

+

+ Use any credit card and any values. +

+
    +
  1. + +
  2. +
+ + If you find a buggy test, please file a bug + and tag one of the suggested reviewers. + diff --git a/testing/web-platform/tests/payment-request/payment-response/onpayerdetailchange-attribute-manual.https.html b/testing/web-platform/tests/payment-request/payment-response/onpayerdetailchange-attribute-manual.https.html new file mode 100644 index 0000000000..5731952c0e --- /dev/null +++ b/testing/web-platform/tests/payment-request/payment-response/onpayerdetailchange-attribute-manual.https.html @@ -0,0 +1,73 @@ + + +PaymentResponse.prototype.onpayerdetailchange attribute + + + + +

Handling PaymentResponse.prototype.onpayerdetailchange events

+

+ Each button will bring up the Payment Request UI window. + When shown the payment sheet, use any details and hit pay. +

+

+ When asked to retry the payment: +

+
    +
  1. +

    + Change payer's name to "pass". +

    + +
  2. +
  3. +

    + Change payer's email to "pass@pass.pass". +

    + +
  4. +
  5. +

    + Change payer's phone to "+1-800-000-0000". +

    + +
  6. +
  7. + +
  8. +
+ + If you find a buggy test, please file a bug + and tag one of the owners. + diff --git a/testing/web-platform/tests/payment-request/payment-response/onpayerdetailchange-attribute.https.html b/testing/web-platform/tests/payment-request/payment-response/onpayerdetailchange-attribute.https.html new file mode 100644 index 0000000000..ed9e6e885b --- /dev/null +++ b/testing/web-platform/tests/payment-request/payment-response/onpayerdetailchange-attribute.https.html @@ -0,0 +1,14 @@ + + +PaymentResponse.prototype.onpayerdetailschange attribute + + + diff --git a/testing/web-platform/tests/payment-request/payment-response/payerEmail-attribute-manual.https.html b/testing/web-platform/tests/payment-request/payment-response/payerEmail-attribute-manual.https.html new file mode 100644 index 0000000000..28ce4c28a8 --- /dev/null +++ b/testing/web-platform/tests/payment-request/payment-response/payerEmail-attribute-manual.https.html @@ -0,0 +1,48 @@ + + + + + PaymentResponse.prototype.payerEmail attribute + + + + +

payerEmail attribute

+

+ Click on each button in sequence from top to bottom without refreshing the page. + Each button will bring up the Payment Request UI window. +

+

+ When requested, please use "wpt@w3.org" as the email. +

+
    +
  1. + +
  2. +
  3. + +
  4. +
  5. + +
  6. +
  7. + +
  8. +
  9. + +
  10. +
+ + If you find a buggy test, please file a bug + and tag one of the suggested reviewers. + diff --git a/testing/web-platform/tests/payment-request/payment-response/payerName-attribute-manual.https.html b/testing/web-platform/tests/payment-request/payment-response/payerName-attribute-manual.https.html new file mode 100644 index 0000000000..44d741ae45 --- /dev/null +++ b/testing/web-platform/tests/payment-request/payment-response/payerName-attribute-manual.https.html @@ -0,0 +1,48 @@ + + + + + PaymentResponse.prototype.payerName attribute + + + + +

payerName attribute

+

+ Click on each button in sequence from top to bottom without refreshing the page. + Each button will bring up the Payment Request UI window. +

+

+ When requested, please use "web platform test" as the payer name. +

+
    +
  1. + +
  2. +
  3. + +
  4. +
  5. + +
  6. +
  7. + +
  8. +
  9. + +
  10. +
+ + If you find a buggy test, please file a bug + and tag one of the suggested reviewers. + diff --git a/testing/web-platform/tests/payment-request/payment-response/payerPhone-attribute-manual.https.html b/testing/web-platform/tests/payment-request/payment-response/payerPhone-attribute-manual.https.html new file mode 100644 index 0000000000..85a44a819c --- /dev/null +++ b/testing/web-platform/tests/payment-request/payment-response/payerPhone-attribute-manual.https.html @@ -0,0 +1,48 @@ + + + + + PaymentResponse.prototype.payerPhone attribute + + + + +

payerPhone attribute

+

+ Click on each button in sequence from top to bottom without refreshing the page. + Each button will bring up the Payment Request UI window. +

+

+ When prompted, please use +12345678910 as the phone number. +

+
    +
  1. + +
  2. +
  3. + +
  4. +
  5. + +
  6. +
  7. + +
  8. +
  9. + +
  10. +
+ + If you find a buggy test, please file a bug + and tag one of the suggested reviewers. + diff --git a/testing/web-platform/tests/payment-request/payment-response/payerdetailschange-updateWith-immediate-manual.https.html b/testing/web-platform/tests/payment-request/payment-response/payerdetailschange-updateWith-immediate-manual.https.html new file mode 100644 index 0000000000..7e35d78700 --- /dev/null +++ b/testing/web-platform/tests/payment-request/payment-response/payerdetailschange-updateWith-immediate-manual.https.html @@ -0,0 +1,68 @@ + + +Dispatching PaymentRequestUpdateEvent for "payerdetailschange" + + + + +

Handling PaymentResponse.prototype.onpayerdetailchange events

+

+ The test brings up the Payment Request UI window. + When shown the payment sheet, use any details and hit pay. +

+

+ When asked to retry the payment: +

+
    +
  1. +

    + Change payer's name to anything. +

    + +
  2. +
  3. + +
  4. +
+ + If you find a buggy test, please file a bug + and tag one of the owners. + diff --git a/testing/web-platform/tests/payment-request/payment-response/payerdetailschange-updateWith-manual.https.html b/testing/web-platform/tests/payment-request/payment-response/payerdetailschange-updateWith-manual.https.html new file mode 100644 index 0000000000..1a7342365d --- /dev/null +++ b/testing/web-platform/tests/payment-request/payment-response/payerdetailschange-updateWith-manual.https.html @@ -0,0 +1,56 @@ + + +Dispatching PaymentRequestUpdateEvent for "payerdetailschange" + + + + +

Handling PaymentResponse.prototype.onpayerdetailchange events

+

+ The test brings up the Payment Request UI window. + When shown the payment sheet, use any details and hit pay. +

+

+ When asked to retry the payment: +

+
    +
  1. +

    + Change payer's name to anything. +

    + +
  2. +
  3. + +
  4. +
+ + If you find a buggy test, please file a bug + and tag one of the owners. + diff --git a/testing/web-platform/tests/payment-request/payment-response/rejects_if_not_active-manual.https.html b/testing/web-platform/tests/payment-request/payment-response/rejects_if_not_active-manual.https.html new file mode 100644 index 0000000000..6f2e9e95d4 --- /dev/null +++ b/testing/web-platform/tests/payment-request/payment-response/rejects_if_not_active-manual.https.html @@ -0,0 +1,160 @@ + + + +PaymentResponse retry() rejects if doc is not fully active + + + + + +
+

+ For each test, when the payment sheet is shown, select a payment method and hit "Pay". +

+

retry() and document active state

+

Manual Tests for PaymentResponse.retry() - Please run in order!

+
    +
  1. + +
  2. +
  3. + +
  4. +
+

complete() and document active state

+

Manual Tests for PaymentResponse.complete() - Please run in order!

+
    +
  1. + +
  2. +
  3. + +
  4. +
  5. + +
  6. +
+
+ + If you find a buggy test, please file a bug + and tag one of the suggested reviewers. + diff --git a/testing/web-platform/tests/payment-request/payment-response/requestId-attribute-manual.https.html b/testing/web-platform/tests/payment-request/payment-response/requestId-attribute-manual.https.html new file mode 100644 index 0000000000..ddb1e0d831 --- /dev/null +++ b/testing/web-platform/tests/payment-request/payment-response/requestId-attribute-manual.https.html @@ -0,0 +1,34 @@ + + + + + PaymentResponse.prototype.requestId attribute + + + + +

requestId attribute

+

+ Click on each button in sequence from top to bottom without refreshing the page. + Each button will bring up the Payment Request UI window. +

+

+ When presented with the payment sheet, use any credit card select to "Pay". + Also confirm any prompts that come up. +

+
    +
  1. + +
  2. +
  3. + +
  4. +
+ + If you find a buggy test, please file a bug + and tag one of the suggested reviewers. + -- cgit v1.2.3