Bug 1509034 [wpt PR 14163] - fix: make PMIs conform to spec, a=testonly
authorMarcos Cáceres <marcos@marcosc.com>
Tue, 05 Mar 2019 12:14:35 +0000
changeset 464545 3983aba2b0dfdb45a329a35961a726e45aafdf0c
parent 464544 9acf395a6242f447db603b86c78f32f722081cf9
child 464546 35d0e81b48a8edd80664f47a99cf23b9331e9ce5
push id35717
push useraciure@mozilla.com
push dateSun, 17 Mar 2019 09:45:26 +0000
treeherdermozilla-central@e0861be8d6c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1509034, 14163
milestone67.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 1509034 [wpt PR 14163] - fix: make PMIs conform to spec, a=testonly Automatic update from web-platform-tests fix: make PMIs conform to spec (#14163) -- wpt-commits: 94dd52b3f5a6e768d25a3cc459aeeb1e69fb9381 wpt-pr: 14163
testing/web-platform/tests/payment-method-basic-card/empty-data-manual.https.html
testing/web-platform/tests/payment-method-basic-card/payment-request-canmakepayment-method.https.html
--- a/testing/web-platform/tests/payment-method-basic-card/empty-data-manual.https.html
+++ b/testing/web-platform/tests/payment-method-basic-card/empty-data-manual.https.html
@@ -34,32 +34,32 @@ const visaCredit = {
   cardNumber: "4111111111111111",
   cardSecurityCode: "123",
   cardholderName: "web platform test",
   expiryMonth: "01",
   expiryYear: "2026",
 };
 
 async function getCardResponse(data) {
-  const method = Object.assign({ data }, methodCard);
-  const response = await new PaymentRequest([method], defaultDetails).show();
+  const payMethod = Object.assign({ data }, method);
+  const response = await new PaymentRequest([payMethod], details).show();
   await response.complete("success");
   return response.details;
 }
 
 /**
  * All tests expect the same return data, so we can just check the
  * same result over and over again.
  */
 function runPromiseTest(button, data, expectedCard = visaCredit, expectedAddress = defaultBillingAddress ) {
   button.disabled = true;
   promise_test(async () => {
     const card = await getCardResponse(data);
     for (const [member, expectedValue] of Object.entries(expectedCard)) {
-      const msg = `Expected card.${member} to equal ${expectedValue}.`;
+      const msg = `Expected "card.${member}" to equal "${expectedValue}".`;
       assert_equals(card[member], expectedValue, msg);
     }
     const { billingAddress } = card;
     for (const [member, expectedValue] of Object.entries(expectedAddress)) {
       const msg = `billingAddress.${member} to equal ${expectedValue}.`;
       assert_equals(billingAddress[member], expectedValue);
     }
   }, button.textContent.trim());
@@ -115,14 +115,19 @@ function runPromiseTest(button, data, ex
       When passed BasicCardRequest without members, allow the user to input a card on any network.
     </button>
   </li>
   <li>
     <button onclick="runPromiseTest(this, { supportedNetworks: [] });">
       Returns a card on any network, because zero length supportedNetworks.
     </button>
   </li>
+  <li>
+    <button onclick="done();">
+      Done!
+    </button>
+  </li>
 </ol>
 
 <small>
   If you find a buggy test, please <a href="https://github.com/web-platform-tests/wpt/issues">file a bug</a>
   and tag one of the <a href="https://github.com/web-platform-tests/wpt/blob/master/payment-request/META.yml">suggested reviewers</a>.
 </small>
--- a/testing/web-platform/tests/payment-method-basic-card/payment-request-canmakepayment-method.https.html
+++ b/testing/web-platform/tests/payment-method-basic-card/payment-request-canmakepayment-method.https.html
@@ -28,17 +28,17 @@ promise_test(async t => {
     await request.canMakePayment(),
     `canMakePaymentPromise should be false`
   );
 }, `Must return false when the PMI is not supported at by the user agent.`);
 
 function* pmiGenerator(howMany = 256) {
   for (i = 0; i < howMany; i++) {
     yield {
-      supportedMethods: `this-is-not-supported-${i}`,
+      supportedMethods: `this-is-not-supported`,
       data: { key: "value" },
     };
   }
 }
 
 promise_test(async t => {
   //Smoke test
   const canMakePaymentPromise = new PaymentRequest(