Bug 1408234 - mochitest for PaymentRequest cleanup after document closed. r=baku
authorEden Chuang <chenyu.chuang@gapp.nthu.edu.tw>
Mon, 13 Aug 2018 11:25:13 +0200
changeset 431382 19f9ed0f53b9
parent 431381 c7536967b2f9
child 431383 9a627240fa20
push id34440
push userapavel@mozilla.com
push dateTue, 14 Aug 2018 16:15:57 +0000
treeherdermozilla-central@48a45df79f32 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1408234
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 1408234 - mochitest for PaymentRequest cleanup after document closed. r=baku 1. add a set new mochitests to test cleanup function. By redirecting to another page. By redirecting to another page, when PaymentRequest.show() is called. By reloading By removing/closing the page. 2. remove unnecessary PaymentRequestService.cleanup() call in the test suite.
dom/payments/test/BasiccardChromeScript.js
dom/payments/test/CleanupChromeScript.js
dom/payments/test/ConstructorChromeScript.js
dom/payments/test/CurrencyAmountValidationChromeScript.js
dom/payments/test/GeneralChromeScript.js
dom/payments/test/PMIValidationChromeScript.js
dom/payments/test/RequestShippingChromeScript.js
dom/payments/test/ShippingOptionsChromeScript.js
dom/payments/test/ShowPaymentChromeScript.js
dom/payments/test/UpdateErrorsChromeScript.js
dom/payments/test/blank_page.html
dom/payments/test/browser_payment_in_different_tabs.js
dom/payments/test/head.js
dom/payments/test/mochitest.ini
dom/payments/test/simple_payment_request.html
dom/payments/test/test_cleanupPayment.html
dom/payments/test/test_currency_amount_validation.html
--- a/dom/payments/test/BasiccardChromeScript.js
+++ b/dom/payments/test/BasiccardChromeScript.js
@@ -192,12 +192,11 @@ addMessageListener("error-response-test"
     if (e.name != "NS_ERROR_FAILURE") {
       emitTestFail("ShowResponse init expected 'NS_ERROR_FAILURE', but got " + e.name + ".");
     }
   }
   sendAsyncMessage("error-response-complete");
 });
 
 addMessageListener("teardown", function() {
-  paymentSrv.cleanup();
   paymentSrv.setTestingUIService(null);
   sendAsyncMessage("teardown-complete");
 });
