import from http://dev.w3.org/2009/dap/contacts/tests/
authorDominique Hazaël-Massieux <dom@w3.org>
Wed, 25 May 2011 11:27:52 +0200
changeset 0 6917065f74db
child 1 518970294839
import from http://dev.w3.org/2009/dap/contacts/tests/
contacts/tests/Overview.html
contacts/tests/test-cases/common.js
contacts/tests/test-cases/find_empty_fields.html
contacts/tests/test-cases/find_one_result.html
contacts/tests/test-cases/find_two-results.html
contacts/tests/test-cases/find_with_array_composed_field.html
contacts/tests/test-cases/find_with_composed_field.html
contacts/tests/test-cases/jane.vcf
contacts/tests/test-cases/joe.vcf
contacts/tests/test-cases/navigator_implements_contacts.html
contacts/tests/test-cases/single_task_queue.html
contacts/tests/test-suite.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/tests/Overview.html	Wed May 25 11:27:52 2011 +0200
@@ -0,0 +1,289 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head><meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
+  <meta content="HTML Tidy for Linux/x86 (vers 11 February 2007), see
+  www.w3.org" name="generator" />
+  <!-- processor: http://www.w3.org/Style/Group/css3-src/bin/postprocess -->
+
+  <title>Test Suite for the Contacts API</title>
+
+  <style type="text/css">
+/*<![CDATA[*/
+
+  body {
+        font-size: 1em;
+  }
+  dfn.external {
+        font-weight: normal;
+        font-style: italic;
+  }
+  pre.idl {
+        border:solid thin;
+        background:#eee;
+        color:#000;
+        padding:0.5em
+  }
+  pre.idl :link, pre.idl :visited {
+        color:inherit;
+        background:transparent
+  }
+  dfn {
+        font-style:normal;
+        font-weight:bolder;
+  }
+  em.ct {
+        text-transform:uppercase;
+        font-style:normal;
+        font-weight:normal;
+        color:#990000
+  }
+  .issue {
+        padding:1em;
+        border: 1px solid red;
+        background:#FFC;
+  }
+  .example {
+        border-left: double;
+        background-color: #fafafa;
+  }
+  .note {
+        margin-left: 2em;
+        border: 2px solid #CFF6D9;
+        padding: .5em;
+        padding-top: 0px;
+        padding-bottom: 1em;
+        color: #444;
+        background-color: #E2FFF0;
+        font-size: 0.8em;
+  }
+  dd > dl {
+        margin:0px;
+        padding:0px
+  }
+  code {
+        font-size: 1.1em;
+        text-decoration: none;
+        color: #002108;
+  }
+  a:link code, a:visited code, a > code {
+        color:green;
+        text-decoration: none;
+        border-bottom: 0;
+  }
+  .dir_listing li {
+        list-style-type:none;
+        font-family: Tahoma, Arial, Helvetica, sans-serif;
+  }
+  span span {
+        background-color: yellow;
+  }
+  li.folder {
+        list-style-image:url(../images/expanded_folder.png)
+  }
+  .authorguide {
+        border: 1px solid #67BBB5;
+        background:#E8EBFC;
+        padding: 1em;
+        font-size: .9em;
+        color: #003;
+  }
+  .authorguide strong {
+        padding: .2em;
+        color: #003;
+        border: none;
+        position:relative;
+        display: block;
+        width: 200px;
+        left: -1.5em;
+        top: -1.5em;
+        background: #C6D8E6;
+        text-align: center;
+  }
+  span.notetitle {
+        padding: .2em;
+        color:#066;
+        border: none;
+        position:relative;
+        display: block;
+        width: 40px;
+        left: -1.5em;
+        top: -.7em;
+        background: #F2FFF1;
+        padding-left: .2em;
+        text-align: center;
+  }
+  var {
+        font-family: "Lucida Console", Monaco, monospace;
+  }
+  li.folder li {
+        list-style-image: none;
+  }
+  .dir_listing .comment {
+        border: none;
+        font-family:"Courier New", Courier, monospace;
+        color: #669933;
+  }
+  .dir_listing img {
+        vertical-align: middle;
+  }
+  .redNote {
+        color: red;
+  }
+  dl.procedure dt {
+        font-weight: normal;
+  }
+  .editorialNote {
+        padding: 5px;
+        background-color: #F3B9B7;
+        border: 3px dashed #FFEEB8;
+        color: #444;
+        font-size:0.8em;
+  }
+  .waitingon {
+        border-left: 10px solid #FFC;
+        margin: -10px;
+  }
+  .waitingon:before {
+        display: block;
+        content: "Status: waiting on input.";
+        border: solid thin #090;
+        position: absolute;
+        left: 4px;
+        background-color: #FC0;
+        width: 50px;
+        font-size: 9px;
+        color: #000;
+        padding: 2px;
+  }
+  li>ol {
+        list-style-type:upper-alpha;
+  }
+  span {
+        border: 1px dotted #C3C;
+  }
+
+  #ta td {
+      vertical-align: top;
+  }
+
+    /*]]>*/
+  </style>
+
+   <link href="http://www.w3.org/StyleSheets/TR/base" rel="stylesheet"
+  type="text/css" />
+ <style type="text/css">
+<!--
+em.ct1 {	text-transform:uppercase;
+	font-style:normal;
+	font-weight:normal;
+}
+em.ct-samp {	text-transform:uppercase;
+	font-style:normal;
+	font-weight:normal;
+}
+-->
+ </style>
+ </head>
+
+<body>
+<div class="head">
+   <p><a href="http://www.w3.org/"><img alt="W3C" height="48"
+    src="http://www.w3.org/Icons/w3c_home" width="72" /></a></p>
+   <!--end-logo--> <!--end-logo-->
+<h1 class="head"> Test Suite for the <cite><a href="../">Contacts API</a></cite></h1>
+<dl>
+   <dt>Maintainers:</dt>
+     <dd><a href="http://www.w3.org/People/Dom/">Dominique Hazael-Massieux</a>, W3C</dd>
+   </dl>
+  <p class="copyright"><a
+    href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>
+    &copy; 2011 <a href="http://www.w3.org/"><acronym title="World Wide Web
+    Consortium">W3C</acronym></a><sup>&reg;</sup> (<a
+    href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute
+    of Technology">MIT</acronym></a>, <a
+    href="http://www.ercim.eu/"><acronym title="European Research Consortium
+    for Informatics and Mathematics">ERCIM</acronym></a>, <a
+    href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a
+    href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
+    <a
+    href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
+
+    and <a
+    href="http://www.w3.org/Consortium/Legal/copyright-documents">document
+    use</a> rules apply.</p>
+</div>
+<hr />
+<h2 id="prologue">Prologue</h2>
+ <p>This document provides an overview of the test suite for the <a
+   href="http://www.w3.org/TR/contacts-api/">Contacts API</a>  specification. The Working Group
+has developed this test suite so to have a test case for every conformance requirement in the specification. </p>
+ <p><strong>Please note that this document puts a number <a href="requirements">requirements</a> on user agents, which must be supported in order to be able to run the tests. </strong></p>
+ <p>The keywords <dfn title=""><em class="ct-samp">must</em></dfn>, <dfn title=""><em class="ct-samp">must not</em></dfn>, <dfn title=""><em class="ct-samp">should</em></dfn>, <dfn title=""><em class="ct-samp">recommended</em></dfn>, <dfn title=""><em class="ct-samp">may</em></dfn> and <dfn title=""><em class=
+  "ct-samp">optional</em></dfn> in this document are to be interpreted as described in <span>[RFC2119]</span>.</p>
+ <h2>Status of this Test Suite</h2>
+ <p>Publication of this test suite does not imply endorsement by the W3C Membership. This   test suite is constantly evolving and the tests within in may be updated, replaced or obsoleted by other test at any time. When new tests become available, old obsoleted tests should be discarded. It is inappropriate to cite this document as other than a work in progress.</p>
+<h2>Licenses and Contributions</h2>
+ 
+<p>This test suite is distributed under the <a 
+href="http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright">W3C test 
+suite licensing scheme</a>. Note that claims of performance can only be made 
+against unaltered tests. </p>
+<p>The Working Group encourages the public and W3C 
+  members to contribute tests. To contribute to a W3C Test Suite, see the <a 
+href="http://www.w3.org/2004/10/27-testcases">policies and contribution 
+    forms</a>.</p>
+<h2 id="user-agent-requirements">Method used for testing </h2>
+<p>This specification adheres to the guidelines described in  <cite><a href="http://www.w3.org/TR/test-methodology/">A Method for Writing Testable Conformance Requirements</a></cite>. Please refer to that document for terminology and the approach that was taken to create this test suite. </p>
+<h2 id="requirements">User Agent Requirements
+</h2>
+ <p>In addition to the specifications required to be supported by user
+   agents by the P&amp;C specification, some tests require, at a minimum,
+</p>
+ <ul>
+   <li><span>[HTML4.01]</span>
+     <ul>
+       <li>Although the HTML-based tests templates are written to conform to
+         the <a href="#html5">[HTML]</a> specification, the templates are
+         compatible with <span>[HTML4.01]</span>.</li>
+     </ul>
+   </li>
+   <li><span>[CSS1]</span>
+     <ul>
+       <li>The <code>background-color</code> property and the colors: <code>red</code>, <code>green</code>, and <code>#666</code>.</li>
+     </ul>
+   </li>
+ </ul>
+ <p>Without support for the above specifications, it may not be possible for a user agent to effectively run the test cases of the test suite (and false results may occur). 
+</p>
+<h2 id="how-to-write-a-test">Automated testing</h2>
+<p>The Working Group does not provide an automated testing solution for
+   this specification. However, every test case in the test suite is
+  available through the W3C's CVS repository.</p>
+<h2>How to get the tests and test descriptions</h2>
+<p><strong>Before you run the tests, please make sure you read this document thoroughly.</strong></p>
+<p>Tests can be downloaded using CVS using the following commands:</p>
+<pre>CVSROOT=:pserver:anonymous@dev.w3.org:/sources/public cvs login 
+</pre>
+
+<p>Then enter the password <kbd>anonymous</kbd> when prompted, and then: </p>
+<pre>
+CVSROOT=:pserver:anonymous@dev.w3.org:/sources/public cvs checkout 2009/dap/contacts/tests/
+</pre>
+<p>The Working Group also
+  provides an <a href="test-suite.xml">XML file</a> that describes each test case, links to each test
+  case, and identifies the assertion being tested.</p>
+<h2>Tests</h2>
+<p><strong>Vendors doing testing are strongly encouraged to submit their results to the working group</strong>. Having evidence that all tests in the test suite can be passed allows the specification to proceed along the W3C's Recommendation track. <!--See also the <a href="../imp-report/">implementation report</a>. --></p>
+
+<h2 id="testedAssertions">&nbsp;</h2>
+ <div id="tests"></div>
+
+
+<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
+<script src="http://dev.w3.org/2006/waf/widgets-shared/javascript/ShowTestSuite.js"></script>
+
+</body>
+
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/tests/test-cases/common.js	Wed May 25 11:27:52 2011 +0200
@@ -0,0 +1,74 @@
+var _contact_fields = [{"type": "string",
+					     "value": "string",
+					     "pref": "boolean"
+					    }
+			   ];
+var _contact_properties = {"id": "opaquestring",
+			   "displayName": "string",
+			   "name": {"formatted": "string",
+				    "familyName": "string",
+				    "givenName": "string",
+				    "middleName": "string",
+				    "honorificPrefix": "string",
+				    "honorificSuffix": "string"},
+			   "nickname": "string",
+			   "phoneNumbers": _contact_fields,
+			   "emails": _contact_fields,
+			   "addresses": [{
+					     "formatted": "string",
+					     "streetAddress": "string",
+					     "locality": "string",
+					     "postalCode": "string",
+					     "region": "string",
+					     "streetAddress": "string"
+					 }], 
+			   "ims": _contact_fields,
+			   "organizations": [{
+						 "name": "string",
+						 "department": "string",
+						 "title": "string"
+					     }],
+			   "revision": "date",
+			   "birthday": "date",
+			   "gender": "string",
+			   "note": "string",
+			   "photos": _contact_fields,
+			   "categories": ["string"],
+			   "urls": _contact_fields,
+			   "timezone": "string"};
+
+function assert_is_contact(actual) {
+    for (var i in _contact_properties) {
+	assert_own_property(actual, i);
+    }
+}
+
+function assert_contact_same_as(actual, expected) {
+    for (var field in _contact_properties) {
+	_compare_field(actual[field], expected[field], field, _contact_properties[field]);
+    }
+}
+
+function _compare_field(actual, expected, fieldname, datatype) {
+    if (expected == null) {
+	assert_equals(actual, expected, "Comparing values of " + fieldname);	
+    } else if (datatype == "string" || datatype == "date" || datatype=="opaquestring") {
+	if (expected == null || datatype != "opaquestring") {
+	    assert_equals(actual, expected, "Comparing values of " + fieldname);
+	}
+    } else if (datatype instanceof Array) {
+        for (var i in expected) {
+	    _compare_field(actual[i], expected[i], fieldname, datatype[0]);
+	}
+    } else if (typeof(datatype)=='object') {
+        for (var i in  actual) {
+	    assert_own_property(expected, i, "Unexpected property " + i + " in " + fieldname);
+            _compare_field(actual[i], expected[i], fieldname + "." + i, "string");
+        }
+	for (var j in expected) {
+	    assert_own_property(actual, j, "Missing property " + j + " in " + fieldname);
+	}
+    } else {
+	assert_unreached( "Unknown datatype to compare:" + datatype);		
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/tests/test-cases/find_empty_fields.html	Wed May 25 11:27:52 2011 +0200
@@ -0,0 +1,44 @@
+<!doctype html>
+<html>
+ <head>
+  <title>Contacts API - empty fields list implies null contacts</title>
+  <script src="../impl.js"></script>
+  <script src="http://w3c-test.org/html/tests/resources/testharness.js"></script>
+  <script src="http://w3c-test.org/html/tests/resources/testharnessreport.js"></script>
+  <script src="common.js"></script>
+ </head>
+ <body>
+   <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};
+
+     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);
+           }
+           t.done();
+         });
+     });
+  </script>
+ </body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/tests/test-cases/find_one_result.html	Wed May 25 11:27:52 2011 +0200
@@ -0,0 +1,48 @@
+<!doctype html>
+<html>
+ <head>
+  <title>Contacts API - Compare one result with expected result</title>
+  <script src="../impl.js"></script>
+  <script src="http://w3c-test.org/html/tests/resources/testharness.js"></script>
+  <script src="http://w3c-test.org/html/tests/resources/testharnessreport.js"></script>
+  <script src="common.js"></script>
+ </head>
+ <body>
+   <p>This test assumes that the <a href="joe.vcf">contacts data for Joe Lambda</a> have been loaded in the underlying addressbook.</p>
+   <p>Please select Joe Lambda when prompted.</p>
+   <div id="log"></div>
+   <script>
+     var t = async_test("Joe Lambda properly returned", {timeout: 15000});
+     var joeContact = {"id": "whatever",
+	"displayName": "Joe Lambda",
+	"name": { "familyName": "Lambda",
+		  "formatted": "Joe Lambda",
+		  "givenName": "Joe",
+		  "honorificPrefix": null,
+		  "honorificSuffix": null,
+		  "middleName": null},
+	"nickname": "Joe",
+	"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};
+
+     navigator.contacts.find(["id", "displayName", "name", "nickname"], function (contacts) {
+         t.step(function () {
+           assert_is_contact(contacts[0]);
+           assert_contact_same_as(contacts[0], joeContact);
+           t.done();
+         });
+     });
+  </script>
+ </body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/tests/test-cases/find_two-results.html	Wed May 25 11:27:52 2011 +0200
@@ -0,0 +1,86 @@
+<!doctype html>
+<html>
+ <head>
+  <title>Contacts API - Compare two results with expected results</title>
+  <script src="../impl.js"></script>
+  <script src="http://w3c-test.org/html/tests/resources/testharness.js"></script>
+  <script src="http://w3c-test.org/html/tests/resources/testharnessreport.js"></script>
+  <script src="common.js"></script>
+ </head>
+ <body>
+   <p>This test assumes that the <a href="joe.vcf">contacts data for Joe Lambda</a> and <a href="jane.vcf">for Jane Doe</a>  have been loaded in the underlying addressbook.</p>
+   <p>Please select both Joe Lambda and Jane Doe (and only them) when prompted.</p>
+   <div id="log"></div>
+   <script>
+     var t = async_test("Joe Lambda and Jane Doe properly returned", {timeout: 15000});
+     var joeContact = {"id": "whatever",
+	"displayName": "Joe Lambda",
+	"name": { "familyName": "Lambda",
+		  "formatted": "Joe Lambda",
+		  "givenName": "Joe",
+		  "honorificPrefix": null,
+		  "honorificSuffix": null,
+		  "middleName": null},
+	"nickname": "Joe",
+	"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 janeContact = {"id": "whatever",
+	"displayName": "Jane Doe",
+	"name": { "familyName": "Doe",
+		  "formatted": "Jane Doe",
+		  "givenName": "Jane",
+		  "honorificPrefix": null,
+		  "honorificSuffix": null,
+		  "middleName": null},
+	"nickname": "Jane",
+	"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};
+
+     navigator.contacts.find(["id", "displayName", "name", "nickname"], function (contacts) {
+         t.step(function () {
+           assert_equals(contacts.length, 2, "Expected two results from query");
+           assert_is_contact(contacts[0]);
+           assert_is_contact(contacts[1]);
+         });
+         var firstContactGiven = contacts[0]["name"]["givenName"];
+         var firstContact = joeContact;
+         var secondContact = janeContact;
+         if (firstContactGiven == "Jane") {
+            var firstContact = janeContact;
+            var secondContact = joeContact;     
+         } else if (firstContactGiven != "Joe") {
+            assert_unreached("Unexpected given name in results: " + firstContactGiven);
+         }
+         t.step(function () {
+           assert_contact_same_as(contacts[0], firstContact);
+         });
+         t.step(function() {
+           assert_contact_same_as(contacts[1], secondContact);
+           t.done();
+         });
+     }, null, {multiple: true});
+  </script>
+ </body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/tests/test-cases/find_with_array_composed_field.html	Wed May 25 11:27:52 2011 +0200
@@ -0,0 +1,45 @@
+<!doctype html>
+<html>
+ <head>
+  <title>Contacts API - Find within an array of composed fields</title>
+  <script src="../impl.js"></script>
+  <script src="http://w3c-test.org/html/tests/resources/testharness.js"></script>
+  <script src="http://w3c-test.org/html/tests/resources/testharnessreport.js"></script>
+  <script src="common.js"></script>
+ </head>
+ <body>
+   <p>This test assumes that the <a href="joe.vcf">contacts data for Joe Lambda</a> have been loaded in the underlying addressbook.</p>
+   <p>Please select Joe Lambda when prompted.</p>
+   <div id="log"></div>
+   <script>
+     var t = async_test("address info properly returned", {timeout: 15000});
+     var joeContact = {"id": null,
+	"displayName": null,
+        "name": {formatted: "Joe Lambda", familyName: null, givenName: null, honorificPrefix: null, honorificSuffix: null, middleName: null},
+	"nickname": null,
+	"phoneNumbers": null,     
+	"emails": null,
+	"addresses": [
+           {"formatted": null, "streetAddress": null, "locality": "Raleigh", "region": null, "postalCode": null, "country": "U.S.A."}
+        ],
+	"ims": null,
+	"organizations": null,
+	"revision": null, 
+	"birthday": null,
+	"gender": null,
+	"note": null, 
+	"photos": null,
+        "categories": null, 
+	"urls": null, 
+	"timezone": null};
+
+     navigator.contacts.find(["name.formatted", "addresses.locality", "addresses.country"], function (contacts) {
+         t.step(function () {
+           assert_is_contact(contacts[0]);
+           assert_contact_same_as(contacts[0], joeContact);
+           t.done();
+         });
+     });
+  </script>
+ </body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/tests/test-cases/find_with_composed_field.html	Wed May 25 11:27:52 2011 +0200
@@ -0,0 +1,48 @@
+<!doctype html>
+<html>
+ <head>
+  <title>Contacts API - Find with composed field in search</title>
+  <script src="../impl.js"></script>
+  <script src="http://w3c-test.org/html/tests/resources/testharness.js"></script>
+  <script src="http://w3c-test.org/html/tests/resources/testharnessreport.js"></script>
+  <script src="common.js"></script>
+ </head>
+ <body>
+   <p>This test assumes that the <a href="joe.vcf">contacts data for Joe Lambda</a> have been loaded in the underlying addressbook.</p>
+   <p>Please select Joe Lambda when prompted.</p>
+   <div id="log"></div>
+   <script>
+     var t = async_test("formatted name 'Joe Lambda' properly returned", {timeout: 15000});
+     var joeContact = {"id": null,
+	"displayName": null,
+	"name": { "familyName": null,
+		  "formatted": "Joe Lambda",
+		  "givenName": null,
+		  "honorificPrefix": null,
+		  "honorificSuffix": null,
+		  "middleName": 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};
+
+     navigator.contacts.find(["name.formatted"], function (contacts) {
+         t.step(function () {
+           assert_is_contact(contacts[0]);
+           assert_contact_same_as(contacts[0], joeContact);
+           t.done();
+         });
+     });
+  </script>
+ </body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/tests/test-cases/jane.vcf	Wed May 25 11:27:52 2011 +0200
@@ -0,0 +1,12 @@
+BEGIN:vCard
+VERSION:3.0
+FN:Jane Doe
+ORG:ACME Inc.
+ADR;TYPE=WORK,POSTAL,PARCEL:;;2225 Acme Drive
+ ;Raleigh;NC;27613-3502;U.S.A.
+TEL;TYPE=VOICE,MSG,WORK:+1-808-555-9515
+TEL;TYPE=FAX,WORK:+1-808-555-9564
+EMAIL;TYPE=INTERNET,PREF:jdoe@example.com
+EMAIL;TYPE=INTERNET:jdoe@example.net
+URL:http://example.net/~jdoe/
+END:vCard
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/tests/test-cases/joe.vcf	Wed May 25 11:27:52 2011 +0200
@@ -0,0 +1,12 @@
+BEGIN:vCard
+VERSION:3.0
+FN:Joe Lambda
+ORG:ACME Inc.
+ADR;TYPE=WORK,POSTAL,PARCEL:;;2225 Acme Drive
+ ;Raleigh;NC;27613-3502;U.S.A.
+TEL;TYPE=VOICE,MSG,WORK:+1-919-555-9515
+TEL;TYPE=FAX,WORK:+1-919-555-9564
+EMAIL;TYPE=INTERNET,PREF:jlambda@example.com
+EMAIL;TYPE=INTERNET:jlambda@example.net
+URL:http://example.net/~jlambda/
+END:vCard
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/tests/test-cases/navigator_implements_contacts.html	Wed May 25 11:27:52 2011 +0200
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+ <head>
+  <title>Contacts API - navigator implements contacts.find</title>
+  <script src="../impl.js"></script>
+  <script src="http://w3c-test.org/html/tests/resources/testharness.js"></script>
+  <script src="http://w3c-test.org/html/tests/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+   <div id="log"></div>
+   <script>
+     test(function () { assert_own_property(window.navigator, "contacts", "window.navigator has a contacts property"); });
+     test(function () { assert_true(!!window.navigator.contacts.find, "window.navigator.contacts has a find method"); });
+  </script>
+ </body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/tests/test-cases/single_task_queue.html	Wed May 25 11:27:52 2011 +0200
@@ -0,0 +1,36 @@
+<!doctype html>
+<html>
+ <head>
+  <title>Contacts API - Single Task Queue</title>
+  <script src="../impl.js"></script>
+  <script src="http://w3c-test.org/html/tests/resources/testharness.js"></script>
+  <script src="http://w3c-test.org/html/tests/resources/testharnessreport.js"></script>
+  <script src="common.js"></script>
+ </head>
+ <body>
+   <div id="log"></div>
+   <script>
+     var t = async_test("Starting two find in a row triggers a pending operation error", {timeout: 15000});
+     navigator.contacts.find(["name.formatted"], success);
+     navigator.contacts.find(["name.formatted"], success2, error);
+
+     function success(contact) {
+        setTimeout( function () {
+        }, 5000);
+     }
+
+     function success2(contact) {
+        t.step(function () {
+          assert_unreached();
+        });
+     }
+
+     function error(err) {
+        t.step(function () {
+          assert_equals(err.code, navigator.contacts.ContactError.PENDING_OPERATION_ERROR);
+        });
+        t.done();
+     }
+  </script>
+ </body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts/tests/test-suite.xml	Wed May 25 11:27:52 2011 +0200
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<testsuite for="http://dev.w3.org/2009/dap/contacts/tests/">
+
+<test id="aa" for="ta-aa" src="test-cases/navigator_implements_contacts.html">
+Tests that the UA implements navigator.contacts.findContacts
+</test>
+<test id="ab" for="ta-ab" src="test-cases/find_empty_fields.html">
+Tests that the UA returns empty contacts when request sent with empty list of fields
+</test>
+<test id="ac" for="ta-ac" src="test-cases/find_one_result.html">
+Tests that the UA returns expected results for pre-defined contact
+</test>
+<test id="ac" for="ta-ac" src="test-cases/find_with_composed_field.html">
+Tests that the UA deals correctly with composed fields
+</test>
+
+</testsuite>