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

< B2G‎ | QA‎ | WebAPI Test Plan
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
=B2G Screen Orientation API Test Plan=
=B2G Alarm API Test Plan=


== Summary ==
== Summary ==
Line 25: Line 25:


== Scope ==
== Scope ==
A short section should be added here that describes the testing scope of this plan: both what is and is not included, broadly.
This test plan covers functional testing of the Alarm API as delivered for Boot2Gecko, i.e. adding alarms, removing them, and getting all alarms. It does not attempt to cover performance, security, or other kinds of testing at this time.  


== Strategy ==
== Strategy ==
Line 54: Line 54:


== API ==
== API ==
Describe the API here. Give a short summary, what the API does, and any considerations or preconditions for using it.
To provide DOM API access to the system alarm settings, which can schedule a notification or for an application to be started at a specific time. For example, some applications like Alarm Clock, Calendar or E-Mail might need to utilize the Alarm API to wake up the sytem and trigger particular behaviors at specified time points.
 
Allows adding, removing and querying for all alarms.


=== Related Prefs ===
=== Related Prefs ===
If user prefs can turn the API on or off or otherwise modify its operation, describe them here.
dom.mozAlarms.enabled -- whether navigator.mozAlarms exists.


=== [http://mxr.mozilla.org/mozilla-central/source/dom/alarm/nsIDOMAlarmsManager.idl nsIDOMAlarmsManager] ===
=== [http://mxr.mozilla.org/mozilla-central/source/dom/alarm/nsIDOMAlarmsManager.idl nsIDOMAlarmsManager] ===
Line 72: Line 74:


== Tests ==
== Tests ==
=== Marionette/JS ===
==== Test Type 1 ====
* Test 1
* Test 2
==== Test Type 2 ====
* Test 1
* Test 2
=== mochitest-plain===
=== mochitest-plain===
==== Test Type 1 ====
==== Test Type 1 ====
Line 89: Line 82:
* Test 1
* Test 1
* Test 2
* Test 2
=== Test App Design ===
Describe application functionality here


----
----
<small>This page is based on the [[B2G/QA/WebAPI Test Plan/Template|WebAPI Test Plan Template]]</small>
<small>This page is based on the [[B2G/QA/WebAPI Test Plan/Template|WebAPI Test Plan Template]]</small>

Latest revision as of 20:03, 4 March 2013

B2G Alarm API Test Plan

Summary

Lead Geo Mealer (irc: geo)
API Description Schedule a notification, or for an application to be started, at a specific time.
API Developer Gene Lian
API Project Page Alarm API
API Tracking Bugs bug 749551
API Status Ready

Scope

This test plan covers functional testing of the Alarm API as delivered for Boot2Gecko, i.e. adding alarms, removing them, and getting all alarms. It does not attempt to cover performance, security, or other kinds of testing at this time.

Strategy

Raw info from dev, this will be formatted:

[Gene] Personally, I'd like to have some (basic) testing items as below:

1. An "honorTimezone"/"ignoreTimezone" alarm can be successfully added:

 var alarmId;
 var domRequest = navigator.mozAlarms.add(new Date("July 10, 2012 18:00:00"), "honorTimezone", { mydata: "bar" });
 domRequest.onsuccess = function (e) { alarmId = e.target.result; };
 domRequest.onerror = function (e) { alert("error"); };

2. The information of added alarms can be successfully retrieved:

 var domRequest = navigator.mozAlarms.getAll();
 domRequest.onsuccess = function (e) { alert(JSON.stringify(e.target.result)); };
 domRequest.onerror = function (e) { alert("error"); };

3. An added alarm can be successfully fired at the specified time. That is, the web page can get a system message named "alarm" and execute its corresponding callback function when the alarm goes off:

 navigator.setMessageHandler("alarm", function (message) { alert("alarm fired: " + JSON.stringify(message)); });

4. An added alarm can be successfully removed (also, the alarm won't be fired if it's already been removed):

 navigator.mozAlarms.remove(alarmId);

API

To provide DOM API access to the system alarm settings, which can schedule a notification or for an application to be started at a specific time. For example, some applications like Alarm Clock, Calendar or E-Mail might need to utilize the Alarm API to wake up the sytem and trigger particular behaviors at specified time points.

Allows adding, removing and querying for all alarms.

Related Prefs

dom.mozAlarms.enabled -- whether navigator.mozAlarms exists.

nsIDOMAlarmsManager

Methods

  • nsIDOMDOMRequest getAll()
  • nsIDOMDOMRequest add(in jsval date, in DOMString respectTimezone, [optional] in jsval data)
  • void remove(in unsigned long id)

Events

  • alarm - (System Message)

Tests

mochitest-plain

Test Type 1

  • Test 1
  • Test 2

Test Type 2

  • Test 1
  • Test 2

This page is based on the WebAPI Test Plan Template