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 522163 be42c83c6e9797698bac9eb972158fde092dbc18
parent 522162 2eb522ceb6e1c842c8c5b2950d4a4ab2ef88268c
child 522164 5fb707e280c13e4f7e61d437c66dd59940078ac1
push id10871
push usercbrindusan@mozilla.com
push dateMon, 18 Mar 2019 15:49:32 +0000
treeherdermozilla-beta@018abdd16060 [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(