new file mode 100644
--- /dev/null
+++ b/dom/payments/test/CleanupChromeScript.js
@@ -0,0 +1,62 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+const { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+
+const paymentSrv = Cc["@mozilla.org/dom/payments/payment-request-service;1"].getService(Ci.nsIPaymentRequestService);
+
+function emitTestFail(message) {
+  sendAsyncMessage("test-fail", message);
+}
+function emitTestPass(message) {
+  sendAsyncMessage("test-pass", message);
+}
+
+addMessageListener("cleanup-check", function() {
+  const paymentEnum = paymentSrv.enumerate();
+  if (paymentEnum.hasMoreElements()) {
+    emitTestFail("Non-empty PaymentRequest queue in PaymentRequestService.");
+  } else {
+    emitTestPass("Got empty PaymentRequest queue in PaymentRequestService.");
+  }
+  sendAsyncMessage("cleanup-check-complete");
+});
+
+var setPaymentNums = 0;
+
+addMessageListener("payment-num-set", function() {
+  setPaymentNums = 0;
+  const paymentEnum = paymentSrv.enumerate();
+  while (paymentEnum.hasMoreElements()) {
+    setPaymentNums = setPaymentNums + 1;
+    paymentEnum.getNext();
+  }
+  sendAsyncMessage("payment-num-set-complete");
+});
+
+addMessageListener("payment-num-check", function(expectedNumPayments) {
+  const paymentEnum = paymentSrv.enumerate();
+  let numPayments = 0;
+  while (paymentEnum.hasMoreElements()) {
+    numPayments = numPayments + 1;
+    paymentEnum.getNext();
+  }
+  if (numPayments !== expectedNumPayments + setPaymentNums) {
+    emitTestFail("Expected '" + expectedNumPayments +
+                 "' PaymentRequests in PaymentRequestService" + ", but got '" +
+                 numPayments + "'.");
+  } else {
+    emitTestPass("Got expected '" + numPayments +
+                 "' PaymentRequests in PaymentRequestService.");
+  }
+  // force cleanup PaymentRequests for clear environment to next testcase.
+  paymentSrv.cleanup();
+  sendAsyncMessage("payment-num-check-complete");
+});
+
+addMessageListener("teardown", function() {
+  paymentSrv.setTestingUIService(null);
+  sendAsyncMessage('teardown-complete');
+});
--- a/dom/payments/test/ConstructorChromeScript.js
+++ b/dom/payments/test/ConstructorChromeScript.js
@@ -442,11 +442,10 @@ function checkCrossOriginTopLevelPrincip
 
 addMessageListener("check-simplest-request", checkSimplestRequestHandler);
 addMessageListener("check-complex-request", checkComplexRequestHandler);
 addMessageListener("check-multiple-requests", checkMultipleRequestsHandler);
 addMessageListener("check-nonbasiccard-request", checkNonBasicCardRequestHandler);
 addMessageListener("check-cross-origin-top-level-principal", checkCrossOriginTopLevelPrincipalHandler);
 
 addMessageListener("teardown", function() {
-  paymentSrv.cleanup();
   sendAsyncMessage("teardown-complete");
 });
--- a/dom/payments/test/CurrencyAmountValidationChromeScript.js
+++ b/dom/payments/test/CurrencyAmountValidationChromeScript.js
@@ -51,11 +51,10 @@ function checkLowerCaseCurrency() {
 
 addMessageListener("check-lower-case-currency", checkLowerCaseCurrency);
 
 addMessageListener("set-update-with-invalid-details-ui-service", function() {
   paymentSrv.setTestingUIService(InvalidDetailsUIService.QueryInterface(Ci.nsIPaymentUIService));
 });
 
 addMessageListener("teardown", function() {
-  paymentSrv.cleanup();
   sendAsyncMessage("teardown-complete");
 });
--- a/dom/payments/test/GeneralChromeScript.js
+++ b/dom/payments/test/GeneralChromeScript.js
@@ -3,12 +3,11 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 "use strict";
 
 const { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 const paymentSrv = Cc["@mozilla.org/dom/payments/payment-request-service;1"].getService(Ci.nsIPaymentRequestService);
 
 addMessageListener("teardown", function() {
-  paymentSrv.cleanup();
   paymentSrv.setTestingUIService(null);
   sendAsyncMessage('teardown-complete');
 });
--- a/dom/payments/test/PMIValidationChromeScript.js
+++ b/dom/payments/test/PMIValidationChromeScript.js
@@ -46,11 +46,10 @@ function emitTestFail(message) {
   sendAsyncMessage("test-fail", message);
 }
 
 addMessageListener("set-ui-service", function() {
   paymentSrv.setTestingUIService(UIService.QueryInterface(Ci.nsIPaymentUIService));
 });
 
 addMessageListener("teardown", function() {
-  paymentSrv.cleanup();
   sendAsyncMessage("teardown-complete");
 });
--- a/dom/payments/test/RequestShippingChromeScript.js
+++ b/dom/payments/test/RequestShippingChromeScript.js
@@ -74,12 +74,11 @@ const NormalUIService = {
   QueryInterface: ChromeUtils.generateQI([Ci.nsIPaymentUIService]),
 };
 
 addMessageListener("set-normal-ui-service", function() {
   paymentSrv.setTestingUIService(NormalUIService.QueryInterface(Ci.nsIPaymentUIService));
 });
 
 addMessageListener("teardown", function() {
-  paymentSrv.cleanup();
   paymentSrv.setTestingUIService(null);
   sendAsyncMessage('teardown-complete');
 });
--- a/dom/payments/test/ShippingOptionsChromeScript.js
+++ b/dom/payments/test/ShippingOptionsChromeScript.js
@@ -81,12 +81,11 @@ paymentSrv.setTestingUIService(TestingUI
 
 addMessageListener("set-expected-results", function(results) {
   expectedRequestOption = results.requestResult;
   expectedUpdatedOption = results.responseResult;
   changeShippingOption = results.changeOptionResult;
 });
 
 addMessageListener("teardown", function() {
-  paymentSrv.cleanup();
   paymentSrv.setTestingUIService(null);
   sendAsyncMessage('teardown-complete');
 });
--- a/dom/payments/test/ShowPaymentChromeScript.js
+++ b/dom/payments/test/ShowPaymentChromeScript.js
@@ -253,12 +253,11 @@ addMessageListener("set-complete-status-
   expectedCompleteStatus = "fail";
 });
 
 addMessageListener("set-complete-status-unknown", function() {
   expectedCompleteStatus = "unknown";
 });
 
 addMessageListener("teardown", function() {
-  paymentSrv.cleanup();
   paymentSrv.setTestingUIService(null);
   sendAsyncMessage('teardown-complete');
 });
--- a/dom/payments/test/UpdateErrorsChromeScript.js
+++ b/dom/payments/test/UpdateErrorsChromeScript.js
@@ -147,12 +147,11 @@ const DummyUIService = {
   completePayment: completeRequest,
   updatePayment: updateRequest,
   QueryInterface: ChromeUtils.generateQI([Ci.nsIPaymentUIService]),
 };
 
 paymentSrv.setTestingUIService(DummyUIService.QueryInterface(Ci.nsIPaymentUIService));
 
 addMessageListener("teardown", function() {
-  paymentSrv.cleanup();
   paymentSrv.setTestingUIService(null);
   sendAsyncMessage('teardown-complete');
 });
new file mode 100644
--- /dev/null
+++ b/dom/payments/test/blank_page.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>Payment Request Testing</title>
+    <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
+    <meta content="utf-8" http-equiv="encoding">
+  </head>
+  <body>
+    <h1>blank page.html</h1>
+    <script type="text/javascript">
+      if(window.parent) {
+        window.parent.postMessage("successful", '*');
+      }
+    </script>
+  </body>
+</html>
--- a/dom/payments/test/browser_payment_in_different_tabs.js
+++ b/dom/payments/test/browser_payment_in_different_tabs.js
@@ -1,15 +1,13 @@
 "use strict";
 
 // kTestRoot is from head.js
 const kTestPage = kTestRoot + "simple_payment_request.html";
 
-registerCleanupFunction(cleanup);
-
 add_task(async function() {
   Services.prefs.setBoolPref("dom.payments.request.enabled", true);
   await BrowserTestUtils.withNewTab(kTestPage,
     async function(browser) {
       await BrowserTestUtils.withNewTab(kTestPage,
         function(browser) {
           const paymentSrv = Cc["@mozilla.org/dom/payments/payment-request-service;1"].getService(Ci.nsIPaymentRequestService);
           ok(paymentSrv, "Fail to get PaymentRequestService.");
--- a/dom/payments/test/head.js
+++ b/dom/payments/test/head.js
@@ -52,15 +52,8 @@ function checkDupShippingOptionsPayment(
   // checking the passed PaymentOptions parameter
   const paymentOptions = aPayment.paymentOptions;
   ok(paymentOptions.requestPayerName, "payerName option should be true");
   ok(paymentOptions.requestPayerEmail, "payerEmail option should be true");
   ok(paymentOptions.requestPayerPhone, "payerPhone option should be true");
   ok(paymentOptions.requestShipping, "requestShipping option should be true");
   is(paymentOptions.shippingType, "shipping", "shippingType option should be 'shipping'");
 }
-
-function cleanup() {
-  const paymentSrv = Cc["@mozilla.org/dom/payments/payment-request-service;1"].getService(Ci.nsIPaymentRequestService);
-  if (paymentSrv) {
-    paymentSrv.cleanup();
-  }
-}
--- a/dom/payments/test/mochitest.ini
+++ b/dom/payments/test/mochitest.ini
@@ -1,16 +1,18 @@
 [DEFAULT]
 # skip-if !e10s will be removed once non-e10s is supported
 skip-if = !e10s || !nightly_build
 scheme = https
 support-files =
+  blank_page.html
   simple_payment_request.html
   echo_payment_request.html
   BasiccardChromeScript.js
+  CleanupChromeScript.js
   ConstructorChromeScript.js
   CurrencyAmountValidationChromeScript.js
   DefaultData.js
   GeneralChromeScript.js
   PMIValidationChromeScript.js
   RequestShippingChromeScript.js
   ShippingOptionsChromeScript.js
   ShowPaymentChromeScript.js
@@ -18,16 +20,17 @@ support-files =
 
 [test_abortPayment.html]
 run-if = nightly_build # Bug 1390018: Depends on the Nightly-only UI service
 [test_basiccard.html]
 [test_block_none10s.html]
 skip-if = e10s # Bug 1408250: Don't expose PaymentRequest Constructor in non-e10s
 [test_canMakePayment.html]
 run-if = nightly_build # Bug 1390737: Depends on the Nightly-only UI service
+[test_cleanupPayment.html]
 [test_constructor.html]
 [test_currency_amount_validation.html]
 skip-if = (verify && debug)
 [test_payment-request-in-iframe.html]
 [test_pmi_validation.html]
 skip-if = (verify && debug)
 [test_requestShipping.html]
 [test_shippingOptions.html]
--- a/dom/payments/test/simple_payment_request.html
+++ b/dom/payments/test/simple_payment_request.html
@@ -1,31 +1,43 @@
 <!DOCTYPE html>
 <html>
   <head>
     <title>Payment Request Testing</title>
     <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
     <meta content="utf-8" http-equiv="encoding">
   </head>
   <body>
+    <h1>simple payment request.html</h1>
     <script type="text/javascript">
 
     const supportedInstruments = [{
       supportedMethods: "basic-card",
     }];
     const details = {
       id: "simple details",
       total: {
         label: "Donation",
         amount: { currency: "USD", value: "55.00" }
       },
     };
 
     try {
       const payRequest = new PaymentRequest(supportedInstruments, details);
+      window.onmessage = async (e) => {
+        if (e.data === "show PaymentRequest") {
+          if (payRequest) {
+            payRequest.show();
+            window.parent.postMessage("successful", '*');
+          } else {
+            window.parent.postMessage("PaymentRequest does not exist", "*");
+          }
+        }
+      }
+
       if(window.parent) {
         window.parent.postMessage("successful", '*');
       }
     } catch(err) {
       if(window.parent) {
         window.parent.postMessage(err.name, '*');
       }
     }
new file mode 100644
--- /dev/null
+++ b/dom/payments/test/test_cleanupPayment.html
@@ -0,0 +1,191 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1408234
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test for Bug 1408234</title>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript">
+
+  "use strict";
+  SimpleTest.waitForExplicitFinish();
+
+  var gUrl = SimpleTest.getTestFileURL('CleanupChromeScript.js');
+  var gScript = SpecialPowers.loadChromeScript(gUrl);
+  var testName = "";
+
+  function testFailHandler(message) {
+    ok(false, testName + ": " + message);
+  }
+  function testPassHandler(message) {
+    ok(true, testName + ": " + message);
+  }
+  gScript.addMessageListener("test-fail", testFailHandler);
+  gScript.addMessageListener("test-pass", testPassHandler);
+  
+  function cleanupCheck(resolveFunc) {
+    gScript.addMessageListener("cleanup-check-complete", function checkCompleteHandler() {
+      gScript.removeMessageListener("cleanup-check-complete", checkCompleteHandler);
+      resolveFunc();
+    });
+    gScript.sendAsyncMessage("cleanup-check");
+  }
+
+  function paymentNumCheck(resolveFunc, numPayments) {
+    gScript.addMessageListener("payment-num-check-complete", function checkCompleteHandler() {
+      gScript.removeMessageListener("payment-num-check-complete", checkCompleteHandler);
+      resolveFunc();
+    });
+    gScript.sendAsyncMessage("payment-num-check", numPayments);
+  }
+
+  function paymentNumSet() {
+    gScript.addMessageListener("payment-num-set-complete", function setCompleteHandler() {
+      gScript.removeMessageListener("payment-num-set-complete", setCompleteHandler);
+    });
+    gScript.sendAsyncMessage("payment-num-set");
+  }
+
+  function testCleanupByReloading() {
+    paymentNumSet();
+    return new Promise((resolve, reject) => {
+      testName = "testCleanupByReloading";
+      let expectedResults = ["successful", "successful"];
+      let nextStatus = ["creating", "reloading"];
+      let currStatus = nextStatus.shift();
+      let ifr = document.createElement('iframe');
+      
+      let listener = function(event) {
+        let expected = expectedResults.shift();
+        is(event.data, expected,
+          testName + ": Expected '" + expected + "' when " + currStatus +
+          ", but got '" + event.data + "'");
+        if (currStatus === "creating") {
+          ifr.contentWindow.location.reload();
+        } else if (currStatus === "reloading") {
+          window.removeEventListener("message", listener);
+          paymentNumCheck(resolve, 1);
+          document.body.removeChild(ifr);
+        }
+        currStatus = nextStatus.shift();
+      }
+      window.addEventListener("message", listener);
+      ifr.src = "simple_payment_request.html";
+      document.body.appendChild(ifr);
+    });
+  }
+
+  function testCleanupByRedirecting() {
+    return new Promise((resolve, reject) => {
+      testName = "testCleanupByRedirecting";
+      let expectedResults = ["successful", "successful"];
+      let nextStatus = ["creating", "redirecting"];
+      let currStatus = nextStatus.shift();
+      let ifr = document.createElement('iframe');
+      let listener = function(event) {
+        let expected = expectedResults.shift();
+        is(event.data, expected,
+          testName + ": Expected '" + expected + "' when " + currStatus +
+          ", but got '" + event.data + "'");
+        if (currStatus === "creating") {
+          ifr.src = "blank_page.html";
+        } else if (currStatus === "redirecting"){
+          window.removeEventListener("message", listener);
+          cleanupCheck(resolve);
+          document.body.removeChild(ifr);
+        }
+        currStatus = nextStatus.shift();
+      };
+      window.addEventListener("message", listener);
+      ifr.src = "simple_payment_request.html";
+      document.body.appendChild(ifr);
+    });
+  }
+
+  function testCleanupByRedirectingAfterShow() {
+    return new Promise((resolve, reject) => {
+      testName = "testCleanupByRedirectingAfterShow";
+      let nextStatus = ["creating", "showing", "redirecting"];
+      let currStatus = nextStatus.shift();
+      let expectedResults = ["successful", "successful", "successful"];
+      let ifr = document.createElement('iframe');
+      let listener = (event) => {
+        let expected = expectedResults.shift();
+        is(event.data, expected,
+          testName + ": Expected '" + expected + "' when " + currStatus +
+          ", but got '" + event.data + "'");
+
+        if (currStatus === "creating") {
+          ifr.contentWindow.postMessage("show PaymentRequest", "*");
+        } else if (currStatus === "showing") {
+          ifr.src = "blank_page.html";
+        } else if (currStatus === "redirecting") {
+          window.removeEventListener("message", listener);
+          cleanupCheck(resolve);
+          document.body.removeChild(ifr);
+        }
+        currStatus = nextStatus.shift();
+      }
+      window.addEventListener("message", listener);
+      ifr.src = "simple_payment_request.html";
+      document.body.appendChild(ifr);
+    });
+  }
+
+  function testCleanupByRemovingIframe() {
+    return new Promise((resolve, reject) => {
+      testName = "testCleanupByRemovingIframe";
+      let expectedResults = ["successful"];
+      let nextStatus = ["creating"];
+      let currStatus = nextStatus.shift();
+      let ifr = document.createElement('iframe');
+      let listener = function(event) {
+        let expected = expectedResults.shift();
+        is(event.data, expected,
+          testName + ": Expected '" + expected + "' when " + currStatus +
+          ", but got '" + event.data + "'");
+        document.body.removeChild(ifr);
+        window.removeEventListener("message", listener);
+        cleanupCheck(resolve);
+      };
+      window.addEventListener("message", listener);
+      ifr.src = "simple_payment_request.html";
+      document.body.appendChild(ifr);
+    });
+  }
+
+  function teardown() {
+    gScript.removeMessageListener("test-fail", testFailHandler);
+    gScript.removeMessageListener("test-pass", testPassHandler);
+    gScript.destroy();
+    SimpleTest.finish();
+  }
+
+  function runTests() {
+    testCleanupByReloading()
+    .then(testCleanupByRedirecting)
+    .then(testCleanupByRedirectingAfterShow)
+    .then(testCleanupByRemovingIframe)
+    .then(teardown)
+    .catch( e => {
+      ok(false, "Unexpected error: " + e.name);
+      SimpleTest.finish();
+    });
+  }
+
+  window.addEventListener('load', function() {
+    SpecialPowers.pushPrefEnv({
+      'set': [
+        ['dom.payments.request.enabled', true],
+      ]
+    }, runTests);
+  });
+  </script>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1408234">Mozilla Bug 1408234</a>
+</body>
+</html>
--- a/dom/payments/test/test_currency_amount_validation.html
+++ b/dom/payments/test/test_currency_amount_validation.html
@@ -133,30 +133,28 @@ https://bugzilla.mozilla.org/show_bug.cg
 
   function updateWithInvalidAmount() {
     return new Promise((resolve, reject) => {
       resolve(updatedInvalidAmountDetails);
     });
   }
 
   function testWithLowerCaseCurrency() {
-    info("testWithLowerCaseCurrency");
     return new Promise((resolve, reject) => {
       const payRequest = new PaymentRequest(defaultMethods, defaultDetails);
       ok(payRequest, "PaymentRequest should be created");
       gScript.addMessageListener("check-complete", function checkCompleteHandler() {
         gScript.removeMessageListener("check-complete", checkCompleteHandler);
         resolve();
       });
       gScript.sendAsyncMessage("check-lower-case-currency");
     });
   }
 
   function testWithWellFormedCurrencyCodes() {
-    info("testWithWellFormedCurrencyCodes");
     return new Promise((resolve, reject) => {
       for (const currency of wellFormedCurrencyCodes) {
         let details = {
           total: {
             label: "Well Formed Currency",
             amount: {
               currency: currency,
               value: "1.00",
@@ -170,17 +168,16 @@ https://bugzilla.mozilla.org/show_bug.cg
                     + currency + ") " + e.name + ".");
         }
       }
       resolve();
     });
   }
 
   function testWithInvalidCurrencyCodes() {
-    info("testWithInvalidCurrencyCodes");
     return new Promise((resolve, reject) => {
       for (const invalidCurrency of invalidCurrencyCodes) {
         let invalidDetails = {
           total: {
             label: "Invalid Currency",
             amount: {
               currency: invalidCurrency,
               value: "1.00",
@@ -196,17 +193,16 @@ https://bugzilla.mozilla.org/show_bug.cg
       }
       resolve();
     });
   }
 
   function testUpdateWithInvalidCurrency() {
     const handler = SpecialPowers.getDOMWindowUtils(window).setHandlingUserInput(true);
 
-    info("testUpdateWithInvalidCurrency");
     gScript.sendAsyncMessage("set-update-with-invalid-details-ui-service");
     return new Promise((resolve, reject) => {
       const payRequest = new PaymentRequest(defaultMethods, defaultDetails);
       payRequest.addEventListener("shippingaddresschange", event => {
         event.updateWith(updateWithInvalidCurrency());
       });
       payRequest.addEventListener("shippingoptionchange", event => {
         event.updateWith(updateWithInvalidCurrency());
@@ -222,17 +218,16 @@ https://bugzilla.mozilla.org/show_bug.cg
         resolve();
       }).finally(handler.destruct);
     });
   }
 
   function testUpdateWithInvalidAmount() {
     const handler = SpecialPowers.getDOMWindowUtils(window).setHandlingUserInput(true);
 
-    info("testUpdateWithInvalidAmount");
     gScript.sendAsyncMessage("set-update-with-invalid-details-ui-service");
     return new Promise((resolve, reject) => {
       const payRequest = new PaymentRequest(defaultMethods, defaultDetails);
       payRequest.addEventListener("shippingaddresschange", event => {
         event.updateWith(updateWithInvalidAmount());
       });
       payRequest.addEventListener("shippingoptionchange", event => {
         event.updateWith(updateWithInvalidAmount());
@@ -246,32 +241,30 @@ https://bugzilla.mozilla.org/show_bug.cg
       }).catch(e => {
         ok(false, "Unexpected error: " + e.name);
         resolve();
       }).finally(handler.destruct);
     });
   }
 
   function testSpecialAmount() {
-    info("testSpecailAmount");
     return new Promise((resolve, reject) => {
       try {
         new PaymentRequest([{supportedMethods: "basic-card"}],
                            specialAmountDetails);
         ok(false, "Should throw '42', but got resolved.");
         resolve();
       } catch (e) {
         is(e, "42", "Expected throw '42'. but got " + e);
         resolve();
       }
     });
   }
 
   function testInvalidTotalAmounts() {
-    info("testInvalidTotalAmounts");
     return new Promise((resolve, reject) => {
       for (const amount of invalidTotalAmounts) {
         try {
           new PaymentRequest(
             [
               {
                 supportedMethods: "basic-card",
               },
@@ -295,17 +288,16 @@ https://bugzilla.mozilla.org/show_bug.cg
             "Expected 'TypeError', but got '" + err.name + "'");
           resolve();
         };
       }
     });
   }
 
   function testInvalidAmounts() {
-     info("testInvalidAmounts");
      return new Promise((resolve, reject) => {
       for (const amount of invalidAmounts) {
         try {
           new PaymentRequest(
             [
               {
                 supportedMethods: "basic-card",
               },