From 53b3a8eda25cce01aec86f70d0d1c4354ea7e09f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Fri, 7 May 2021 16:34:58 +1000 Subject: [PATCH] Remove shipping related things from payment-request (#28830) --- ...ibutes-and-toJSON-method-manual.https.html | 109 ------ ...pdateWith-call-immediate-manual.https.html | 206 ----------- ...plicate-shipping-options-manual.https.html | 106 ------ ...eWith-incremental-update-manual.https.html | 196 ---------- ...With-method-abort-update-manual.https.html | 286 --------------- .../updateWith-state-checks-manual.https.html | 125 ------- .../updatewith-method.https.html | 8 +- ...s-shippingAddress-member-manual.https.html | 103 ------ payment-request/algorithms-manual.https.html | 176 --------- .../billing-address-changed-manual.https.html | 115 ------ .../change-shipping-option-manual.https.html | 104 ------ ...pping-option-select-last-manual.https.html | 101 ------ ...-change-shipping-options-manual.https.html | 142 -------- ...ent-request-constructor-thcrash.https.html | 272 -------------- ...payment-request-constructor.https.sub.html | 222 +----------- ...t-ctor-currency-code-checks.https.sub.html | 57 --- ...shippingaddresschange-attribute.https.html | 78 ---- ...nshippingoptionchange-attribute.https.html | 79 ---- ...quest-shippingAddress-attribute.https.html | 28 -- ...equest-shippingOption-attribute.https.html | 100 ------ ...-request-shippingType-attribute.https.html | 72 ---- payment-request/payment-response/helpers.js | 40 --- .../retry-method-manual.https.html | 296 --------------- .../retry-method-warnings-manual.https.html | 158 -------- ...hippingAddress-attribute-manual.https.html | 101 ------ ...shippingOption-attribute-manual.https.html | 43 --- ...shipping-address-changed-manual.https.html | 99 ----- ...method-optional-promise-rejects.https.html | 40 +-- ...ptional-promise-resolves-manual.https.html | 339 ------------------ ...With-method-pmi-handling-manual.https.html | 140 -------- ...pts-payment-request-algo-manual.https.html | 230 ------------ 31 files changed, 4 insertions(+), 4167 deletions(-) delete mode 100644 payment-request/PaymentAddress/attributes-and-toJSON-method-manual.https.html delete mode 100644 payment-request/PaymentRequestUpdateEvent/updateWith-call-immediate-manual.https.html delete mode 100644 payment-request/PaymentRequestUpdateEvent/updateWith-duplicate-shipping-options-manual.https.html delete mode 100644 payment-request/PaymentRequestUpdateEvent/updateWith-incremental-update-manual.https.html delete mode 100644 payment-request/PaymentRequestUpdateEvent/updateWith-method-abort-update-manual.https.html delete mode 100644 payment-request/PaymentRequestUpdateEvent/updateWith-state-checks-manual.https.html delete mode 100644 payment-request/PaymentValidationErrors/retry-shows-shippingAddress-member-manual.https.html delete mode 100644 payment-request/algorithms-manual.https.html delete mode 100644 payment-request/billing-address-changed-manual.https.html delete mode 100644 payment-request/change-shipping-option-manual.https.html delete mode 100644 payment-request/change-shipping-option-select-last-manual.https.html delete mode 100644 payment-request/dynamically-change-shipping-options-manual.https.html delete mode 100644 payment-request/payment-request-constructor-thcrash.https.html delete mode 100644 payment-request/payment-request-onshippingaddresschange-attribute.https.html delete mode 100644 payment-request/payment-request-onshippingoptionchange-attribute.https.html delete mode 100644 payment-request/payment-request-shippingAddress-attribute.https.html delete mode 100644 payment-request/payment-request-shippingOption-attribute.https.html delete mode 100644 payment-request/payment-request-shippingType-attribute.https.html delete mode 100644 payment-request/payment-response/retry-method-manual.https.html delete mode 100644 payment-request/payment-response/retry-method-warnings-manual.https.html delete mode 100644 payment-request/payment-response/shippingAddress-attribute-manual.https.html delete mode 100644 payment-request/payment-response/shippingOption-attribute-manual.https.html delete mode 100644 payment-request/shipping-address-changed-manual.https.html delete mode 100644 payment-request/show-method-optional-promise-resolves-manual.https.html delete mode 100644 payment-request/updateWith-method-pmi-handling-manual.https.html delete mode 100644 payment-request/user-accepts-payment-request-algo-manual.https.html diff --git a/payment-request/PaymentAddress/attributes-and-toJSON-method-manual.https.html b/payment-request/PaymentAddress/attributes-and-toJSON-method-manual.https.html deleted file mode 100644 index 8afca19f923d45..00000000000000 --- a/payment-request/PaymentAddress/attributes-and-toJSON-method-manual.https.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - PaymentResponse.prototype.shippingAddress - - - - - -

PaymentAddress interface

-

- 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 enter addresses as follows... -

-
    -
  1. - - Please use: -
    -
    Recipient:
    -
    web platform test
    -
    Address line:
    -
    55 test st
    -
    Country
    -
    Australia
    -
    City
    -
    Chapel Hill
    -
    State/Region
    -
    Queensland
    -
    postal code
    -
    6095
    -
    organization
    -
    w3c
    -
    Phone number
    -
    +61 7 3378 0000
    -
    -
  2. -
- - If you find a buggy test, please file a bug - and tag one of the suggested reviewers. - diff --git a/payment-request/PaymentRequestUpdateEvent/updateWith-call-immediate-manual.https.html b/payment-request/PaymentRequestUpdateEvent/updateWith-call-immediate-manual.https.html deleted file mode 100644 index 1365ecefebeb27..00000000000000 --- a/payment-request/PaymentRequestUpdateEvent/updateWith-call-immediate-manual.https.html +++ /dev/null @@ -1,206 +0,0 @@ - - - - - - PaymentRequestUpdateEvent.updateWith() needs to be called immediately - - - - -

updateWith() method

-

- 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 the payment sheet is shown, select a different shipping address once. Then pay. -

-
    -
  1. - -
  2. -
  3. - -
  4. -
  5. - When the payment sheet is shown, select a different shipping address once, then change shipping option once. Then pay. -
  6. -
  7. - -
  8. -
- - If you find a buggy test, please file a bug - and tag one of the suggested reviewers. - diff --git a/payment-request/PaymentRequestUpdateEvent/updateWith-duplicate-shipping-options-manual.https.html b/payment-request/PaymentRequestUpdateEvent/updateWith-duplicate-shipping-options-manual.https.html deleted file mode 100644 index a4a7afd7f6337c..00000000000000 --- a/payment-request/PaymentRequestUpdateEvent/updateWith-duplicate-shipping-options-manual.https.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - updateWith() method - duplicate shippingOption ids - - - - -

updateWith() method - duplicate shippingOptions ids

-

- 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 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. -

-
    -
  1. - -
  2. -
- - If you find a buggy test, please file a bug - and tag one of the suggested reviewers. - diff --git a/payment-request/PaymentRequestUpdateEvent/updateWith-incremental-update-manual.https.html b/payment-request/PaymentRequestUpdateEvent/updateWith-incremental-update-manual.https.html deleted file mode 100644 index c1ed1b5f6850c7..00000000000000 --- a/payment-request/PaymentRequestUpdateEvent/updateWith-incremental-update-manual.https.html +++ /dev/null @@ -1,196 +0,0 @@ - - - - - Incremental updates via updateWith() - - - - -

- Incremental updates -

-

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

-

- 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. -

-

- If the payment request locks up or otherwise aborts, the test has failed. -

-
    -
  1. - -
  2. -
- -
-

Incremental updates via PaymentDetailsUpdate.total

-
    -
  1. - -
  2. -
-
- -
-

Incremental updates via PaymentDetailsBase.displayItems

-
    -
  1. - -
  2. -
-
- -
-

Incremental updates via PaymentDetailsBase.shippingOptions

-
    -
  1. - -
  2. -
-
- -
-

Incremental updates via PaymentDetailsBase.modifiers

-
    -
  1. - -
  2. -
  3. - -
  4. -
-
- - - If you find a buggy test, please file a bug - and tag one of the suggested reviewers. - diff --git a/payment-request/PaymentRequestUpdateEvent/updateWith-method-abort-update-manual.https.html b/payment-request/PaymentRequestUpdateEvent/updateWith-method-abort-update-manual.https.html deleted file mode 100644 index e24452c2a99d30..00000000000000 --- a/payment-request/PaymentRequestUpdateEvent/updateWith-method-abort-update-manual.https.html +++ /dev/null @@ -1,286 +0,0 @@ - - - - - updateWith() method - "abort the update" - - - - -

updateWith() method - "abort the update"

-

- 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 the payment sheet is shown, change the shipping address. -

-
    -
  1. - -
  2. -
  3. - -
  4. -
  5. - -
  6. -
  7. - -
  8. -
  9. - -
  10. -
  11. - -
  12. -
  13. - -
  14. -
  15. - -
  16. -
  17. - -
  18. -
  19. - -
  20. -
  21. - -
  22. -
- - If you find a buggy test, please file a bug - and tag one of the suggested reviewers. - diff --git a/payment-request/PaymentRequestUpdateEvent/updateWith-state-checks-manual.https.html b/payment-request/PaymentRequestUpdateEvent/updateWith-state-checks-manual.https.html deleted file mode 100644 index fb16de5699aa74..00000000000000 --- a/payment-request/PaymentRequestUpdateEvent/updateWith-state-checks-manual.https.html +++ /dev/null @@ -1,125 +0,0 @@ - - - -updateWith() method - state machine checks - - - -

updateWith() method - state machine checks

-

- 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 the payment sheet is shown, select a different shipping address once. Then pay. -

-
    -
  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/payment-request/PaymentRequestUpdateEvent/updatewith-method.https.html b/payment-request/PaymentRequestUpdateEvent/updatewith-method.https.html index acc62f5e2ce980..c1b47d1d93b5bc 100644 --- a/payment-request/PaymentRequestUpdateEvent/updatewith-method.https.html +++ b/payment-request/PaymentRequestUpdateEvent/updatewith-method.https.html @@ -39,9 +39,7 @@ // 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"), + new PaymentRequestUpdateEvent("just a test") ].forEach(ev => { assert_throws_dom( "InvalidStateError", @@ -57,9 +55,7 @@ test(() => { const request = new PaymentRequest(defaultMethods, defaultDetails); const untrustedEvents = [ - new PaymentRequestUpdateEvent("just a test"), - new PaymentRequestUpdateEvent("shippingaddresschange"), - new PaymentRequestUpdateEvent("shippingoptionchange"), + new PaymentRequestUpdateEvent("just a test") ].map(ev => { request.dispatchEvent(ev); // set .target and dispatch flag // unstrusted event. diff --git a/payment-request/PaymentValidationErrors/retry-shows-shippingAddress-member-manual.https.html b/payment-request/PaymentValidationErrors/retry-shows-shippingAddress-member-manual.https.html deleted file mode 100644 index 94e6fa5105b20a..00000000000000 --- a/payment-request/PaymentValidationErrors/retry-shows-shippingAddress-member-manual.https.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - - PaymentValidationErrors' `shippingAddress` member (AddressErrors) - - - - - -

- Manual Test for PaymentValidationErrors' `shippingAddress` member - 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 card and select to "Pay". - You will be asked to retry the payment and an error should be shown somewhere - in the UI. The expected error string is described in each individual test. - If you see the error, hit "Pay" again. If you don't see the error, - abort the payment request by hitting "esc" - which means that particular test - has failed. -

-
    -
  1. - -
  2. -
  3. - -
  4. -
  5. - -
  6. -
  7. - -
  8. -
  9. - -
  10. -
  11. - -
  12. -
  13. - -
  14. -
  15. - -
  16. -
  17. - -
  18. -
  19. - -
  20. -
  21. - -
  22. -
  23. - -
  24. -
- - If you find a buggy test, please file a bug - and tag one of the owners. - diff --git a/payment-request/algorithms-manual.https.html b/payment-request/algorithms-manual.https.html deleted file mode 100644 index b90c312aba3bf4..00000000000000 --- a/payment-request/algorithms-manual.https.html +++ /dev/null @@ -1,176 +0,0 @@ - - - - - Payment Request algorithms - - - - -

- Tests for "algorithms" section -

-

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

-
-

- User aborts the payment request algorithm -

- -

- When presented with the payment sheet, abort the payment request (e.g., by hitting the esc key or pressing a UA provided button). -

-
    -
  1. - -
  2. -
-
- -
-

Shipping address changed algorithm

- -

- When prompted, please change or enter a new shipping address and then select Pay. -

-
    -
  1. - -
  2. -
-
- -
-

Shipping option changed algorithm

- -

- Finally, when prompted, please select "shipping option 2" and then select Pay. -

-
    -
  1. - -
  2. -
-
- - - If you find a buggy test, please file a bug - and tag one of the suggested reviewers. - diff --git a/payment-request/billing-address-changed-manual.https.html b/payment-request/billing-address-changed-manual.https.html deleted file mode 100644 index ccfeb6fd364c75..00000000000000 --- a/payment-request/billing-address-changed-manual.https.html +++ /dev/null @@ -1,115 +0,0 @@ - -Test for requesting billing address - - - - -

Request billing address

-

- 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 the payment sheet is presented, select a payment method (e.g., a credit - card). -

-
    -
  1. - -
  2. -
  3. - -
  4. -
  5. -
- - If you find a buggy test, please - file a bug and - tag one of the - suggested reviewers. - diff --git a/payment-request/change-shipping-option-manual.https.html b/payment-request/change-shipping-option-manual.https.html deleted file mode 100644 index 438001804acdac..00000000000000 --- a/payment-request/change-shipping-option-manual.https.html +++ /dev/null @@ -1,104 +0,0 @@ - - - -Test for PaymentRequest shippingOption attribute - - - - - - -

PaymentRequest shippingOption 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 the payment sheet is presented, select "PICK ME!" as the shipping option. -

-
    -
  1. - -
  2. -
- - If you find a buggy test, please file a bug - and tag one of the suggested reviewers. - diff --git a/payment-request/change-shipping-option-select-last-manual.https.html b/payment-request/change-shipping-option-select-last-manual.https.html deleted file mode 100644 index 4ad31d65317338..00000000000000 --- a/payment-request/change-shipping-option-select-last-manual.https.html +++ /dev/null @@ -1,101 +0,0 @@ - - -Test for PaymentDetailsBase's shippingOptions member - - - - - -

PaymentRequest shippingOption 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 the payment sheet is presented, hit pay. -

-
    -
  1. - -
  2. -
- - If you find a buggy test, please file a bug - and tag one of the suggested reviewers. - diff --git a/payment-request/dynamically-change-shipping-options-manual.https.html b/payment-request/dynamically-change-shipping-options-manual.https.html deleted file mode 100644 index 0e6670a1b82452..00000000000000 --- a/payment-request/dynamically-change-shipping-options-manual.https.html +++ /dev/null @@ -1,142 +0,0 @@ - - -Test for PaymentRequest shippingOption dynamic updating - - - - - - -

PaymentRequest shippingOption attribute

-

- Click on each button in sequence from top to bottom without refreshing the - page. Each button (except the 'Done' button) will bring up the Payment Request - UI window. -

-
    -
  1. - When the payment sheet is presented, view options for Shipping Method. There - should only be one: "Default shipping method" -
  2. -
  3. - Change your Shipping Address - either update your existing one by changing - something (name, address, etc), or select a different Shipping Address, or - add a new Shipping Address and select it. -
  4. -
  5. - Go back to Shipping Method, and there is now an option called "Dynamically - added shipping option". Select it -
  6. -
  7. - Click on the 'Done' button -
  8. -
- - - If you find a buggy test, please - file a bug and - tag one of the - suggested reviewers. - diff --git a/payment-request/payment-request-constructor-thcrash.https.html b/payment-request/payment-request-constructor-thcrash.https.html deleted file mode 100644 index 80ee1606852a9c..00000000000000 --- a/payment-request/payment-request-constructor-thcrash.https.html +++ /dev/null @@ -1,272 +0,0 @@ - - - -Crash tests PaymentRequest Constructor - - - - diff --git a/payment-request/payment-request-constructor.https.sub.html b/payment-request/payment-request-constructor.https.sub.html index 9b0ad06454f933..c1ecc225838b3b 100644 --- a/payment-request/payment-request-constructor.https.sub.html +++ b/payment-request/payment-request-constructor.https.sub.html @@ -240,7 +240,7 @@ test(() => { smokeTest(); - for (const prop in ["displayItems", "shippingOptions", "modifiers"]) { + for (const prop in ["displayItems", "modifiers"]) { try { const details = Object.assign({}, defaultDetails, { [prop]: [] }); new PaymentRequest(defaultMethods, details); @@ -361,186 +361,6 @@ } }, "it handles high precision currency values without throwing"); -// Process shipping options: - -const defaultShippingOption = Object.freeze({ - id: "default", - label: "", - amount: defaultAmount, - selected: false, -}); -const defaultShippingOptions = Object.freeze([ - Object.assign({}, defaultShippingOption), -]); - -test(() => { - smokeTest(); - for (const amount of invalidAmounts) { - const invalidAmount = Object.assign({}, defaultAmount, { - value: amount, - }); - const invalidShippingOption = Object.assign({}, defaultShippingOption, { - amount: invalidAmount, - }); - const details = Object.assign({}, defaultDetails, { - shippingOptions: [invalidShippingOption], - }); - assert_throws_js( - TypeError, - () => { - new PaymentRequest(defaultMethods, details, { requestShipping: true }); - }, - `Expected TypeError for option.amount.value: "${amount}"` - ); - } -}, `For each option in details.shippingOptions: if option.amount.value is not a valid decimal monetary value, then throw a TypeError`); - -test(() => { - smokeTest(); - const shippingOptions = [defaultShippingOption]; - const details = Object.assign({}, defaultDetails, { shippingOptions }); - const request = new PaymentRequest(defaultMethods, details); - assert_equals( - request.shippingOption, - null, - "shippingOption must be null, as requestShipping is missing" - ); - // defaultDetails lacks shipping options - const request2 = new PaymentRequest(defaultMethods, defaultDetails, { - requestShipping: true, - }); - assert_equals( - request2.shippingOption, - null, - `request2.shippingOption must be null` - ); -}, "If there is no selected shipping option, then PaymentRequest.shippingOption remains null"); - -test(() => { - smokeTest(); - const selectedOption = Object.assign({}, defaultShippingOption, { - selected: true, - id: "the-id", - }); - const shippingOptions = [selectedOption]; - const details = Object.assign({}, defaultDetails, { shippingOptions }); - const requestNoShippingRequested1 = new PaymentRequest( - defaultMethods, - details - ); - assert_equals( - requestNoShippingRequested1.shippingOption, - null, - "Must be null when no shipping is requested (defaults to false)" - ); - const requestNoShippingRequested2 = new PaymentRequest( - defaultMethods, - details, - { requestShipping: false } - ); - assert_equals( - requestNoShippingRequested2.shippingOption, - null, - "Must be null when requestShipping is false" - ); - const requestWithShipping = new PaymentRequest(defaultMethods, details, { - requestShipping: "truthy value", - }); - assert_equals( - requestWithShipping.shippingOption, - "the-id", - "Selected option must be 'the-id'" - ); -}, "If there is a selected shipping option, and requestShipping is set, then that option becomes synchronously selected"); - -test(() => { - smokeTest(); - const failOption1 = Object.assign({}, defaultShippingOption, { - selected: true, - id: "FAIL1", - }); - const failOption2 = Object.assign({}, defaultShippingOption, { - selected: false, - id: "FAIL2", - }); - const passOption = Object.assign({}, defaultShippingOption, { - selected: true, - id: "the-id", - }); - const shippingOptions = [failOption1, failOption2, passOption]; - const details = Object.assign({}, defaultDetails, { shippingOptions }); - const requestNoShipping = new PaymentRequest(defaultMethods, details, { - requestShipping: false, - }); - assert_equals( - requestNoShipping.shippingOption, - null, - "shippingOption must be null, as requestShipping is false" - ); - const requestWithShipping = new PaymentRequest(defaultMethods, details, { - requestShipping: true, - }); - assert_equals( - requestWithShipping.shippingOption, - "the-id", - "selected option must 'the-id" - ); -}, "If requestShipping is set, and if there is a multiple selected shipping options, only the last is selected."); - -test(() => { - smokeTest(); - const selectedOption = Object.assign({}, defaultShippingOption, { - selected: true, - }); - const unselectedOption = Object.assign({}, defaultShippingOption, { - selected: false, - }); - const shippingOptions = [selectedOption, unselectedOption]; - const details = Object.assign({}, defaultDetails, { shippingOptions }); - const requestNoShipping = new PaymentRequest(defaultMethods, details); - assert_equals( - requestNoShipping.shippingOption, - null, - "shippingOption must be null, because requestShipping is false" - ); - assert_throws_js( - TypeError, - () => { - new PaymentRequest(defaultMethods, details, { requestShipping: true }); - }, - "Expected to throw a TypeError because duplicate IDs" - ); -}, "If there are any duplicate shipping option ids, and shipping is requested, then throw a TypeError"); - -test(() => { - smokeTest(); - const dupShipping1 = Object.assign({}, defaultShippingOption, { - selected: true, - id: "DUPLICATE", - label: "Fail 1", - }); - const dupShipping2 = Object.assign({}, defaultShippingOption, { - selected: false, - id: "DUPLICATE", - label: "Fail 2", - }); - const shippingOptions = [dupShipping1, defaultShippingOption, dupShipping2]; - const details = Object.assign({}, defaultDetails, { shippingOptions }); - const requestNoShipping = new PaymentRequest(defaultMethods, details); - assert_equals( - requestNoShipping.shippingOption, - null, - "shippingOption must be null, because requestShipping is false" - ); - assert_throws_js( - TypeError, - () => { - new PaymentRequest(defaultMethods, details, { requestShipping: true }); - }, - "Expected to throw a TypeError because duplicate IDs" - ); -}, "Throw when there are duplicate shippingOption ids, even if other values are different"); - // Process payment details modifiers: test(() => { smokeTest(); @@ -654,44 +474,4 @@ }); }, "Rethrow any exceptions of JSON-serializing modifier.data"); -//Setting ShippingType attribute during construction -test(() => { - smokeTest(); - assert_throws_js(TypeError, () => { - new PaymentRequest(defaultMethods, defaultDetails, { - shippingType: "invalid", - }); - }); -}, "Shipping type should be valid"); - -test(() => { - smokeTest(); - const request = new PaymentRequest(defaultMethods, defaultDetails, {}); - assert_equals(request.shippingAddress, null, "must be null"); -}, "PaymentRequest.shippingAddress must initially be null"); - -test(() => { - smokeTest(); - const request1 = new PaymentRequest(defaultMethods, defaultDetails, {}); - assert_equals(request1.shippingType, null, "must be null"); - const request2 = new PaymentRequest(defaultMethods, defaultDetails, { - requestShipping: false, - }); - assert_equals(request2.shippingType, null, "must be null"); -}, "If options.requestShipping is not set, then request.shippingType attribute is null."); - -test(() => { - smokeTest(); - // option.shippingType defaults to 'shipping' - const request1 = new PaymentRequest(defaultMethods, defaultDetails, { - requestShipping: true, - }); - assert_equals(request1.shippingType, "shipping", "must be shipping"); - const request2 = new PaymentRequest(defaultMethods, defaultDetails, { - requestShipping: true, - shippingType: "delivery", - }); - assert_equals(request2.shippingType, "delivery", "must be delivery"); -}, "If options.requestShipping is true, request.shippingType will be options.shippingType."); - diff --git a/payment-request/payment-request-ctor-currency-code-checks.https.sub.html b/payment-request/payment-request-ctor-currency-code-checks.https.sub.html index b4ca2a0c40b39b..c608608c7ebdea 100644 --- a/payment-request/payment-request-ctor-currency-code-checks.https.sub.html +++ b/payment-request/payment-request-ctor-currency-code-checks.https.sub.html @@ -178,63 +178,6 @@ } }, "Check and canonicalize invalid details.displayItems amount and rethrow RangeError."); -// Process shipping options: -test(() => { - assert_throws_js(RANGE_ERROR, smokeTest, "Expected smoke test to throw."); - const shippingOptions = []; - for (const validCurrency of wellFormedCurrencyCodes) { - const shippingOption = { - id: `test` + Math.random(), - label: "shipping option", - amount: { currency: validCurrency, value: "5.00" }, - selected: !shippingOptions.length, - }; - const details = { - total: defaultTotal, - shippingOptions: [shippingOption], - }; - try { - new PaymentRequest(defaultMethods, details, { requestShipping: true }); - } catch (err) { - assert_unreached( - `Unexpected exception with valid shippingOption currency code "${validCurrency}": ${err.message}.` - ); - } - shippingOptions.push(shippingOption); - } - try { - const details = Object.assign({}, defaultDetails, { shippingOptions }); - new PaymentRequest(defaultMethods, details, { requestShipping: true }); - } catch (err) { - assert_unreached( - `Unexpected error with multiple valid shppingOptions: ${err.message}.` - ); - } -}, "Check and canonicalize valid details.shippingOptions amount."); - -test(() => { - assert_throws_js(RANGE_ERROR, smokeTest, "Expected smoke test to throw."); - for (const invalidCurrency of invalidCurrencyCodes) { - const shippingOption = { - id: "test", - label: "shipping option", - amount: { currency: invalidCurrency, value: "5.00" }, - selected: true, - }; - const details = { - total: defaultTotal, - shippingOptions: [shippingOption], - }; - assert_throws_js( - RANGE_ERROR, - () => { - new PaymentRequest(defaultMethods, details, { requestShipping: true }); - }, - `Expected RangeError with invalid shippingOption currency code "${invalidCurrency}".` - ); - } -}, "Check and canonicalize invalid details.shippingOptions amount and rethrow RangeError."); - // Process payment details modifiers: test(() => { assert_throws_js(RANGE_ERROR, smokeTest, "Expected smoke test to throw."); diff --git a/payment-request/payment-request-onshippingaddresschange-attribute.https.html b/payment-request/payment-request-onshippingaddresschange-attribute.https.html deleted file mode 100644 index 5b2538992f76c7..00000000000000 --- a/payment-request/payment-request-onshippingaddresschange-attribute.https.html +++ /dev/null @@ -1,78 +0,0 @@ - - - -Test for onshippingaddresschange attribute - - - - diff --git a/payment-request/payment-request-onshippingoptionchange-attribute.https.html b/payment-request/payment-request-onshippingoptionchange-attribute.https.html deleted file mode 100644 index 43ea5dcce87afe..00000000000000 --- a/payment-request/payment-request-onshippingoptionchange-attribute.https.html +++ /dev/null @@ -1,79 +0,0 @@ - - - -Test for onshippingoptionchange attribute - - - - diff --git a/payment-request/payment-request-shippingAddress-attribute.https.html b/payment-request/payment-request-shippingAddress-attribute.https.html deleted file mode 100644 index 08918356b6fea3..00000000000000 --- a/payment-request/payment-request-shippingAddress-attribute.https.html +++ /dev/null @@ -1,28 +0,0 @@ - - - -Test for PaymentRequest shippingAddress attribute - - - - diff --git a/payment-request/payment-request-shippingOption-attribute.https.html b/payment-request/payment-request-shippingOption-attribute.https.html deleted file mode 100644 index b5f9ea65c6c8e0..00000000000000 --- a/payment-request/payment-request-shippingOption-attribute.https.html +++ /dev/null @@ -1,100 +0,0 @@ - - - -Test for PaymentRequest shippingOption attribute - - - - diff --git a/payment-request/payment-request-shippingType-attribute.https.html b/payment-request/payment-request-shippingType-attribute.https.html deleted file mode 100644 index 11f75b1c862224..00000000000000 --- a/payment-request/payment-request-shippingType-attribute.https.html +++ /dev/null @@ -1,72 +0,0 @@ - - - -Test for PaymentRequest's shippingType attribute - - - - diff --git a/payment-request/payment-response/helpers.js b/payment-request/payment-response/helpers.js index 3e4f5cfd36f898..1242ecb743c9a7 100644 --- a/payment-request/payment-response/helpers.js +++ b/payment-request/payment-response/helpers.js @@ -65,30 +65,8 @@ async function getPaymentRequestResponse(options, id) { label: "Total due", amount: { currency: "USD", value: "1.0" }, }, - shippingOptions: [ - { - id: "fail1", - label: "Fail option 1", - amount: { currency: "USD", value: "5.00" }, - selected: false, - }, - { - id: "pass", - label: "Pass option", - amount: { currency: "USD", value: "5.00" }, - selected: true, - }, - { - id: "fail2", - label: "Fail option 2", - amount: { currency: "USD", value: "5.00" }, - selected: false, - }, - ], }; const request = new PaymentRequest(methods, details, options); - request.onshippingaddresschange = ev => ev.updateWith(details); - request.onshippingoptionchange = ev => ev.updateWith(details); const response = await request.show(); return { request, response }; } @@ -128,23 +106,5 @@ async function runManualTest(button, options, expected = {}, id = undefined) { assert_equals(typeof response.details, "object", "Expected an object"); // Testing that this does not throw: response.toJSON(); - if (options && options.requestShipping) { - assert_equals( - response.shippingOption, - "pass", - "request.shippingOption must be 'pass'" - ); - } else { - assert_equals( - request.shippingOption, - null, - "If requestShipping is falsy, request.shippingOption must be null" - ); - assert_equals( - response.shippingOption, - null, - "request.shippingOption must be null" - ); - } }, button.textContent.trim()); } diff --git a/payment-request/payment-response/retry-method-manual.https.html b/payment-request/payment-response/retry-method-manual.https.html deleted file mode 100644 index a5aab49e387d32..00000000000000 --- a/payment-request/payment-response/retry-method-manual.https.html +++ /dev/null @@ -1,296 +0,0 @@ - - - - - PaymentResponse.prototype.retry() method - - - - - -

- Manual Tests for PaymentResponse.retry() - 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" multiple times. -

-
    -
  1. - -
  2. -
  3. - -
  4. -
  5. - -
  6. -
  7. - -
  8. -
  9. - -
  10. -
  11. -

    - When shown the payment sheet, hit pay once, then abort retrying the payment. -

    - -
  12. -
  13. -

    - When shown the payment sheet, hit pay once. Check payment sheet for error fields. - Then hit escape or otherwise abort the payment. -

    - -
  14. -
  15. -

    - When shown the payment sheet, hit pay once. - Then, change the shipping option. - Select to pay again. -

    - -
  16. -
  17. -

    - When shown the payment sheet, hit pay once. Then retry once. -

    - -
  18. -
  19. - -
  20. -
- - If you find a buggy test, please file a bug - and tag one of the owners. - diff --git a/payment-request/payment-response/retry-method-warnings-manual.https.html b/payment-request/payment-response/retry-method-warnings-manual.https.html deleted file mode 100644 index b68bf18309702c..00000000000000 --- a/payment-request/payment-response/retry-method-warnings-manual.https.html +++ /dev/null @@ -1,158 +0,0 @@ - -Warn when errorFields don't match request[[options]] - - - - - -

Manual Tests - Please run in order!

-

- Please open the developer console. Each of the tests below should generate a - warning in the developer console. -

-

When presented with the payment sheet, hit pay twice.

-
    -
  1. - -
  2. -
  3. - -
  4. -
  5. - -
  6. -
  7. - -
  8. -
  9. - -
  10. -
  11. - -
  12. -
  13. - -
  14. -
  15. - -
  16. -
  17. - -
  18. -
  19. - -
  20. -
  21. - -
  22. -
  23. - -
  24. -
  25. - -
  26. -
  27. - -
  28. -
  29. - -
  30. -
  31. -
diff --git a/payment-request/payment-response/shippingAddress-attribute-manual.https.html b/payment-request/payment-response/shippingAddress-attribute-manual.https.html deleted file mode 100644 index 92bac2bb5e5e27..00000000000000 --- a/payment-request/payment-response/shippingAddress-attribute-manual.https.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - PaymentResponse.prototype.shippingAddress - - - - - -

shippingAddress 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 enter "web platform test" as recipient, at address "1 wpt street" in "Kabul, Afghanistan", zip/postal code 1001. -

-
    -
  1. - -
  2. -
  3. - -
  4. -
  5. - -
  6. -
  7. - -
  8. -
- - If you find a buggy test, please file a bug - and tag one of the suggested reviewers. - diff --git a/payment-request/payment-response/shippingOption-attribute-manual.https.html b/payment-request/payment-response/shippingOption-attribute-manual.https.html deleted file mode 100644 index 687d3a52de9f6b..00000000000000 --- a/payment-request/payment-response/shippingOption-attribute-manual.https.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - PaymentResponse.prototype.complete() method - - - - -

shippingOption 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. -

-

- For the last test, please select the only available shipping option and select "Pay". -

-
    -
  1. - -
  2. -
  3. - -
  4. -
  5. - -
  6. -
  7. - -
  8. -
- - If you find a buggy test, please file a bug - and tag one of the suggested reviewers. - diff --git a/payment-request/shipping-address-changed-manual.https.html b/payment-request/shipping-address-changed-manual.https.html deleted file mode 100644 index 78b7f17ceeb984..00000000000000 --- a/payment-request/shipping-address-changed-manual.https.html +++ /dev/null @@ -1,99 +0,0 @@ - - - -Test for PaymentRequest shippingAddress attribute - - - - - - -

PaymentRequest shippingAddress 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 the payment sheet is presented, enter or select a shipping address. -

-
    -
  1. - -
  2. -
- - If you find a buggy test, please file a bug - and tag one of the suggested reviewers. - diff --git a/payment-request/show-method-optional-promise-rejects.https.html b/payment-request/show-method-optional-promise-rejects.https.html index 3b42965503922d..4a41f28fc9be16 100644 --- a/payment-request/show-method-optional-promise-rejects.https.html +++ b/payment-request/show-method-optional-promise-rejects.https.html @@ -84,10 +84,6 @@ total: invalidNegativeTotal, }); - // PaymentOptions - const validOptions = Object.freeze({ - requestShipping: true, - }); // PaymentItem const validPaymentItem = Object.freeze({ @@ -104,24 +100,6 @@ 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, @@ -166,8 +144,7 @@ promise_test(async (t) => { const request = new PaymentRequest( validMethods, - validDetails, - validOptions + validDetails ); await test_driver.bless("Payment request"); const detailsPromise = Promise.resolve(badDetails); @@ -216,21 +193,6 @@ RangeError ); - testBadUpdate( - "Updating with duplicate shippingOptions (same IDs) results in a TypeError.", - { - ...validDetails, - shippingOptions: [validShippingOption, validShippingOption], - }, - TypeError - ); - - testBadUpdate( - "Updating with a shippingOption with an invalid currency value results in a RangError.", - { ...validDetails, shippingOptions: invalidShippingOptions }, - RangeError - ); - testBadUpdate( "Must throw a RangeError when a modifier's total item has an invalid currency.", { ...validDetails, modifiers: [modifierWithInvalidTotal, validModifier] }, diff --git a/payment-request/show-method-optional-promise-resolves-manual.https.html b/payment-request/show-method-optional-promise-resolves-manual.https.html deleted file mode 100644 index 5360a9704af459..00000000000000 --- a/payment-request/show-method-optional-promise-resolves-manual.https.html +++ /dev/null @@ -1,339 +0,0 @@ - - -Test for PaymentRequest.show(optional promise) method - - - - -

- PaymentRequest .show(optional detailsPromise) tests -

-

- These test cause detailsPromise to resolve successfully with some updated value. As such, that will cause - something in the payment sheet to change. Each test describes what is expected to change - if anything. -

-

- Instructions: Click on each button in sequence from top to bottom without refreshing the page. The payment - sheet will be shown. If required, confirm that the expected value appears in the payment sheet. Finally, manually abort/cancel - the payment request by closing the payment sheet. -

-
    -
  1. -
  2. -
  3. -
  4. -
  5. -
  6. -
  7. -
  8. -
  9. -
  10. -
  11. -
  12. -
  13. -
  14. - -
  15. -
  16. - -
  17. -
  18. - -
  19. -
  20. - -
  21. -
- - - If you find a buggy test, please file a bug - and tag one of the suggested reviewers. - diff --git a/payment-request/updateWith-method-pmi-handling-manual.https.html b/payment-request/updateWith-method-pmi-handling-manual.https.html deleted file mode 100644 index 1a52978ca3e312..00000000000000 --- a/payment-request/updateWith-method-pmi-handling-manual.https.html +++ /dev/null @@ -1,140 +0,0 @@ - - -Test for validity of payment method identifiers when calling updateWith() method - - - - -

updateWith() method: test validity of payment method identifiers.

-

- When shown a payment sheet, select a different address. -

-
    -
  1. - -
  2. -
  3. - -
  4. -
  5. - -
  6. -
  7. - -
  8. -
  9. - -
  10. -
  11. - -
  12. -
  13. - -
  14. -
  15. - -
  16. -
  17. - -
  18. -
  19. - -
  20. -
- - If you find a buggy test, please file a bug - and tag one of the suggested reviewers. - diff --git a/payment-request/user-accepts-payment-request-algo-manual.https.html b/payment-request/user-accepts-payment-request-algo-manual.https.html deleted file mode 100644 index 02251375853a7d..00000000000000 --- a/payment-request/user-accepts-payment-request-algo-manual.https.html +++ /dev/null @@ -1,230 +0,0 @@ - - - - - User accepts the payment request algorithm - - - - - -
-

User accepts payment request

-

- 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 shown the payment sheet, please input a credit card and select Pay. -

-
    -
  1. - Use any credit card to pay. -
  2. -
  3. - Select any shipping option, and use any credit card to pay. -
  4. -
  5. - - When prompted, please use "wpt@w3.org" as the email. -
  6. -
  7. - - When prompted, please use "+12345678910" as the phone number. -
  8. -
  9. - - When prompted, please use "web platform test" as the payer name. -
  10. -
  11. - - When prompted, please use: "+12345678910" as the phone number, "web platform test" as the payer name, and "wpt@w3.org" as the email. Then press Pay. -
  12. -
  13. - -
  14. -
-
- - If you find a buggy test, please file a bug - and tag one of the suggested reviewers. -