Bug 856258 - Use |is| instead of |ok| to test the length of result arrays in test_contacts_basics.html. r=gwagner a=test-only
authorReuben Morais <reuben.morais@gmail.com>
Fri, 14 Jun 2013 16:02:33 -0700
changeset 119593 15d9885034a008ddc3cdf739e675841b40d03715
parent 119592 94f2c4aad8c70d6b3f52bc582318f4368dd62fcd
child 119594 5ad236b648cff49dd242d0213445a56fd24efc2b
push id892
push userreuben.morais@gmail.com
push dateFri, 14 Jun 2013 23:02:44 +0000
reviewersgwagner, test-only
bugs856258
milestone18.1
Bug 856258 - Use |is| instead of |ok| to test the length of result arrays in test_contacts_basics.html. r=gwagner a=test-only
dom/contacts/tests/test_contacts_basics.html
--- a/dom/contacts/tests/test_contacts_basics.html
+++ b/dom/contacts/tests/test_contacts_basics.html
@@ -236,17 +236,17 @@ var steps = [
       next();
     };
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Retrieving all contacts");
     req = mozContacts.find({});
     req.onsuccess = function () {
-      ok(req.result.length == 0, "Empty database is empty.");
+      is(req.result.length, 0, "Empty database is empty.");
       next();
     };
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Adding empty contact");
     createResult1 = new mozContact();
     createResult1.init({});
@@ -257,29 +257,29 @@ var steps = [
       next();
     };
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Retrieving all contacts");
     req = mozContacts.find({});
     req.onsuccess = function () {
-      ok(req.result.length == 1, "One contact.");
+      is(req.result.length, 1, "One contact.");
       findResult1 = req.result[0];
       next();
     };
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Deleting empty contact");
     req = navigator.mozContacts.remove(findResult1);
     req.onsuccess = function () {
       var req2 = mozContacts.find({});
       req2.onsuccess = function () {
-        ok(req2.result.length == 0, "Empty Database.");
+        is(req2.result.length, 0, "Empty Database.");
         clearTemps();
         next();
       }
       req2.onerror = onFailure;
     }
     req.onerror = onFailure;
   },
   function () {
@@ -332,17 +332,17 @@ var steps = [
   },
   function () {
     ok(true, "Searching for exact email");
     var options = {filterBy: ["email"],
                    filterOp: "equals",
                    filterValue: properties1.email[0].value};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 1, "Found exactly 1 contact.");
+      is(req.result.length, 1, "Found exactly 1 contact.");
       findResult1 = req.result[0];
       ok(findResult1.id == sample_id1, "Same ID");
       checkContacts(findResult1, createResult1);
       next();
     };
     req.onerror = onFailure;
   },
   function () {
@@ -351,17 +351,17 @@ var steps = [
        is(event.contactID, findResult1.id, "Same contactID");
        is(event.reason, "update", "Same reason");
      }
     var options = {filterBy: ["givenName"],
                    filterOp: "contains",
                    filterValue: properties1.givenName[0].substring(0,3)};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 1, "Found exactly 1 contact.");
+      is(req.result.length, 1, "Found exactly 1 contact.");
       findResult1 = req.result[0];
       findResult1.jobTitle = ["new Job"];
       ok(findResult1.id == sample_id1, "Same ID");
       checkContacts(createResult1, properties1);
       next();
     };
     req.onerror = onFailure;
   },
@@ -382,17 +382,17 @@ var steps = [
   },
   function () {
     ok(true, "Retrieving by substring 2");
     var options = {filterBy: ["givenName"],
                    filterOp: "contains",
                    filterValue: properties1.givenName[0].substring(0,3)};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 1, "Found exactly 1 contact.");
+      is(req.result.length, 1, "Found exactly 1 contact.");
       findResult1 = req.result[0];
       checkContacts(createResult1, findResult1);
       next();
     };
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Remove contact1");
@@ -408,17 +408,17 @@ var steps = [
   },
   function () {
     ok(true, "Retrieving by substring 3");
     var options = {filterBy: ["givenName"],
                    filterOp: "contains",
                    filterValue: properties1.givenName[1].substring(0,3)};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 0, "Found no contact.");
