adapted to change of semantics in empty fields parameter
authorDominique Hazaël-Massieux <dom@w3.org>
Wed, 25 May 2011 14:26:11 +0200
changeset 4 d793e6e91939
parent 3 6c5025312080
child 5 c6082e46771d
adapted to change of semantics in empty fields parameter
contacts/tests/test-cases/find_empty_fields.html
--- a/contacts/tests/test-cases/find_empty_fields.html	Wed May 25 11:51:17 2011 +0200
+++ b/contacts/tests/test-cases/find_empty_fields.html	Wed May 25 14:26:11 2011 +0200
@@ -11,31 +11,15 @@
    <p>Please select at least one contact when prompted.</p>
    <div id="log"></div>
    <script>
-     var t = async_test("Empty contact results from empty fields search", {timeout: 15000});
-     var nullContact = {"id": null,
-	"displayName": null,
-	"name": null,
-	"nickname": null,
-	"phoneNumbers": null,     
-	"emails": null,
-	"addresses": null, 
-	"ims": null,
-	"organizations": null,
-	"revision": null, 
-	"birthday": null,
-	"gender": null,
-	"note": null, 
-	"photos": null,
-        "categories": null, 
-	"urls": null, 
-	"timezone": null};
-
+     var t = async_test("Error callback  when search with empty fields", {timeout: 15000});
      navigator.contacts.find([], function (contacts) {
          t.step(function () {
-           for (var i in contacts) {
-             assert_is_contact(contacts[i]);
-             assert_contact_same_as(contacts[i], nullContact);
-           }
+            assert_unreached();
+         });
+         t.done();
+     }, function (err) {
+         t.step(function () {
+           assert_equals(err.code, navigator.contacts.ContactError.INVALID_ARGUMENT_ERROR);
            t.done();
          });
      });