W3C home > Mailing lists > Public > public-device-apis@w3.org > May 2011

First test cases for Contacts API; JavaScript-based prototype

From: Dominique Hazael-Massieux <dom@w3.org>
Date: Tue, 24 May 2011 10:22:10 +0200
To: public-device-apis@w3.org
Message-ID: <1306225338.3237.13.camel@altostratustier>
Hi,

As per my ACTION-298, I have started working on a test suite for our
Contacts API; I have developed so far 7 simple test cases, available at:
http://dev.w3.org/2009/dap/contacts/tests/test-cases/

Note that if you don't have a system supporting navigator.contacts,
these test cases won't give any useful result (but see below on
prototype implementation.)

The tests use the HTML/WebApps Test Harness [1] as we had agreed on. The
tests that look at the returned data rely on contacts data that need to
be imported before running the test suites and which are linked (as
vcard data) from the relevant test cases.

Since developing test cases without a matching implementation is no fun,
I've also developed a simple JavaScript prototype (with an hardcoded
addressbook at this time), attached to this message. It currently passes
the 7 test cases :) It can be used with the test cases by putting it in
the parent directory of the "test-cases" directory (since the test cases
link to a "../impl.js"). I'm not sure if I should put it in the
repository, and if so, where. It could probably be used as a basis for
implementations relying on remote sources for contacts.

Unsurprisingly, I've found some bugs in the spec while developing the
test cases and the implementation; I wonder if I should send them now or
as part of the Last Call period.

Also, I went with dev.w3.org as a repository to host the test suite, but
the others groups are using the mercurial-based decentralized versioning
control system at dvcs.w3.org (with a visible check-out at
w3c-test.org); I think it would make sense to align with that, but since
that involves using another system, I didn't want to proceed with that
without some notion on how confident potential test contributors would
feel with that.

I would like to start marking up the Contacts API spec with test
assertions markers to be able to compute coverage and get an idea of
what needs testing, but again, I'm hesitant to do that while the spec is
on path towards Last Call.

Feedback and comments would be most welcomed.

Dom

1. http://w3c-test.org/resources/testharness.js




Received on Tuesday, 24 May 2011 08:22:32 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:14:20 GMT