+      is(req.result.length, 0, "Found no contact.");
       next();
     };
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Remove contact2");
     mozContacts.oncontactchange = function(event) {
       is(event.contactID, createResult2.id, "Same contactID");
@@ -432,17 +432,17 @@ var steps = [
   },
   function () {
     ok(true, "Retrieving by substring 4");
     var options = {filterBy: ["givenName"],
                    filterOp: "contains",
                    filterValue: properties1.givenName[1].substring(0,3)};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 0, "Found no contact.");
+      is(req.result.length, 0, "Found no contact.");
       next();
     };
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Deleting database");
     mozContacts.oncontactchange = function(event) {
       is(event.contactID, "undefined", "Same contactID");
@@ -471,17 +471,17 @@ var steps = [
   },
   function () {
     ok(true, "Retrieving by substring tel1");
     var options = {filterBy: ["tel"],
                    filterOp: "contains",
                    filterValue: properties1.tel[1].value.substring(0,5)};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 1, "Found exactly 1 contact.");
+      is(req.result.length, 1, "Found exactly 1 contact.");
       findResult1 = req.result[0];
       ok(findResult1.id == sample_id1, "Same ID");
       checkContacts(createResult1, properties1);
       next();
     };
     req.onerror = onFailure;
   },
   function () {
@@ -597,110 +597,110 @@ var steps = [
   },
   function () {
     ok(true, "Retrieving by substring tel2");
     var options = {filterBy: ["tel"],
                    filterOp: "contains",
                    filterValue: "9876"};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 1, "Found exactly 1 contact.");
+      is(req.result.length, 1, "Found exactly 1 contact.");
       findResult1 = req.result[0];
       ok(findResult1.id == sample_id1, "Same ID");
       checkContacts(createResult1, properties1);
       next();
     };
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Retrieving by substring tel3");
     var options = {filterBy: ["tel"],
                    filterOp: "contains",
                    filterValue: "98763456"};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 1, "Found exactly 1 contact.");
+      is(req.result.length, 1, "Found exactly 1 contact.");
       findResult1 = req.result[0];
       ok(findResult1.id == sample_id1, "Same ID");
       checkContacts(createResult1, properties1);
       next();
     };
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Retrieving by substring 5");
     var options = {filterBy: ["givenName"],
                    filterOp: "contains",
                    filterValue: properties1.givenName[0].substring(0,3)};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 1, "Found exactly 1 contact.");
+      is(req.result.length, 1, "Found exactly 1 contact.");
       findResult1 = req.result[0];
       ok(findResult1.id == sample_id1, "Same ID");
       checkContacts(createResult1, properties1);
       next();
     };
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Retrieving by substring 6");
     var options = {filterBy: ["familyName", "givenName"],
                    filterOp: "contains",
                    filterValue: properties1.givenName[0].substring(0,3)};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 1, "Found exactly 1 contact.");
+      is(req.result.length, 1, "Found exactly 1 contact.");
       findResult1 = req.result[0];
       ok(findResult1.id == sample_id1, "Same ID");
       checkContacts(createResult1, properties1);
       next();
     };
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Retrieving by substring3, Testing multi entry");
     var options = {filterBy: ["givenName", "familyName"],
                    filterOp: "contains",
                    filterValue: properties1.familyName[1].substring(0,3).toLowerCase()};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 1, "Found exactly 1 contact.");
+      is(req.result.length, 1, "Found exactly 1 contact.");
       findResult1 = req.result[0];
       ok(findResult1.id == sample_id1, "Same ID");
       checkContacts(createResult1, properties1);
       next();
     };
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Retrieving all contacts");
     req = mozContacts.find({});
     req.onsuccess = function() {
-      ok(req.result.length == 1, "Found exactly 1 contact.");
+      is(req.result.length, 1, "Found exactly 1 contact.");
       findResult1 = req.result[0];
       ok(findResult1.id == sample_id1, "Same ID");
       checkContacts(createResult1, findResult1);
       ok(findResult1.updated, "Has updated field");
       ok(findResult1.published, "Has published field");
       next();
     }
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Modifying contact1");
     findResult1.impp = properties1.impp = [{value:"phil impp"}];
     req = navigator.mozContacts.save(findResult1);
     req.onsuccess = function () {
       var req2 = mozContacts.find({});
       req2.onsuccess = function() {
-        ok(req2.result.length == 1, "Found exactly 1 contact.");
+        is(req2.result.length, 1, "Found exactly 1 contact.");
         findResult2 = req2.result[0];
         ok(findResult2.id == sample_id1, "Same ID");
         checkContacts(findResult2, properties1);
-        ok(findResult2.impp.length == 1, "Found exactly 1 IMS info.");
+        is(findResult2.impp.length, 1, "Found exactly 1 IMS info.");
         next();
       };
       req2.onerror = onFailure;
     };
     req.onerror = onFailure;
   },
   function() {
     ok(true, "Saving old contact, should abort!");
@@ -710,95 +710,95 @@ var steps = [
   },
   function () {
     ok(true, "Retrieving a specific contact by ID");
     var options = {filterBy: ["id"],
                    filterOp: "equals",
                    filterValue: sample_id1};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 1, "Found exactly 1 contact.");
+      is(req.result.length, 1, "Found exactly 1 contact.");
       findResult1 = req.result[0];
       ok(findResult1.id == sample_id1, "Same ID");
       checkContacts(findResult1, properties1);
       next();
     };
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Retrieving a specific contact by givenName");
     var options = {filterBy: ["givenName"],
                    filterOp: "equals",
                    filterValue: properties1.givenName[0]};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 1, "Found exactly 1 contact.");
