B2G/QA/WebAPI Test Plan/Contacts: Difference between revisions

no edit summary
(Created page with "**TBD**")
 
No edit summary
Line 1: Line 1:
**TBD**
=B2G Contacts API Test Plan=
 
== Summary ==
{| class="fullwidth-table"
|-
| style="width:28%" | '''Lead'''
| [mailto:mwargers@mozilla.com Martijn Wargers] (irc: mw22)
|-
| '''Contributors'''
| TBD
|-
| '''API Description'''
| Provides read/write DOM API access to the device address book, and the contacts contained therein.
|-
| ''' API Developer'''
| [mailto:anygregor@gmail.com Gregory Wagner]
|-
| '''API Project Page'''
| [[WebAPI/ContactsAPI|Contacts API]]
|-
| '''API Tracking Bugs'''
| {{bug|674720}}
|-
| '''API Status'''
| Delivered and ready for test
|-
|}
 
== Scope ==
This test plan covers functional testing of the Contacts API as delivered for Boot2Gecko.
 
== Strategy ==
Most Contact tests can be added to Mochitest, and a test app should be created to verify the API on-device.
 
== API ==
Contacts API  is part of the nsIDOMNavigator interface, when the "dom.mozContacts.enabled" preference is set to true.
 
=== [http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/base/nsIDOMNavigator.idl nsIDOMNavigator] (subset) ===
==== Attributes ====
The API is mentioned here: https://wiki.mozilla.org/WebAPI/ContactsAPI#Proposed_API
 
There is an object in window.navigator named ''mozContacts'' with the following interface:
interface nsIDOMContactManager : nsISupports
{
  nsIDOMDOMRequest find(in nsIDOMContactFindOptions options);
  nsIDOMDOMRequest clear();
  nsIDOMDOMRequest save(in nsIDOMContact contact);
  nsIDOMDOMRequest remove(in nsIDOMContact contact);
  nsIDOMDOMRequest getSimContacts(in DOMString type);
  attribute nsIDOMEventListener oncontactchange;
};
 
interface nsIDOMContact : nsIDOMContactProperties
{
  attribute DOMString id;
  readonly attribute jsval    published;
  readonly attribute jsval    updated;
 
  void init(in nsIDOMContactProperties properties);  // Workaround BUG 723206
};
 
interface nsIDOMContactFindOptions : nsISupports
{
  attribute DOMString filterValue;  // e.g. "Tom"
  attribute DOMString filterOp;    // e.g. "contains"
  attribute jsval filterBy;        // DOMString[], e.g. ["givenName", "nickname"]
  attribute DOMString sortBy;      // "givenName" or "familyName"
  attribute DOMString sortOrder;    // e.g. "descending"
  attribute unsigned long filterLimit;
};
 
For other (nsIDOMContactProperties, etc), see: http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/contacts/nsIDOMContactProperties.idl
 
== Tests ==
=== Performance tests ====
** Not implemented yet (see https://bugzilla.mozilla.org/show_bug.cgi?id=746439 )
 
=== Marionette/JS ===
** Not implemented yet.
 
=== Basic Positive Tests ===
** Not implemented yet.
 
=== mochitest-plain===
** http://mxr.mozilla.org/mozilla-central/source/dom/contacts/tests/
 
==== Sanity Tests ====
** See mochitests
 
==== Basic Negative Tests ====
** Not implemented yet.
 
=== Test App Design ===
** Not implemented yet.
 
----
<small>This page is based on the [[B2G/QA/WebAPI Test Plan/Template|WebAPI Test Plan Template]]</small>
 
=== URLS ===
http://mxr.mozilla.org/mozilla-central/source/dom/contacts/ContactManager.js#513
http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/contacts/nsIDOMContactManager.idl#37
http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/contacts/nsIDOMContactProperties.idl#43
Confirmed users
486

edits