Bug 1499096 - Use ok() with 2 arguments instead of 3 when possible;r=Standard8
authorJulian Descottes <jdescottes@mozilla.com>
Tue, 23 Oct 2018 07:13:35 +0000
changeset 490876 dfaaf3978e3c7f1c98fd20270a0e50e4a6ddd733
parent 490875 a82f6a836cf384325aef49402fd4473a744648aa
child 490877 2e4bdafb70ce4febc9fb071ad1743cc0b49096de
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersStandard8
bugs1499096
milestone65.0a1
Bug 1499096 - Use ok() with 2 arguments instead of 3 when possible;r=Standard8 Depends on D8740. This changeset replaces calls to ok with 3 arguments to calls with 2 arguments in situations where the switch does not have a significant impact on the assert. Differential Revision: https://phabricator.services.mozilla.com/D8741
browser/base/content/test/sanitize/browser_purgehistory_clears_sh.js
browser/components/payments/test/browser/browser_card_edit.js
browser/components/payments/test/mochitest/test_shipping_option_picker.html
caps/tests/mochitest/test_bug470804.html
devtools/client/webide/test/device_front_shared.js
docshell/test/chrome/bug113934_window.xul
dom/base/test/chrome/test_bug339494.xul
dom/base/test/test_bug339494.html
dom/base/test/test_bug339494.xhtml
dom/base/test/test_bug352728.html
dom/base/test/test_bug545644.html
dom/base/test/test_bug545644.xhtml
dom/events/test/test_bug635465.html
dom/html/test/forms/test_input_file_picker.html
dom/html/test/test_bug277724.html
dom/html/test/test_bug359657.html
dom/manifest/test/test_ManifestProcessor_name_and_short_name.html
dom/tests/mochitest/script/test_whitespace.html
gfx/layers/apz/test/mochitest/test_frame_reconstruction.html
layout/generic/test/test_bug469774.xul
layout/style/test/test_bug1292447.html
toolkit/components/normandy/test/browser/browser_LogManager.js
toolkit/content/tests/widgets/test_videocontrols.html
toolkit/content/tests/widgets/xbl/test_videocontrols.html
--- a/browser/base/content/test/sanitize/browser_purgehistory_clears_sh.js
+++ b/browser/base/content/test/sanitize/browser_purgehistory_clears_sh.js
@@ -23,20 +23,18 @@ add_task(async function purgeHistoryTest
       content.history.pushState({}, "");
       content.history.pushState({}, "");
       content.history.back();
       let newHistory = content.history.length;
       Assert.equal(startHistory, 1, "Initial SHistory size");
       Assert.equal(newHistory, 3, "New SHistory size");
     });
 
-    ok(browser.webNavigation.canGoBack, true,
-       "New value for webNavigation.canGoBack");
-    ok(browser.webNavigation.canGoForward, true,
-       "New value for webNavigation.canGoForward");
+    ok(browser.webNavigation.canGoBack, "New value for webNavigation.canGoBack");
+    ok(browser.webNavigation.canGoForward, "New value for webNavigation.canGoForward");
     ok(!backButton.hasAttribute("disabled"), "Back button was enabled");
     ok(!forwardButton.hasAttribute("disabled"), "Forward button was enabled");
 
     await Sanitizer.sanitize(["history"]);
 
     await ContentTask.spawn(browser, null, async function() {
       Assert.equal(content.history.length, 1, "SHistory correctly cleared");
     });