+      is(req.result.length, 1, "Found exactly 1 contact.");
       findResult1 = req.result[0];
       ok(findResult1.id == sample_id1, "Same ID");
       checkContacts(findResult1, properties1);
       next();
     }
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Modifying contact2");
     findResult1.impp = properties1.impp = [{value: "phil impp"}];
     req = mozContacts.save(findResult1);
     req.onsuccess = function () {
       var req2 = mozContacts.find({});
       req2.onsuccess = function () {
-        ok(req2.result.length == 1, "Found exactly 1 contact.");
+        is(req2.result.length, 1, "Found exactly 1 contact.");
         findResult1 = req2.result[0];
         ok(findResult1.id == sample_id1, "Same ID");
         checkContacts(findResult1, properties1);
-        ok(findResult1.impp.length == 1, "Found exactly 1 IMS info.");
+        is(findResult1.impp.length, 1, "Found exactly 1 IMS info.");
         next();
       }
       req2.onerror = onFailure;
     };
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Searching contacts by query");
     var options = {filterBy: ["givenName", "email"],
                    filterOp: "contains",
                    filterValue: properties1.givenName[0].substring(0,4)};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 1, "Found exactly 1 contact.");
+      is(req.result.length, 1, "Found exactly 1 contact.");
       findResult1 = req.result[0];
       ok(findResult1.id == sample_id1, "Same ID");
       checkContacts(findResult1, properties1);
       next();
     };
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Searching contacts by query");
     var options = {filterBy: ["givenName", "email"],
                    filterOp: "contains",
                    filterValue: properties1.givenName[0]};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 1, "Found exactly 1 contact.");
+      is(req.result.length, 1, "Found exactly 1 contact.");
       findResult1 = req.result[0];
       ok(findResult1.id == sample_id1, "Same ID");
       checkContacts(findResult1, properties1);
       next();
     };
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Searching contacts with multiple indices");
     var options = {filterBy: ["email", "givenName"],
                    filterOp: "equals",
                    filterValue: properties1.givenName[1]};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 1, "Found exactly 1 contact.");
