Bug 1484240 [wpt PR 12550] - PaymentRequest: Implement desktop UI for PaymentResponse.retry(), a=testonly
authorBlink WPT Bot <blink-w3c-test-autoroller@chromium.org>
Fri, 24 Aug 2018 12:51:02 +0000
changeset 433758 a066a82e40b8fdc71502a1bb33c2242c019263f1
parent 433757 be9f050272403d195f1a798de4837cafead6642f
child 433759 b17979968e272b9e46c009a8cdbba327f0885f0a
push id107175
push userwptsync@mozilla.com
push dateWed, 29 Aug 2018 12:04:37 +0000
treeherdermozilla-inbound@1d00bfc5c482 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1484240, 12550, 861704
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1484240 [wpt PR 12550] - PaymentRequest: Implement desktop UI for PaymentResponse.retry(), a=testonly Automatic update from web-platform-testsPaymentRequest: Implement desktop UI for PaymentResponse.retry() (#12550) Related spec change: https://github.com/w3c/payment-request/pull/721 Tests: components/payments/content/payment_request_spec_unittest.cc components/payments/content/payment_request_state_unittest.cc Manual tests: wpt/payment-request/payment-response/retry-method-manual.https.html wpt/payment-request/PaymentValidationErrors/retry-shows-shippingAddress-member-manual.https.html wpt/payment-request/PaymentValidationErrors/retry-shows-payer-member-manual.https.html Demo: https://youtu.be/_mbcGkbwfw8 Bug: 861704 Change-Id: I12c2d74f7b170626d2c9a41ecfc9116bfe75c2b7 -- wpt-commits: 4797b9cde63931bf7c49a74e2589a12dd619bec1 wpt-pr: 12550
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/payment-request/payment-response/retry-method-manual.https.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -618110,17 +618110,17 @@
    "60dd9655dd5bafcdb7768b929696cb9104214b29",
    "manual"
   ],
   "payment-request/payment-response/requestId-attribute-manual.https.html": [
    "ddb1e0d831dac65cd2f5dc64c7218a45b2e154a8",
    "manual"
   ],
   "payment-request/payment-response/retry-method-manual.https.html": [
-   "288a32b386d621551dd43a46240290d7de33a390",
+   "82821a9a39c6c9ce6def2c076e39aa08f00921cc",
    "manual"
   ],
   "payment-request/payment-response/shippingAddress-attribute-manual.https.html": [
    "92bac2bb5e5e270cedfb5b84bc8c8998df46265e",
    "manual"
   ],
   "payment-request/payment-response/shippingOption-attribute-manual.https.html": [
    "687d3a52de9f6bfdb10456147586008b18683eb2",
--- a/testing/web-platform/tests/payment-request/payment-response/retry-method-manual.https.html
+++ b/testing/web-platform/tests/payment-request/payment-response/retry-method-manual.https.html
@@ -126,53 +126,65 @@ function userCanAbortARetry(button) {
       t,
       "InvalidStateError",
       response.complete("success"),
       "After the user aborts, response [[complete]] is true, so complete() rejects with a InvalidStateError"
     );
   }, button.textContent.trim());
 }
 
+function userIsShownErrorsFields(button) {
+  button.disabled = true;
+  promise_test(async t => {
+    const { response, request } = await getPaymentRequestResponse({ requestShipping: true });
+    const retryPromise = response.retry({
+      shippingAddress: { city: "Invalid city", addressLine: "Invalid address line" },
+    });
+    await retryPromise;
+    await response.complete("success");
+  }, button.textContent.trim());
+}
+
 function abortTheUpdate(button) {
   button.disabled = true;
   promise_test(async t => {
-    const { response, request } = await getPaymentRequestResponse();
+    const { response, request } = await getPaymentRequestResponse({ requestShipping: true });
     // causes "abort the update" to run
     const shippingChangedPromise = new Promise(resolve => {
       request.onshippingoptionchange = () => {
         event.updateWith({ total: { amount: { currency: "USD", value: "INVALID" } }});
         resolve();
       };
     });
     const retryPromise = response.retry({});
     await shippingChangedPromise;
     await promise_rejects(
       t,
-      "TypeError",
+      new TypeError(),
       retryPromise,
       "retry() aborts with a TypeError, because totals' value is invalid"
     );
     await promise_rejects(
       t,
       "InvalidStateError",
       response.complete("success"),
       "After the user aborts, response [[complete]] is true, so complete() rejects with a InvalidStateError"
     );
   }, button.textContent.trim());
 }
 
 function callingRetryReturnsUniquePromise(button){
   button.disabled = true;
   promise_test(async t => {
-    const request = new PaymentRequest(defaultMethods, defaultDetails);
-    const retryPromise = request.retry();
+    const { response } = await getPaymentRequestResponse();
+    const retryPromise = response.retry({});
     const promises = new Set([
       retryPromise,
-      request.retry(),
-      request.retry(),
+      response.retry({}),
+      response.retry({}),
     ]);
     assert_equals(promises.size, 3, "Must have three unique objects");
     await retryPromise;
     await response.complete();
   }, button.textContent.trim());
 };