Bug 1241930: Part 6 - convert all assertion methods used inside content tasks to the Assert.* family in toolkit tests. r=mconley
authorMike de Boer <mdeboer@mozilla.com>
Fri, 04 Mar 2016 14:32:34 +0100
changeset 323242 7ea58667c988dd692454325361aea810a3792f00
parent 323241 92fd92a5c939b746e59e093211c542a63680edf3
child 323243 99715b34b2da77b852af02c88582ead186ef6d24
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1241930
milestone47.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 1241930: Part 6 - convert all assertion methods used inside content tasks to the Assert.* family in toolkit tests. r=mconley
toolkit/components/passwordmgr/test/browser/browser_DOMInputPasswordAdded.js
toolkit/components/passwordmgr/test/browser/browser_filldoorhanger.js
toolkit/components/places/tests/browser/browser_bug646422.js
toolkit/components/places/tests/browser/browser_bug680727.js
toolkit/components/viewsource/test/browser/browser_bug713810.js
toolkit/components/viewsource/test/browser/browser_contextmenu.js
toolkit/components/viewsource/test/browser/browser_gotoline.js
toolkit/content/tests/browser/browser_bug295977_autoscroll_overflow.js
toolkit/content/tests/browser/browser_bug594509.js
toolkit/crashreporter/test/browser/browser_aboutCrashes.js
toolkit/crashreporter/test/browser/browser_aboutCrashesResubmit.js
toolkit/crashreporter/test/browser/browser_bug471404.js
toolkit/crashreporter/test/browser/browser_clearReports.js
toolkit/modules/tests/browser/browser_Finder.js
--- a/toolkit/components/passwordmgr/test/browser/browser_DOMInputPasswordAdded.js
+++ b/toolkit/components/passwordmgr/test/browser/browser_DOMInputPasswordAdded.js
@@ -8,17 +8,17 @@ const consts = {
   BODY_INPUT_ID: "input3",
 };
 
 function task(consts) {
   let resolve;
   let promise = new Promise(r => { resolve = r; });
 
   function unexpectedContentEvent(evt) {
-    ok(false, "Received a " + evt.type + " event on content");
+    Assert.ok(false, "Received a " + evt.type + " event on content");
   }
 
   var gDoc = null;
 
   addEventListener("load", tabLoad, true);
 
   function tabLoad() {
     removeEventListener("load", tabLoad, true);
@@ -35,53 +35,53 @@ function task(consts) {
     input.setAttribute("id", consts.INPUT_ID);
     input.setAttribute("data-test", "unique-attribute");
     gDoc.getElementById(consts.FORM1_ID).appendChild(input);
     info("Done appending the input element");
   }
 
   function test_inputAddHandler(evt) {
     removeEventListener(evt.type, test_inputAddHandler, false);
-    is(evt.target.id, consts.INPUT_ID,
-       evt.type + " event targets correct input element (added password element)");
+    Assert.equal(evt.target.id, consts.INPUT_ID,
+      evt.type + " event targets correct input element (added password element)");
     gDoc.defaultView.setTimeout(test_inputAddOutsideForm, 0);
   }
 
   function test_inputAddOutsideForm() {
     addEventListener("DOMInputPasswordAdded", test_inputAddOutsideFormHandler, false);
     let input = gDoc.createElementNS(consts.HTML_NS, "input");
     input.setAttribute("type", "password");
     input.setAttribute("id", consts.BODY_INPUT_ID);
     input.setAttribute("data-test", "unique-attribute");
     gDoc.body.appendChild(input);
     info("Done appending the input element to the body");
   }
 
   function test_inputAddOutsideFormHandler(evt) {
     removeEventListener(evt.type, test_inputAddOutsideFormHandler, false);
-    is(evt.target.id, consts.BODY_INPUT_ID,
-       evt.type + " event targets correct input element (added password element outside form)");
+    Assert.equal(evt.target.id, consts.BODY_INPUT_ID,
+      evt.type + " event targets correct input element (added password element outside form)");
     gDoc.defaultView.setTimeout(test_inputChangesType, 0);
   }
 
   function test_inputChangesType() {
     addEventListener("DOMInputPasswordAdded", test_inputChangesTypeHandler, false);
     let input = gDoc.getElementById(consts.CHANGE_INPUT_ID);
     input.setAttribute("type", "password");
   }
 
   function test_inputChangesTypeHandler(evt) {
     removeEventListener(evt.type, test_inputChangesTypeHandler, false);
-    is(evt.target.id, consts.CHANGE_INPUT_ID,
-       evt.type + " event targets correct input element (changed type)");
+    Assert.equal(evt.target.id, consts.CHANGE_INPUT_ID,
+      evt.type + " event targets correct input element (changed type)");
     gDoc.defaultView.setTimeout(completeTest, 0);
   }
 
   function completeTest() {
-    ok(true, "Test completed");
+    Assert.ok(true, "Test completed");
     gDoc.removeEventListener("DOMInputPasswordAdded", unexpectedContentEvent, false);
     resolve();
   }
 
   return promise;
 }
 
 add_task(function* () {
--- a/toolkit/components/passwordmgr/test/browser/browser_filldoorhanger.js
+++ b/toolkit/components/passwordmgr/test/browser/browser_filldoorhanger.js
@@ -62,24 +62,19 @@ add_task(function* test_fill() {
     yield promiseSubview;
 
     // Clicking the button will dismiss the panel.
     let promiseHidden = BrowserTestUtils.waitForEvent(PopupNotifications.panel,
                                                       "popuphidden");
     document.getElementById("login-fill-use").click();
     yield promiseHidden;
 
-    let result = yield ContentTask.spawn(browser, null, function* () {
+    yield ContentTask.spawn(browser, null, function* () {
       let doc = content.document;
-      return {
-        username: doc.getElementById("form-basic-username").value,
-        password: doc.getElementById("form-basic-password").value,
-      }
+      Assert.equal(doc.getElementById("form-basic-username").value, "username",
+        "result.username === \"username\"");
+      Assert.equal(doc.getElementById("form-basic-password").value, "password",
+        "result.password === \"password\"");
     });
-
-    Assert.equal(result.username, "username",
-                 'result.username === "username"');
-    Assert.equal(result.password, "password",
-                 'result.password === "password"');
   });
 
   Services.logins.removeAllLogins();
 });
--- a/toolkit/components/places/tests/browser/browser_bug646422.js
+++ b/toolkit/components/places/tests/browser/browser_bug646422.js
@@ -29,26 +29,23 @@ add_task(function* () {
       onPageChanged: function() { },
       onDeleteVisits: function() { },
       QueryInterface: XPCOMUtils.generateQI([Ci.nsINavHistoryObserver])
     };
 
     PlacesUtils.history.addObserver(observer, false);
   });
 
-  let title = yield ContentTask.spawn(tab.linkedBrowser, {}, function* () {
+  yield ContentTask.spawn(tab.linkedBrowser, null, function* () {
     let title =  content.document.title;
     content.history.pushState('', '', 'new_page');
-    return title;
+    Assert.ok(title, "Content window should initially have a title.");
   });
 
-  ok(title, 'Content window should initially have a title.');
-
   let newtitle = yield newTitlePromise;
 
-  title = yield ContentTask.spawn(tab.linkedBrowser, {}, function* () {
-    return content.document.title;
+  yield ContentTask.spawn(tab.linkedBrowser, { newtitle }, function* (args) {
+    Assert.equal(args.newtitle, content.document.title, "Title after pushstate.");
   });
-  is(newtitle, title, 'Title after pushstate.');
 
   yield PlacesTestUtils.clearHistory();
   gBrowser.removeTab(tab);
 });
--- a/toolkit/components/places/tests/browser/browser_bug680727.js
+++ b/toolkit/components/places/tests/browser/browser_bug680727.js
@@ -40,23 +40,21 @@ function test() {
 
 //------------------------------------------------------------------------------
 // listen to loading the neterror page. (offline mode)
 function errorListener() {
   ok(Services.io.offline, "Services.io.offline is true.");
 
   // This is an error page.
   ContentTask.spawn(ourTab.linkedBrowser, kUniqueURI.spec, function(uri) {
-    is(content.document.documentURI.substring(0, 27),
-       "about:neterror?e=netOffline",
-       "Document URI is the error page.");
+    Assert.equal(content.document.documentURI.substring(0, 27),
+      "about:neterror?e=netOffline", "Document URI is the error page.");
 
     // But location bar should show the original request.
-    is(content.location.href, uri,
-       "Docshell URI is the original URI.");
+    Assert.equal(content.location.href, uri, "Docshell URI is the original URI.");
   }).then(() => {
     // Global history does not record URI of a failed request.
     return PlacesTestUtils.promiseAsyncUpdates().then(() => {
       gAsyncHistory.isURIVisited(kUniqueURI, errorAsyncListener);
     });
   });
 }
 
@@ -68,34 +66,34 @@ function errorAsyncListener(aURI, aIsVis
 
   // Now press the "Try Again" button, with offline mode off.
   Services.io.offline = false;
 
   BrowserTestUtils.waitForContentEvent(ourTab.linkedBrowser, "DOMContentLoaded")
                   .then(reloadListener);
 
   ContentTask.spawn(ourTab.linkedBrowser, null, function() {
-    ok(content.document.getElementById("errorTryAgain"),
-       "The error page has got a #errorTryAgain element");
+    Assert.ok(content.document.getElementById("errorTryAgain"),
+      "The error page has got a #errorTryAgain element");
     content.document.getElementById("errorTryAgain").click();
   });
 }
 
 //------------------------------------------------------------------------------
 // listen to reload of neterror.
 function reloadListener() {
   // This listener catches "DOMContentLoaded" on being called
   // nsIWPL::onLocationChange(...). That is right *AFTER*
   // IHistory::VisitURI(...) is called.
   ok(!Services.io.offline, "Services.io.offline is false.");
 
   ContentTask.spawn(ourTab.linkedBrowser, kUniqueURI.spec, function(uri) {
     // This is not an error page.
-    is(content.document.documentURI, uri,
-       "Document URI is not the offline-error page, but the original URI.");
+    Assert.equal(content.document.documentURI, uri,
+      "Document URI is not the offline-error page, but the original URI.");
   }).then(() => {
     // Check if global history remembers the successfully-requested URI.
     PlacesTestUtils.promiseAsyncUpdates().then(() => {
       gAsyncHistory.isURIVisited(kUniqueURI, reloadAsyncListener);
     });
   });
 }
 
--- a/toolkit/components/viewsource/test/browser/browser_bug713810.js
+++ b/toolkit/components/viewsource/test/browser/browser_bug713810.js
@@ -1,23 +1,23 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 const source = '<html xmlns="http://www.w3.org/1999/xhtml"><body><p>This is a paragraph.</p></body></html>';
 
 add_task(function *() {
   let viewSourceTab = yield* openDocumentSelect("data:text/html," + source, "p");
-  let text = yield ContentTask.spawn(viewSourceTab.linkedBrowser, { }, function* () {
-    return content.document.body.textContent;
+  yield ContentTask.spawn(viewSourceTab.linkedBrowser, null, function* () {
+    Assert.equal(content.document.body.textContent, "<p>This is a paragraph.</p>",
+      "Correct source for text/html");
   });
-  is(text, "<p>This is a paragraph.</p>", "Correct source for text/html");
   gBrowser.removeTab(viewSourceTab);
 
   viewSourceTab = yield* openDocumentSelect("data:application/xhtml+xml," + source, "p");
-  text = yield ContentTask.spawn(viewSourceTab.linkedBrowser, { }, function* () {
-    return content.document.body.textContent;
+  yield ContentTask.spawn(viewSourceTab.linkedBrowser, null, function* () {
+    Assert.equal(content.document.body.textContent,
+      '<p xmlns="http://www.w3.org/1999/xhtml">This is a paragraph.</p>',
+      "Correct source for application/xhtml+xml");
   });
-  is(text, '<p xmlns="http://www.w3.org/1999/xhtml">This is a paragraph.</p>',
-     "Correct source for application/xhtml+xml");
   gBrowser.removeTab(viewSourceTab);
 });
 
--- a/toolkit/components/viewsource/test/browser/browser_contextmenu.js
+++ b/toolkit/components/viewsource/test/browser/browser_contextmenu.js
@@ -59,24 +59,22 @@ add_task(function *() {
 
 function* onViewSourceWindowOpen(aWindow, aIsTab) {
   gViewSourceWindow = aWindow;
 
   gCopyLinkMenuItem = aWindow.document.getElementById(aIsTab ? "context-copylink" : "context-copyLink");
   gCopyEmailMenuItem = aWindow.document.getElementById(aIsTab ? "context-copyemail" : "context-copyEmail");
 
   let browser = aIsTab ? gBrowser.selectedBrowser : gViewSourceWindow.gBrowser;
-  let items = yield ContentTask.spawn(browser, { }, function* (arg) {
+  yield ContentTask.spawn(browser, null, function* (arg) {
     let tags = content.document.querySelectorAll("a[href]");
-    return [tags[0].href, tags[1].href];
+    Assert.equal(tags[0].href, "view-source:http://example.com/", "Link has correct href");
+    Assert.equal(tags[1].href, "mailto:abc@def.ghi", "Link has correct href");
   });
 
-  is(items[0], "view-source:http://example.com/", "Link has correct href");
-  is(items[1], "mailto:abc@def.ghi", "Link has correct href");
-
   expectedData.push(["a[href]", true, false, "http://example.com/"]);
   expectedData.push(["a[href^=mailto]", false, true, "abc@def.ghi"]);
   expectedData.push(["span", false, false, null]);
 }
 
 function* checkMenuItems(contextMenu, isTab, selector, copyLinkExpected, copyEmailExpected, expectedClipboardContent) {
 
   let browser = isTab ? gBrowser.selectedBrowser : gViewSourceWindow.gBrowser;
--- a/toolkit/components/viewsource/test/browser/browser_gotoline.js
+++ b/toolkit/components/viewsource/test/browser/browser_gotoline.js
@@ -20,20 +20,18 @@ add_task(function*() {
 var checkViewSource = Task.async(function* (aWindow) {
   is(aWindow.gBrowser.contentDocument.body.textContent, content, "Correct content loaded");
   let selection = aWindow.gBrowser.contentWindow.getSelection();
   let statusPanel = aWindow.document.getElementById("statusbar-line-col");
   is(statusPanel.getAttribute("label"), "", "Correct status bar text");
 
   for (let i = 1; i <= 3; i++) {
     aWindow.viewSourceChrome.goToLine(i);
-    let result = yield ContentTask.spawn(aWindow.gBrowser, i, function*(i) {
+    yield ContentTask.spawn(aWindow.gBrowser, i, function*(i) {
       let selection = content.getSelection();
-      return (selection.toString() == "line " + i);
+      Assert.equal(selection.toString(), "line " + i, "Correct text selected");
     });
 
-    ok(result, "Correct text selected");
-
     yield ContentTaskUtils.waitForCondition(() => {
       return (statusPanel.getAttribute("label") == "Line " + i + ", Col 1");
     }, "Correct status bar text");
   }
 });
--- a/toolkit/content/tests/browser/browser_bug295977_autoscroll_overflow.js
+++ b/toolkit/content/tests/browser/browser_bug295977_autoscroll_overflow.js
@@ -150,21 +150,21 @@ add_task(function* ()
       // should be > 1 due to how it synthesizes mouse events below.
     } while (timeCompensation < 5);
 
     // Close the autoscroll popup by synthesizing Esc.
     EventUtils.synthesizeKey("VK_ESCAPE", {});
     let scrollVert = test.expected & expectScrollVert;
     let scrollHori = test.expected & expectScrollHori;
 
-    let checkScroll = yield ContentTask.spawn(gBrowser.selectedBrowser,
-                                              { scrollVert : scrollVert,
-                                                scrollHori: scrollHori,
-                                                elemid : test.elem,
-                                                checkWindow: test.testwindow },
+    yield ContentTask.spawn(gBrowser.selectedBrowser,
+                            { scrollVert : scrollVert,
+                              scrollHori: scrollHori,
+                              elemid : test.elem,
+                              checkWindow: test.testwindow },
       function* (args) {
         let msg = "";
         if (args.checkWindow) {
           if (!((args.scrollVert && content.scrollY > 0) ||
                 (!args.scrollVert && content.scrollY == 0))) {
             msg += "Failed: ";
           }
           msg += 'Window for ' + args.elemid + ' should' + (args.scrollVert ? '' : ' not') + ' have scrolled vertically\n';
@@ -183,22 +183,20 @@ add_task(function* ()
           msg += ' ' + args.elemid + ' should' + (args.scrollVert ? '' : ' not') + ' have scrolled vertically\n';
           if (!((args.scrollHori && elem.scrollLeft > 0) ||
                 (!args.scrollHori && elem.scrollLeft == 0))) {
             msg += "Failed: ";
           }
           msg += args.elemid + ' should' + (args.scrollHori ? '' : ' not') + ' have scrolled horizontally';
         }
 
-        return msg;
+        Assert.ok(msg.indexOf("Failed") == -1, msg);
        }
     );
 
-    ok(checkScroll.indexOf("Failed") == -1, checkScroll)
-
     // Before continuing the test, we need to ensure that the IPC
     // message that stops autoscrolling has had time to arrive.
     yield new Promise(resolve => executeSoon(resolve));
   }
 
   // remove 2 tabs that were opened by middle-click on links
   while (gBrowser.visibleTabs.length > 1) {
     gBrowser.removeTab(gBrowser.visibleTabs[gBrowser.visibleTabs.length - 1]);
--- a/toolkit/content/tests/browser/browser_bug594509.js
+++ b/toolkit/content/tests/browser/browser_bug594509.js
@@ -1,9 +1,9 @@
 add_task(function* () {
   let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:rights");
 
   yield ContentTask.spawn(tab.linkedBrowser, null, function* () {
-    ok(content.document.getElementById("your-rights"), "about:rights content loaded");
+    Assert.ok(content.document.getElementById("your-rights"), "about:rights content loaded");
   });
 
   yield BrowserTestUtils.removeTab(tab);
 });
--- a/toolkit/crashreporter/test/browser/browser_aboutCrashes.js
+++ b/toolkit/crashreporter/test/browser/browser_aboutCrashes.js
@@ -9,17 +9,19 @@ add_task(function* test() {
   let appDtest = dirSvc.get("UAppData", Components.interfaces.nsILocalFile);
   ok(appD.equals(appDtest), "directory service provider registered ok");
 
   yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:crashes" }, function (browser) {
     info("about:crashes loaded");
     return ContentTask.spawn(browser, crashes, function (crashes) {
       let doc = content.document;
       let crashlinks = doc.getElementById("tbody").getElementsByTagName("a");
-      is(crashlinks.length, crashes.length, "about:crashes lists correct number of crash reports");
-      for(let i = 0; i < crashes.length; i++) {
-        is(crashlinks[i].firstChild.textContent, crashes[i].id, i + ": crash ID is correct");
+      Assert.equal(crashlinks.length, crashes.length,
+        "about:crashes lists correct number of crash reports");
+      for (let i = 0; i < crashes.length; i++) {
+        Assert.equal(crashlinks[i].firstChild.textContent, crashes[i].id,
+          i + ": crash ID is correct");
       }
     });
   });
 
   cleanup_fake_appdir();
 });
--- a/toolkit/crashreporter/test/browser/browser_aboutCrashesResubmit.js
+++ b/toolkit/crashreporter/test/browser/browser_aboutCrashesResubmit.js
@@ -12,25 +12,25 @@ function cleanup_and_finish() {
  * Check that the list of crashes displayed by about:crashes matches
  * the list of crashes that we placed in the pending+submitted directories.
  *
  * NB: This function is run in the child process via ContentTask.spawn.
  */
 function check_crash_list(crashes) {
   let doc = content.document;
   let crashlinks = doc.getElementById("tbody").getElementsByTagName("a");
-  is(crashlinks.length, crashes.length,
+  Assert.equal(crashlinks.length, crashes.length,
     "about:crashes lists correct number of crash reports");
   // no point in checking this if the lists aren't the same length
   if (crashlinks.length == crashes.length) {
     for(let i=0; i<crashes.length; i++) {
-      is(crashlinks[i].id, crashes[i].id, i + ": crash ID is correct");
+      Assert.equal(crashlinks[i].id, crashes[i].id, i + ": crash ID is correct");
       if (crashes[i].pending) {
         // we set the breakpad.reportURL pref in test()
-        is(crashlinks[i].getAttribute("href"),
+        Assert.equal(crashlinks[i].getAttribute("href"),
           "http://example.com/browser/toolkit/crashreporter/about/throttling",
           "pending URL links to the correct static page");
       }
     }
   }
 }
 
 /*
@@ -52,20 +52,20 @@ function check_submit_pending(tab, crash
 
     ContentTask.spawn(browser, null, function() {
       // grab the Crash ID here to verify later
       let CrashID = content.location.search.split("=")[1];
       let CrashURL = content.location.toString();
 
       // check the JSON content vs. what we submitted
       let result = JSON.parse(content.document.documentElement.textContent);
-      is(result.upload_file_minidump, "MDMP", "minidump file sent properly");
-      is(result.memory_report, "Let's pretend this is a memory report",
+      Assert.equal(result.upload_file_minidump, "MDMP", "minidump file sent properly");
+      Assert.equal(result.memory_report, "Let's pretend this is a memory report",
          "memory report sent properly");
-      is(+result.Throttleable, 0, "correctly sent as non-throttleable");
+      Assert.equal(+result.Throttleable, 0, "correctly sent as non-throttleable");
       // we checked these, they're set by the submission process,
       // so they won't be in the "extra" data.
       delete result.upload_file_minidump;
       delete result.memory_report;
       delete result.Throttleable;
 
       return { id: CrashID, url: CrashURL, result };
     }).then(({ id, url, result }) => {
@@ -97,21 +97,21 @@ function check_submit_pending(tab, crash
     browser.removeEventListener("CrashSubmitFailed", csp_fail, true);
     ok(false, "failed to submit crash report!");
     cleanup_and_finish();
   }
   browser.addEventListener("CrashSubmitFailed", csp_fail, true);
   BrowserTestUtils.browserLoaded(browser, false, (url) => url !== "about:crashes").then(csp_onload);
   function csp_pageshow() {
     ContentTask.spawn(browser, { CrashID, CrashURL }, function({ CrashID, CrashURL }) {
-                  is(content.location.href, "about:crashes", "navigated back successfully");
+                  Assert.equal(content.location.href, "about:crashes", "navigated back successfully");
                   let link = content.document.getElementById(CrashID);
-                  isnot(link, null, "crash report link changed correctly");
+                  Assert.notEqual(link, null, "crash report link changed correctly");
                   if (link)
-                    is(link.href, CrashURL, "crash report link points to correct href");
+                    Assert.equal(link.href, CrashURL, "crash report link points to correct href");
                 }).then(cleanup_and_finish);
   }
 
   // try submitting the pending report
   for (let crash of crashes) {
     if (crash.pending) {
       SubmittedCrash = crash;
       break;
--- a/toolkit/crashreporter/test/browser/browser_bug471404.js
+++ b/toolkit/crashreporter/test/browser/browser_bug471404.js
@@ -4,18 +4,18 @@ function check_clear_visible(browser, aV
     let visible = false;
     let button = doc.getElementById("clear-reports");
     if (button) {
       let style = doc.defaultView.getComputedStyle(button, "");
       if (style.display != "none" &&
           style.visibility == "visible")
         visible = true;
     }
-    is(visible, aVisible,
-       "clear reports button is " + (aVisible ? "visible" : "hidden"));
+    Assert.equal(visible, aVisible,
+      "clear reports button is " + (aVisible ? "visible" : "hidden"));
   });
 }
 
 // each test here has a setup (run before loading about:crashes) and onload (run after about:crashes loads)
 var _tests = [{setup: null, onload: function(browser) { return check_clear_visible(browser, false); }},
               {setup: function(crD) { return add_fake_crashes(crD, 1); },
                onload: function(browser) { return check_clear_visible(browser, true); }}
               ];
--- a/toolkit/crashreporter/test/browser/browser_clearReports.js
+++ b/toolkit/crashreporter/test/browser/browser_clearReports.js
@@ -3,32 +3,32 @@
 * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 function clickClearReports(browser) {
   let doc = content.document;
 
   let button = doc.getElementById("clear-reports");
 
   if (!button) {
-    ok(false, "Button not found");
+    Assert.ok(false, "Button not found");
     return Promise.resolve();
   }
 
   let style = doc.defaultView.getComputedStyle(button, "");
 
-  isnot(style.display, "none", "Clear reports button visible");
+  Assert.notEqual(style.display, "none", "Clear reports button visible");
 
   let deferred = {};
   deferred.promise = new Promise(resolve => deferred.resolve = resolve);
   var observer = new content.MutationObserver(function(mutations) {
     for (let mutation of mutations) {
       if (mutation.type == "attributes" &&
           mutation.attributeName == "style") {
         observer.disconnect();
-        is(style.display, "none", "Clear reports button hidden");
+        Assert.equal(style.display, "none", "Clear reports button hidden");
         deferred.resolve();
       }
     }
   });
   observer.observe(button, {
       attributes: true,
       childList: true,
       characterData: true,
--- a/toolkit/modules/tests/browser/browser_Finder.js
+++ b/toolkit/modules/tests/browser/browser_Finder.js
@@ -36,24 +36,24 @@ add_task(function* () {
 
   // Search only for links and draw outlines.
   promiseFind = waitForFind();
   finder.fastFind("test link", true, true);
   findResult = yield promiseFind;
   is(findResult.result, Ci.nsITypeAheadFind.FIND_FOUND, "should find link");
 
   yield ContentTask.spawn(tab.linkedBrowser, {}, function* (arg) {
-    ok(!!content.document.getElementsByTagName("a")[0].style.outline, "outline set");
+    Assert.ok(!!content.document.getElementsByTagName("a")[0].style.outline, "outline set");
   });
 
   // Just a simple search for "test link".
   promiseFind = waitForFind();
   finder.fastFind("test link", false, false);
   findResult = yield promiseFind;
   is(findResult.result, Ci.nsITypeAheadFind.FIND_FOUND, "should find link again");
 
   yield ContentTask.spawn(tab.linkedBrowser, {}, function* (arg) {
-    ok(!content.document.getElementsByTagName("a")[0].style.outline, "outline not set");
+    Assert.ok(!content.document.getElementsByTagName("a")[0].style.outline, "outline not set");
   });
 
   finder.removeResultListener(listener);
   gBrowser.removeTab(tab);
 });