+      is(req.result.length, 1, "Found exactly 1 contact.");
       findResult1 = req.result[0];
       ok(findResult1.id == sample_id1, "Same ID");
       checkContacts(findResult1, properties1);
       next();
     };
     req.onerror = onFailure;
   },
   function () {
@@ -810,31 +810,31 @@ var steps = [
     req = mozContacts.save(newContact);
     req.onsuccess = function () {
       var options = {filterBy: ["email", "givenName"],
                      filterOp: "contains",
                      filterValue: properties1.givenName[0]};
       // One contact has it in nickname and the other in email
       var req2 = mozContacts.find(options);
       req2.onsuccess = function () {
-        ok(req2.result.length == 2, "Found exactly 2 contacts.");
+        is(req2.result.length, 2, "Found exactly 2 contacts.");
         ok(req2.result[0].id != req2.result[1].id, "Different ID");
         next();
       }
       req2.onerror = onFailure;
     };
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Deleting contact" + findResult1.id);
     req = mozContacts.remove(findResult1);
     req.onsuccess = function () {
       var req2 = mozContacts.find({});
       req2.onsuccess = function () {
-        ok(req2.result.length == 1, "One contact left.");
+        is(req2.result.length, 1, "One contact left.");
         findResult1 = req2.result[0];
         next();
       }
       req2.onerror = onFailure;
     }
     req.onerror = onFailure;
   },
   function () {
@@ -869,74 +869,74 @@ var steps = [
       next();
     };
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Retrieving all contacts");
     req = mozContacts.find({})
     req.onsuccess = function () {
-      ok(req.result.length == 2, "Found exactly 2 contact.");
+      is(req.result.length, 2, "Found exactly 2 contact.");
       next();
     }
     req.onerror = onFailure;
   },
   function () {
     console.log("Searching contacts by query1");
     var options = {filterBy: ["givenName", "email"],
                    filterOp: "contains",
                    filterValue: properties1.givenName[0].substring(0, 4)}
     req = mozContacts.find(options)
     req.onsuccess = function () {
-      ok(req.result.length == 1, "Found exactly 1 contact.");
+      is(req.result.length, 1, "Found exactly 1 contact.");
       findResult1 = req.result[0];
       ok(findResult1.id == sample_id1, "Same ID");
       checkContacts(findResult1, createResult1);
       next();
     }
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Searching contacts by query2");
     var options = {filterBy: ["givenName", "email"],
                    filterOp: "contains",
                    filterValue: properties2.givenName[0].substring(0, 4)};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 1, "Found exactly 1 contact.");
+      is(req.result.length, 1, "Found exactly 1 contact.");
       findResult1 = req.result[0];
-      ok(findResult1.adr.length == 2, "Adr length 2");
+      is(findResult1.adr.length, 2, "Adr length 2");
       checkContacts(findResult1, createResult2);
       next();
     }
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Searching contacts by tel");
     var options = {filterBy: ["tel"],
                    filterOp: "contains",
                    filterValue: properties2.tel[0].value.substring(0, 7)};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 1, "Found exactly 1 contact.");
+      is(req.result.length, 1, "Found exactly 1 contact.");
       findResult1 = req.result[0];
       ok(findResult1.id == sample_id2, "Same ID");
       checkContacts(findResult1, createResult2);
       next();
     }
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Searching contacts by email");
     var options = {filterBy: ["email"],
                    filterOp: "contains",
                    filterValue: properties2.email[0].value.substring(0, 4)};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 1, "Found exactly 1 contact.");
+      is(req.result.length, 1, "Found exactly 1 contact.");
       findResult1 = req.result[0];
       ok(findResult1.id == sample_id2, "Same ID");
       checkContacts(findResult1, createResult2);
       next();
     }
     req.onerror = onFailure;
   },
   function () {
@@ -968,65 +968,65 @@ var steps = [
       next();
     };
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Retrieving all contacts");
     req = mozContacts.find({});
     req.onsuccess = function () {
-      ok(req.result.length == 100, "100 Entries.");
+      is(req.result.length, 100, "100 Entries.");
       next();
     }
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Retrieving all contacts with limit 10");
     var options = { filterLimit: 10 };
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 10, "10 Entries.");
+      is(req.result.length, 10, "10 Entries.");
       next();
     }
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Retrieving all contacts with limit 10 and sorted");
     var options = { filterLimit: 10,
                     sortBy: 'FamilyName',
                     sortOrder: 'descending' };
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 10, "10 Entries.");
+      is(req.result.length, 10, "10 Entries.");
       next();
     }
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Retrieving all contacts2");
     var options = {filterBy: ["givenName"],
                    filterOp: "contains",
                    filterValue: properties1.givenName[0].substring(0, 4)};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 100, "100 Entries.");
+      is(req.result.length, 100, "100 Entries.");
       checkContacts(createResult1, req.result[99]);
       next();
     }
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Retrieving all contacts3");
     var options = {filterBy: ["givenName", "tel", "email"],
                    filterOp: "contains",
                    filterValue: properties1.givenName[0].substring(0, 4),
                    filterLimit: 15 };
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 15, "15 Entries.");
+      is(req.result.length, 15, "15 Entries.");
       checkContacts(createResult1, req.result[10]);
       next();
     }
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Deleting database");
     req = mozContacts.clear();