--- a/browser/components/payments/test/browser/browser_card_edit.js
+++ b/browser/components/payments/test/browser/browser_card_edit.js
@@ -72,17 +72,17 @@ async function add_link(aOptions = {}) {
     await spawnPaymentDialogTask(frame, async function checkBillingAddressPicker(testArgs = {}) {
       let billingAddressSelect = content.document.querySelector("#billingAddressGUID");
       ok(content.isVisible(billingAddressSelect),
          "The billing address selector should always be visible");
       is(billingAddressSelect.childElementCount, 2,
          "Only 2 child options should exist by default");
       is(billingAddressSelect.children[0].value, "",
          "The first option should be the blank/empty option");
-      ok(billingAddressSelect.children[1].value, "",
+      ok(billingAddressSelect.children[1].value,
          "The 2nd option is the prefilled address and should be truthy");
     }, aOptions);
 
     let addressOptions = Object.assign({}, aOptions, {
       addLinkSelector: ".billingAddressRow .add-link",
       checkboxSelector: "#address-page .persist-checkbox",
       initialPageId: "basic-card-page",
       expectPersist: aOptions.expectDefaultAddressPersist,
--- a/browser/components/payments/test/mochitest/test_shipping_option_picker.html
+++ b/browser/components/payments/test/mochitest/test_shipping_option_picker.html
@@ -32,18 +32,18 @@ import "../../res/containers/shipping-op
 let picker1 = document.getElementById("picker1");
 
 add_task(async function test_empty() {
   ok(picker1, "Check picker1 exists");
   let state = picker1.requestStore.getState();
   let {shippingOptions} = state && state.request && state.request.paymentDetails;
   is(Object.keys(shippingOptions).length, 0, "Check empty initial state");
   is(picker1.dropdown.popupBox.children.length, 0, "Check dropdown is empty");
-  ok(picker1.editLink.hidden, true, "Check that picker edit link is always hidden");
-  ok(picker1.addLink.hidden, true, "Check that picker add link is always hidden");
+  ok(picker1.editLink.hidden, "Check that picker edit link is always hidden");
+  ok(picker1.addLink.hidden, "Check that picker add link is always hidden");
 });
 
 add_task(async function test_initialSet() {
   picker1.requestStore.setState({
     request: {
       paymentDetails: {
         shippingOptions: [
           {
--- a/caps/tests/mochitest/test_bug470804.html
+++ b/caps/tests/mochitest/test_bug470804.html
@@ -29,13 +29,13 @@ isnot(principal, null, "Should have a no
 is(secMan.isSystemPrincipal(principal), false,
    "Shouldn't have system principal here");
 try {
   secMan.checkLoadURIWithPrincipal(principal, null,
                                    nsIScriptSecurityManager.STANDARD);
 } catch (e) {
   // throwing is fine, it's just crashing that's bad
 }
-ok(true, "Survival", "We should get here without crashing");
+ok(true, "Survival: we should get here without crashing");
 </script>
 </pre>
 </body>
 </html>
--- a/devtools/client/webide/test/device_front_shared.js
+++ b/devtools/client/webide/test/device_front_shared.js
@@ -136,17 +136,17 @@ var resetExistingField = async function(
   const existing = doc.getElementById(id);
   existing.click();
   is(existing.checked, true, "Existing boolean value is correct");
   resetBtn = doc.getElementById("btn-" + id);
   resetBtn.click();
 
   await iframe.contentWindow.configView._defaultField;
 
-  ok(resetBtn.classList.contains("hide"), true, "Reset button hidden");
+  ok(resetBtn.classList.contains("hide"), "Reset button hidden");
   is(existing.checked, true, "Existing field reset");
 };
 
 var resetNewField = async function(id) {
   const custom = doc.getElementById(id);
   custom.click();
   is(custom.value, "test", "New string value is correct");
   resetBtn = doc.getElementById("btn-" + id);
--- a/docshell/test/chrome/bug113934_window.xul
+++ b/docshell/test/chrome/bug113934_window.xul
@@ -5,17 +5,17 @@
 
   <hbox>
     <vbox id="box1">
     </vbox>
     <vbox id="box2">
     </vbox>
     <spacer flex="1"/>
   </hbox>
-  
+
   <!-- test code goes here -->
   <script type="application/javascript"><![CDATA[
     var imports = [ "SimpleTest", "is", "isnot", "ok", "snapshotWindow",
                     "compareSnapshots", "onerror" ];
     for (var name of imports) {
       window[name] = window.opener.wrappedJSObject[name];
     }
 
@@ -114,17 +114,17 @@
 
             l1.detach();
             l2.detach();
             l3.detach();
             l4.detach();
 
             var s1_new = snapshotWindow($("f1").contentWindow);
             var [same, first, second] = compareSnapshots(s1_new, s2, true);
-            ok(same, "Should reflow on swap", "Expected " + second + " but got " + first);
+            ok(same, "Should reflow on swap. Expected " + second + " but got " + first);
 
             is(strs["f1"], "f1.pagehide f1.pageshow");
             is(strs["f3"], "f3.pagehide f3.pageshow");
             this._afterFirst = true;
             return;
           }
           if (aEvent.type == "DOMLinkAdded") {
             is(this._addedDispatched, false);
--- a/dom/base/test/chrome/test_bug339494.xul
+++ b/dom/base/test/chrome/test_bug339494.xul
@@ -3,17 +3,17 @@
 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=339494
 -->
 <window title="Mozilla Bug 339494"
   xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
   xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>      
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
 <body  xmlns="http://www.w3.org/1999/xhtml">
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=339494">Mozilla Bug 339494</a>
 <p id="display"></p>
 <div id="content" style="display: none">
   <xul:hbox id="d"/>
   <xul:hbox id="s"/>
 </div>
@@ -21,44 +21,42 @@ https://bugzilla.mozilla.org/show_bug.cg
 </pre>
 </body>
 
 <script class="testbody" type="application/javascript">
 
 /** Test for Bug 339494 **/
 
   var d = document.getElementById("d");
-  
+
   d.setAttribute("hhh", "testvalue");
 
   document.addEventListener("DOMAttrModified", removeItAgain, false);
   d.removeAttribute("hhh");
   document.removeEventListener("DOMAttrModified", removeItAgain, false);
 
   function removeItAgain()
   {
-    ok(!d.hasAttribute("hhh"), "Value check 1",
-       "There should be no value");
+    ok(!d.hasAttribute("hhh"), "Value check 1. There should be no value");
     isnot(d.getAttribute("hhh"), "testvalue", "Value check 2");
     document.removeEventListener("DOMAttrModified", removeItAgain, false);
     d.removeAttribute("hhh");
-    ok(true, "Reachability", "We shouldn't have crashed");
+    ok(true, "Reachability. We shouldn't have crashed");
   }
-  
+
   var s = document.getElementById("s");
-  
+
   s.setAttribute("ggg", "testvalue");
 
   document.addEventListener("DOMAttrModified", compareVal, false);
   s.setAttribute("ggg", "othervalue");
   document.removeEventListener("DOMAttrModified", compareVal, false);
 
   function compareVal()
   {
-    ok(s.hasAttribute("ggg"), "Value check 3",
-       "There should be a value");
+    ok(s.hasAttribute("ggg"), "Value check 3. There should be a value");
     isnot(s.getAttribute("ggg"), "testvalue", "Value check 4");
     is(s.getAttribute("ggg"), "othervalue", "Value check 5");
   }
 
 </script>
 
 </window>
--- a/dom/base/test/test_bug339494.html
+++ b/dom/base/test/test_bug339494.html
@@ -1,60 +1,58 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=339494
 -->
 <head>
   <title>Test for Bug 339494</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=339494">Mozilla Bug 339494</a>
 <p id="display"></p>
 <div id="content" style="display: none">
   <div id="d"></div>
   <div id="s"></div>
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
   /** Test for Bug 339494 **/
 
   var d = document.getElementById("d");
-  
+
   d.setAttribute("hhh", "testvalue");
 
   document.addEventListener("DOMAttrModified", removeItAgain);
   d.removeAttribute("hhh");
   document.removeEventListener("DOMAttrModified", removeItAgain);
 
   function removeItAgain()
   {
-    ok(!d.hasAttribute("hhh"), "Value check 1",
-       "There should be no value");
+    ok(!d.hasAttribute("hhh"), "Value check 1, there should be no value");
     isnot(d.getAttribute("hhh"), "testvalue", "Value check 2");
     document.removeEventListener("DOMAttrModified", removeItAgain);
     d.removeAttribute("hhh");
-    ok(true, "Reachability", "We shouldn't have crashed");
+    ok(true, "Reachability, we shouldn't have crashed");
   }
-  
+
   var s = document.getElementById("s");
-  
+
   s.setAttribute("ggg", "testvalue");
 
   document.addEventListener("DOMAttrModified", compareVal);
   s.setAttribute("ggg", "othervalue");
   document.removeEventListener("DOMAttrModified", compareVal);
 
   function compareVal()
   {
-    ok(s.hasAttribute("ggg"), "Value check 3",
-       "There should be a value");
+    ok(s.hasAttribute("ggg"), "Value check 3, there should be a value");
     isnot(s.getAttribute("ggg"), "testvalue", "Value check 4");
     is(s.getAttribute("ggg"), "othervalue", "Value check 5");
   }
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/base/test/test_bug339494.xhtml
+++ b/dom/base/test/test_bug339494.xhtml
@@ -1,59 +1,57 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=339494
 -->
 <head>
   <title>Test for Bug 339494</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=339494">Mozilla Bug 339494</a>
 <p id="display"></p>
 <div id="content" style="display: none">
   <div id="d" />
   <div id="s" />
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 /** Test for Bug 339494 **/
 
   var d = document.getElementById("d");
-  
+
   d.setAttribute("hhh", "testvalue");
 
   document.addEventListener("DOMAttrModified", removeItAgain, false);
   d.removeAttribute("hhh");
   document.removeEventListener("DOMAttrModified", removeItAgain, false);
 
   function removeItAgain()
   {
-    ok(!d.hasAttribute("hhh"), "Value check 1",
-       "There should be no value");
+    ok(!d.hasAttribute("hhh"), "Value check 1, there should be no value");
     isnot(d.getAttribute("hhh"), "testvalue", "Value check 2");
     document.removeEventListener("DOMAttrModified", removeItAgain, false);
     d.removeAttribute("hhh");
-    ok(true, "Reachability", "We shouldn't have crashed");
+    ok(true, "Reachability, We shouldn't have crashed");
   }
-  
+
   var s = document.getElementById("s");
-  
+
   s.setAttribute("ggg", "testvalue");
 
   document.addEventListener("DOMAttrModified", compareVal, false);
   s.setAttribute("ggg", "othervalue");
   document.removeEventListener("DOMAttrModified", compareVal, false);
 
   function compareVal()
   {
-    ok(s.hasAttribute("ggg"), "Value check 3",
-       "There should be a value");
+    ok(s.hasAttribute("ggg"), "Value check 3, there should be a value");
     isnot(s.getAttribute("ggg"), "testvalue", "Value check 4");
     is(s.getAttribute("ggg"), "othervalue", "Value check 5");
   }
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/base/test/test_bug352728.html
+++ b/dom/base/test/test_bug352728.html
@@ -1,33 +1,33 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=352728
 -->
 <head>
   <title>Test for Bug 352728</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=352728">Mozilla Bug 352728</a>
 <p id="display"></p>
 <div id="content" style="display: none">
-  
+
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 /** Test for Bug 352728 **/
 
 function checkTypes(aNode, aNodeType, aTypeArray)
 {
   for (var i = 0; i < aTypeArray.length; ++i) {
-    ok(aNode instanceof aTypeArray[i], aNodeType + " type test " + i,
-       aNodeType + " should be a " + aTypeArray[i]);
+    ok(aNode instanceof aTypeArray[i],
+       `${aNodeType} type test ${i}: ${aNodeType} should be a ${aTypeArray[i]}`);
   }
 }
 
 function testCharacterData(aNode, aText)
 {
   is(aNode.length, aText.length, "Text length should match");
   is(aNode.data, aText, "Text content should match");
   is(aNode.nodeValue, aText, "Check nodeValue");
@@ -70,17 +70,17 @@ function testPI(aTarget, aData, aShouldS
     checkTypes(pi, "processing instruction", types);
 
     is(pi.target, aTarget, "Check target");
     is(pi.data, aData, "Check data");
     is(pi.nodeName, aTarget, "Check nodeName");
     is(pi.nodeValue, aData, "Check nodeValue");
     is(pi.localName, undefined, "Check localName")
     is(pi.namespaceURI, undefined, "Check namespaceURI");
-    
+
     is(pi.nodeType, Node.PROCESSING_INSTRUCTION_NODE, "Check nodeType");
 
     if (!aShouldSucceed) {
       ok(false, "Invalid processing instruction creation", aReason);
     }
   } catch (e) {
     if (aShouldSucceed) {
       ok(false, "Correct functioning of processing instruction stuff",
--- a/dom/base/test/test_bug545644.html
+++ b/dom/base/test/test_bug545644.html
@@ -11,23 +11,23 @@
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=545644">Mozilla Bug </a>
 <p id="display"></p>
 
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 function testInner () {
   var div = document.getElementById("test_inner");
-			
+
     try {
       div.innerHTML = "some \u00A0 &nbsp; text";
       div.innerHTML += "!";
-      ok (true, "innerHTML in html", "test ok");
+      ok(true, "innerHTML in html test ok");
     } catch (e) {
-      ok(false, "innerHTML in html", "test failed, unwanted exception "+e);
+      ok(false, "innerHTML in html test failed, unwanted exception " + e);
     }
 
   SimpleTest.finish();
 }
 
 
 SimpleTest.waitForExplicitFinish();
 
--- a/dom/base/test/test_bug545644.xhtml
+++ b/dom/base/test/test_bug545644.xhtml
@@ -14,27 +14,27 @@
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 function testInner () {
   var div = document.getElementById("test_inner");
 
     try {
       div.innerHTML = "some \u00A0 &amp;nbsp; text";
-      ok(false, "innerHTML in xhtml", "test failed, no exception by the parser when giving an unexpected entity"+e);
+      ok(false, "innerHTML in xhtml test failed, no exception by the parser when giving an unexpected entity"+e);
     } catch (e) {
-      ok (true, "innerHTML in xhtml", "test ok");
+      ok (true, "innerHTML in xhtml test ok");
     }
 
     try {
       div.innerHTML = "some \u00A0 text";
       div.innerHTML += "!";
-      ok (true, "innerHTML in xhtml", "test ok");
+      ok (true, "innerHTML in xhtml test ok");
     } catch (e) {
-      ok(false, "innerHTML in xhtml", "test failed, unexpected exception "+e);
+      ok(false, "innerHTML in xhtml test failed, unexpected exception "+e);
     }
 
   SimpleTest.finish();
 }
 
 
 SimpleTest.waitForExplicitFinish();
 
--- a/dom/events/test/test_bug635465.html
+++ b/dom/events/test/test_bug635465.html
@@ -29,57 +29,57 @@ https://bugzilla.mozilla.org/show_bug.cg
        onmouseover="showSubmenu(event)" onmouseout="hideSubmenu(event)">
     <a href="#" id="firsthover">Hover me</a>
     <div class="s-menu-section-submenu" id="menu">
       <a href="#" id="secondhover">Now hover me</a>
     </div>
   </div>
 </div>
 <div id="content" style="display: none">
-  
+
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 635465 **/
 function showSubmenu(event) {
   var item = document.getElementById('item');
 
   var width = item.offsetWidth;   // IT WORKS IF YOU REMOVE THIS LINE
-  
+
   item.className='open';
 }
 
 function hideSubmenu(event) {
   document.getElementById('item').className='';
 }
 
 SimpleTest.waitForExplicitFinish();
 
 function executeTests() {
   // First flush out layout of firsthover
-  ok($("firsthover").getBoundingClientRect().height > 0, true,
+  ok($("firsthover").getBoundingClientRect().height > 0,
      "Should have a nonzero height before hover");
 
   // Now trigger a mouseover on firsthover
   synthesizeMouseAtCenter($("firsthover"), { type: "mousemove" });
 
-  ok($("secondhover").getBoundingClientRect().height > 0, true,
+  ok($("secondhover").getBoundingClientRect().height > 0,
      "Should have a nonzero height for submenu after hover");
 
   // Now determine where secondhover is hanging out
   var rect = $("secondhover").getBoundingClientRect();
   synthesizeMouseAtCenter($("secondhover"), { type: "mousemove" });
 
   // And another mouseover one pixel to the right of where the center used to be
   synthesizeMouseAtPoint(rect.left + rect.width/2 + 1,
                          rect.top + rect.height/2,
                          { type: "mousemove" });
 
-  ok($("secondhover").getBoundingClientRect().height > 0, true,
+  ok($("secondhover").getBoundingClientRect().height > 0,
      "Should have a nonzero height for submenu after second hover");
 
   // And check computed display of the menu
   is(getComputedStyle($("menu"), "").display, "block", "Should have block display");
 
   SimpleTest.finish();
 }
 
--- a/dom/html/test/forms/test_input_file_picker.html
+++ b/dom/html/test/forms/test_input_file_picker.html
@@ -239,17 +239,17 @@ function runTests() {
         if (testName == "mix") {
           // Mixing mime type and file extension filters ("image/jpeg" and
           // ".jpg" here) shouldn't restrict the list but only extend it, if file
           // extension filter isn't a duplicate
           ok(filters[0].includes(mixRefExtensionList),
              "Mixing mime types and file extension filters shouldn't restrict extension list: " +
              mixRefExtensionList + " | " + filters[0]);
           ok(filters[0].includes("*.jpg"),
-             "Filter should contain '.jpg' extension", filters[0]);
+             "Filter should contain '.jpg' extension. Filter was:" + filters[0]);
         } else {
           is(filters[0], testData[currentTest][2],
              "Correct filters should have been added (" + testName + ")");
           is(filters.length, testData[currentTest][1],
              "appendFilters not called as often as expected (" + testName + ")");
         }
         is(filterIndex, testData[currentTest][3],
            "File picker should show the correct filter index (" + testName + ")");
--- a/dom/html/test/test_bug277724.html
+++ b/dom/html/test/test_bug277724.html
@@ -1,16 +1,16 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=277724
 -->
 <head>
   <title>Test for Bug 277724</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=277724">Mozilla Bug 277724</a>
 <p id="display"></p>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
@@ -39,49 +39,47 @@ var nodes = [
 function soon(f) {
   return function() { setTimeout(f, 0); }
 }
 
 function startTest(frameid) {
   is(childUnloaded, false, "Child not unloaded yet");
 
   var doc = $(frameid).contentDocument;
-  ok(doc instanceof Document, "Check for doc", "doc should be a document");
+  ok(doc instanceof Document, "doc should be a document");
 
   for (var i = 0; i < nodes.length; ++i) {
     var id = nodes[i][0];
     var node = doc.getElementById(id);
-    ok(node instanceof nodes[i][1],
-       "Check for " + id, id + " should be a " + nodes[i][1]);
+    ok(node instanceof nodes[i][1], id + " should be a " + nodes[i][1]);
     is(node.disabled, false, "check for " + id + " state");
     node.disabled = true;
     is(node.disabled, true, "check for " + id + " state change");
   }
-  
+
   $(frameid).onload = soon(function() { continueTest(frameid) });
 
   // Do this off a timeout so it's not treated like a replace load.
   function loadBlank() {
     $(frameid).contentWindow.location = "about:blank";
   }
   setTimeout(loadBlank, 0);
 }
 
 function continueTest(frameid) {
   is(childUnloaded, true, "Unload handler should have fired");
   var doc = $(frameid).contentDocument;
-  ok(doc instanceof Document, "Check for doc", "doc should be a document");
+  ok(doc instanceof Document, "doc should be a document");
 
   for (var i = 0; i < nodes.length; ++i) {
     var id = nodes[i][0];
     var node = doc.getElementById(id);
-    ok(node === null,
-       "Check for " + id, id + " should be null");
+    ok(node === null, id + " should be null");
   }
-  
+
   $(frameid).onload = soon(function() { finishTest(frameid); });
 
   // Do this off a timeout too.  Why, I'm not sure.  Something in session
   // history creates another history state if we don't.  :(
   function goBack() {
     $(frameid).contentWindow.history.back();
   }
   setTimeout(goBack, 0);
@@ -97,34 +95,33 @@ function flipper(a, b, c) {
   } else {
     once = true;
     is(a, b, c);
   }
 }
 
 function finishTest(frameid) {
   var doc = $(frameid).contentDocument;
-  ok(doc instanceof Document, "Check for doc", "doc should be a document");
+  ok(doc instanceof Document, "doc should be a document");
 
   for (var i = 0; i < nodes.length; ++i) {
     var id = nodes[i][0];
     var node = doc.getElementById(id);
-    ok(node instanceof nodes[i][1],
-       "Check for " + id, id + " should be a " + nodes[i][1]);
+    ok(node instanceof nodes[i][1], id + " should be a " + nodes[i][1]);
     //testIs(node.disabled, true, "check for " + id + " state restore");
   }
 
   if (frameid == "frame2") {
     SimpleTest.finish();
   } else {
     childUnloaded = false;
 
     // XXXbz this is a nasty hack to deal with the content sink.  See above.
     testIs = flipper;
-    
+
     $("frame2").onload = soon(function() { startTest("frame2"); });
     $("frame2").src = "bug277724_iframe2.xhtml";
   }
 }
 
 SimpleTest.waitForExplicitFinish();
 </script>
 </pre>
--- a/dom/html/test/test_bug359657.html
+++ b/dom/html/test/test_bug359657.html
@@ -1,34 +1,34 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=359657
 -->
 <head>
   <title>Test for Bug 359657</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=359657">Mozilla Bug 359657</a>
 <p id="display"></p>
 <div id="content" style="display: none">
-  
+
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 SimpleTest.waitForExplicitFinish();
 
 /** Test for Bug 359657 **/
 function runTest() {
   var span = document.createElement("span");
   $("test").insertBefore(span, $("test").firstChild);
-  ok(true, "Reachability", "We should get here without crashing");
+  ok(true, "Reachability, we should get here without crashing");
   is($("test").firstChild, span, "First child is correct");
   SimpleTest.finish();
 }
 </script>
 <div>
   <iframe src=""></iframe>
   <!-- Important: This test needs to run async at this point.  The actual test
        is not crashing while running this test! -->
--- a/dom/manifest/test/test_ManifestProcessor_name_and_short_name.html
+++ b/dom/manifest/test/test_ManifestProcessor_name_and_short_name.html
@@ -43,17 +43,17 @@ props.forEach((prop) => {
  */
 props.forEach((prop) => {
   typeTests.forEach((type) => {
     var expected = `Expect non - string ${prop} to be undefined: ${typeof type}`;
     var obj = {};
     obj[prop] = type;
     data.jsonText = JSON.stringify(obj);
     var result = processor.process(data);
-    SimpleTest.ok(result[prop] === undefined, true, expected);
+    SimpleTest.ok(result[prop] === undefined, expected);
   });
 });
 
 /**
  * acceptable names - including long names
  */
 var acceptableNames = [
   'pass',
--- a/dom/tests/mochitest/script/test_whitespace.html
+++ b/dom/tests/mochitest/script/test_whitespace.html
@@ -6,26 +6,26 @@
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 
 <script type="application/javascript">
 let passed = false;
 
 let tests = [
-  [ " application/javascript", true ],
-  [ "\tapplication/javascript\n\r \t", true ],
+  " application/javascript",
+  "\tapplication/javascript\n\r \t",
 ];
 
 for (let i = 0; i < tests.length; ++i) {
   passed = false;
 
   let script = document.createElement('script');
-  script.setAttribute('type', tests[i][0]);
+  script.setAttribute('type', tests[i]);
   script.innerText = "passed = true;";
   document.body.appendChild(script);
 
-  ok (passed, tests[i][1], "Test " + tests[i][0] + " passed");
+  ok (passed, "Test " + tests[i] + " passed");
 }
 </script>
 
 </body>
 </html>
--- a/gfx/layers/apz/test/mochitest/test_frame_reconstruction.html
+++ b/gfx/layers/apz/test/mochitest/test_frame_reconstruction.html
@@ -166,18 +166,18 @@ function* test(testDriver) {
   // Kick off an APZ smooth-scroll to 0,200
   elm.scrollTo(0, 200);
   yield waitForAllPaints(function() { setTimeout(testDriver, 0); });
 
   // Let's do a couple of frames of the animation, and make sure it's going
   utils.advanceTimeAndRefresh(16);
   utils.advanceTimeAndRefresh(16);
   yield flushApzRepaints(testDriver);
-  ok(elm.scrollTop > 0, "APZ animation in progress", "scrollTop is now " + elm.scrollTop);
-  ok(elm.scrollTop < 200, "APZ animation not yet completed", "scrollTop is now " + elm.scrollTop);
+  ok(elm.scrollTop > 0, "APZ animation in progress, scrollTop is now " + elm.scrollTop);
+  ok(elm.scrollTop < 200, "APZ animation not yet completed, scrollTop is now " + elm.scrollTop);
 
   var frameReconstructionTriggered = 0;
   // Register the listener that triggers the frame reconstruction
   elm.onscroll = function() {
     // Do the reconstruction
     elm.parentNode.classList.add('contentBefore');
     frameReconstructionTriggered++;
     // schedule a thing to undo the changes above
@@ -186,18 +186,18 @@ function* test(testDriver) {
     }, 0);
   }
 
   // and do a few more frames of the animation, this should trigger the listener
   // and the frame reconstruction
   utils.advanceTimeAndRefresh(16);
   utils.advanceTimeAndRefresh(16);
   yield flushApzRepaints(testDriver);
-  ok(elm.scrollTop < 200, "APZ animation not yet completed", "scrollTop is now " + elm.scrollTop);
-  ok(frameReconstructionTriggered > 0, "Frame reconstruction triggered", "reconstruction triggered " + frameReconstructionTriggered + " times");
+  ok(elm.scrollTop < 200, "APZ animation not yet completed, scrollTop is now " + elm.scrollTop);
+  ok(frameReconstructionTriggered > 0, "Frame reconstruction triggered, reconstruction triggered " + frameReconstructionTriggered + " times");
 
   // and now run to completion
   for (var i = 0; i < 100; i++) {
     utils.advanceTimeAndRefresh(16);
   }
   utils.restoreNormalRefresh();
   yield waitForAllPaints(function() { setTimeout(testDriver, 0); });
   yield flushApzRepaints(testDriver);
--- a/layout/generic/test/test_bug469774.xul
+++ b/layout/generic/test/test_bug469774.xul
@@ -51,18 +51,18 @@ function doTest() {
   popup.addEventListener("popupshown", function() {
     var textbox = document.getElementById("textbox");
     textbox.focus(); // show caret
 
     var after = snapShot();
 
     var equal, str1, str2;
     [equal, str1, str2] = compareSnapshots(after, before, true);
-    ok(equal, "Showing a popup shouldn't affect drawing in its parent window",
-       "got " + str1 + " but expected " + str2);
+    ok(equal, "Showing a popup shouldn't affect drawing in its parent window" +
+       "got " + str1 + ", expected " + str2);
 
     popup.hidePopup();
     SimpleTest.finish();
   }, false);
 }
 
 SimpleTest.waitForExplicitFinish();
 window.addEventListener("focus", doTest, false);
--- a/layout/style/test/test_bug1292447.html
+++ b/layout/style/test/test_bug1292447.html
@@ -290,23 +290,23 @@ function coordValueTest(camelProp, decl,
 
 function percentValueTest(camelProp, decl, percentVal, prettyName) {
   is(decl[camelProp], percentVal + "%", prettyName);
 }
 
 function doATest(propName, idBase, coordVal, percentVal, resolveToUsedVal = false) {
   var cssCamelPropName = "";
   var parts = propName.split("-");
-  ok(parts.length > 0, "prop name", "Empty css prop name");
+  ok(parts.length > 0, "CSS prop name should not be empty");
   var i;
   if (parts[0]) {
     i = 0;
   } else {
     is(parts[1], "moz", "Testing an extension property that's not -moz");
-    ok(parts.length > 2, "prop name 2", "Bogus -moz prop name");
+    ok(parts.length > 2, "-moz prop name should not have more than 2 parts");
     cssCamelPropName = "Moz";
     i = 2;
   }
   for (; i < parts.length; ++i) {
     var part = parts[i];
     isnot(part, "", "Must have a nonempty part");
     if (cssCamelPropName) {
       cssCamelPropName += part.charAt(0).toUpperCase() +
--- a/toolkit/components/normandy/test/browser/browser_LogManager.js
+++ b/toolkit/components/normandy/test/browser/browser_LogManager.js
@@ -9,17 +9,17 @@ add_task(async function() {
   LogManager.configure(5);
   const secondLogger = LogManager.getLogger("second");
   is(firstLogger.level, 5, "First logger level inherited from root logger.");
   is(secondLogger.level, 5, "Second logger level inherited from root logger.");
 
   // Ensure that our loggers have at least one appender.
   LogManager.configure(Log.Level.Warn);
   const logger  = LogManager.getLogger("test");
-  ok(logger.appenders.length > 0, true, "Loggers have at least one appender.");
+  ok(logger.appenders.length > 0, "Loggers have at least one appender.");
 
   // Ensure our loggers log to the console.
   await new Promise(resolve => {
     SimpleTest.waitForExplicitFinish();
     SimpleTest.monitorConsole(resolve, [{message: /legend has it/}]);
     logger.warn("legend has it");
     SimpleTest.endMonitorConsole();
   });
--- a/toolkit/content/tests/widgets/test_videocontrols.html
+++ b/toolkit/content/tests/widgets/test_videocontrols.html
@@ -81,17 +81,17 @@ function forceReframe() {
   video.style.display = "";
   video.getBoundingClientRect();
 }
 
 function verifyExpectedEvent(event) {
   const checkingEvent = expectingEvents.shift();
 
   if (event.type == checkingEvent) {
-    ok(true, "checking event type: ", checkingEvent);
+    ok(true, "checking event type: " + checkingEvent);
   } else {
     expectingEventPromise.reject(new Error(`Got event: ${event.type}, expected: ${checkingEvent}`));
   }
 
   if (expectingEvents.length == 0) {
     SimpleTest.executeSoon(expectingEventPromise.resolve);
   }
 }
--- a/toolkit/content/tests/widgets/xbl/test_videocontrols.html
+++ b/toolkit/content/tests/widgets/xbl/test_videocontrols.html
@@ -81,17 +81,17 @@ function forceReframe() {
   video.style.display = "";
   video.getBoundingClientRect();
 }
 
 function verifyExpectedEvent(event) {
   const checkingEvent = expectingEvents.shift();
 
   if (event.type == checkingEvent) {
-    ok(true, "checking event type: ", checkingEvent);
+    ok(true, "checking event type: " + checkingEvent);
   } else {
     expectingEventPromise.reject(new Error(`Got event: ${event.type}, expected: ${checkingEvent}`));
   }
 
   if (expectingEvents.length == 0) {
     SimpleTest.executeSoon(expectingEventPromise.resolve);
   }
 }