@@ -1066,33 +1066,33 @@ var steps = [
   },
   function () {
     ok(true, "Retrieving all contacts");
     var options = {filterBy: ["givenName"],
                    filterOp: "contains",
                    filterValue: properties2.givenName[0].substring(0, 4)};
     req = mozContacts.find({});
     req.onsuccess = function () {
-      ok(req.result.length == 2, "2 Entries.");
+      is(req.result.length, 2, "2 Entries.");
       next();
     }
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Search with redundant fields should only return 1 contact");
     createResult1 = new mozContact();
     createResult1.init({name: "XXX", givenName: "XXX", email: [{value: "XXX"}], tel: {value: "XXX"}});
     req = mozContacts.save(createResult1);
     req.onsuccess = function() {
       var options = {filterBy: [],
                      filterOp: "equals",
                      filterValue: "XXX"};
       var req2 = mozContacts.find(options);
       req2.onsuccess = function() {
-        ok(req2.result.length == 1, "1 Entry");
+        is(req2.result.length, 1, "1 Entry");
         next();
       }
       req2.onerror = onFailure;
     }
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Deleting database");
@@ -1215,17 +1215,17 @@ var steps = [
     createResult1.init({givenName: "customTest", yyy: "XXX"});
     req = mozContacts.save(createResult1);
     req.onsuccess = function() {
       var options = {filterBy: [],
                      filterOp: "equals",
                      filterValue: "customTest"};
       var req2 = mozContacts.find(options);
       req2.onsuccess = function() {
-        ok(req2.result.length == 1, "1 Entry");
+        is(req2.result.length, 1, "1 Entry");
         checkStrArray(req2.result.givenName, "customTest", "same name");
         ok(req2.result.yyy === undefined, "custom property undefined");
         next();
       }
       req2.onerror = onFailure;
     }
     req.onerror = onFailure;
   },
@@ -1252,30 +1252,30 @@ var steps = [
   },
   function () {
     ok(true, "Test category search with contains");
     var options = {filterBy: ["category"],
                    filterOp: "contains",
                    filterValue: properties2.category[0]};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 1, "1 Entry.");
+      is(req.result.length, 1, "1 Entry.");
       checkContacts(req.result[0], createResult2);
       next();
     }
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Test category search with equals");
     var options = {filterBy: ["category"],
                    filterOp: "equals",
                    filterValue: properties2.category[0]};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 1, "1 Entry.");
+      is(req.result.length, 1, "1 Entry.");
       checkContacts(req.result[0], createResult2);
       next();
     }
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Deleting database");
     req = mozContacts.clear()
@@ -1299,17 +1299,17 @@ var steps = [
   },
   function () {
     ok(true, "Test category search with equals");
     var options = {filterBy: ["givenName"],
                    filterOp: "contains",
                    filterValue: "5"};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 1, "1 Entry.");
+      is(req.result.length, 1, "1 Entry.");
       checkContacts(req.result[0], createResult1);
       next();
     }
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Deleting database");
     req = mozContacts.clear()
@@ -1400,66 +1400,66 @@ var steps = [
   },
   function () {
     ok(true, "Test numbersOnly search");
     var options = {filterBy: ["givenName", "tel"],
                    filterOp: "contains",
                    filterValue: "a"};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 1, "1 Entry.");
+      is(req.result.length, 1, "1 Entry.");
       checkContacts(req.result[0], createResult1);
       next();
     }
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Test numbersOnly search");
     var options = {filterBy: ["givenName", "tel"],
                    filterOp: "contains",
                    filterValue: "b"};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 0, "0 Entries.");
+      is(req.result.length, 0, "0 Entries.");
       next();
     }
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Test numbersOnly search");
     var options = {filterBy: ["givenName", "tel"],
                    filterOp: "contains",
                    filterValue: "1a"};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 0, "0 Entries.");
+      is(req.result.length, 0, "0 Entries.");
       next();
     }
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Test numbersOnly search");
     var options = {filterBy: ["givenName", "tel"],
                    filterOp: "contains",
                    filterValue: "1(23)"};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 1, "1 Entry.");
+      is(req.result.length, 1, "1 Entry.");
       next();
     }
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Test numbersOnly search");
     var options = {filterBy: ["givenName", "tel"],
                    filterOp: "contains",
                    filterValue: "1(23)a"};
     req = mozContacts.find(options);
     req.onsuccess = function () {
-      ok(req.result.length == 0, "0 Entries.");
+      is(req.result.length, 0, "0 Entries.");
       next();
     }
     req.onerror = onFailure;
   },
   function () {
     ok(true, "Deleting database");
     req = mozContacts.clear()
     req.onsuccess = function () {