B2G/QA/WebAPI Test Plan/WebSMS
From MozillaWiki
< B2G | QA | WebAPI Test Plan
Contents
- 1 B2G WebSMS API Test Plan
- 1.1 Summary
- 1.2 Scope
- 1.3 Strategy
- 1.4 API
- 1.4.1 Related Prefs
- 1.4.2 nsIDOMNavigatorSms : nsISupports
- 1.4.3 nsIDOMSmsCursor : nsISupports
- 1.4.4 nsIDOMSmsEvent : nsIDOMEvent
- 1.4.5 nsIDOMSmsFilter : nsISupports
- 1.4.6 nsIDOMSmsManager : nsIDOMEventTarget
- 1.4.7 nsIDOMSmsMessage : nsISupports
- 1.4.8 nsIDOMSmsRequest : nsIDOMDOMRequest
- 1.4.9 nsISmsDatabaseService : nsISupports
- 1.4.10 nsISmsRequestManager : nsISupports
- 1.4.11 nsISmsService : nsISupports
- 1.5 Tests
B2G WebSMS API Test Plan
Summary
Lead | Geo Mealer (irc: geo) |
Contributors | TBD |
API Description | Send/receive SMS messages as well as manage messages stored on device. |
API Developer | Mounir Lamouri |
API Project Page | WebSMS |
API Tracking Bugs | bug 674725 |
API Status | Mostly done for B2G. |
Scope
A short section should be added here that describes the testing scope of this plan: both what is and is not included, broadly.
Strategy
Explain here how to test the API in question (emulator, device-agnostic CI tests, on-device applications, or a combination).
In the likely case of a combination, discuss how tests will be split between options.
API
Describe the API here. Give a short summary, what the API does, and any considerations or preconditions for using it.
Related Prefs
- dom.sms.enabled
- dom.sms.whitelist
Attributes
- readonly nsIDOMMozSmsManager mozSms
nsIDOMSmsCursor : nsISupports
Attributes
- readonly nsIDOMMozSmsMessage message
Methods
- void continue()
nsIDOMSmsEvent : nsIDOMEvent
Attributes
- readonly nsIDOMMozSmsMessage message
nsIDOMSmsFilter : nsISupports
Attributes
- jsval startDate
Date, can return null
- jsval endDate
Date, can return null
- jsval numbers
Array of DOMString, can return null
- DOMString delivery
"sent", "received", or null
- jsval read
Boolean, can be undefined
nsIDOMSmsManager : nsIDOMEventTarget
Methods
- unsigned short getNumberOfMessagesForText(in DOMString text)
- jsval send(in jsval number, in DOMString message)
First param can be DOMString (one number) or Array of DOMString (multiple numbers).
Returns either SmsRequest or array of SmsRequest accordingly.
- nsIDOMMozSmsRequest getMessage(in long id)
- nsIDOMMozSmsRequest delete(in jsval param)
Param can be either message id or SmsMessage
- nsIDOMMozSmsRequest getMessages(in nsIDOMMozSmsFilter filter, in boolean reverse)
- nsIDOMMozSmsRequest markMessageRead(in long id, in boolean aValue)
Events
- onreceived
- onsent
- ondelivered
nsIDOMSmsMessage : nsISupports
Attributes
- readonly long id
- readonly DOMString delivery
"sent" or "received"
- readonly DOMString sender
- readonly DOMString receiver
- readonly DOMString body>
- readonly jsval timestamp
Date
- readonly boolean read
nsIDOMSmsRequest : nsIDOMDOMRequest
nsISmsDatabaseService : nsISupports
Methods
- long saveReceivedMessage(in DOMString aSender, in DOMString aBody, in unsigned long long aDate)
Takes some information required to save the message and returns its id.
- long saveSentMessage(in DOMString aReceiver, in DOMString aBody, in unsigned long long aDate)
Takes some information required to save the message and returns its id.
- void getMessage(in long messageId, in long requestId, [optional] in unsigned long long processId)
- void createMessageList(in nsIDOMMozSmsFilter filter, in boolean reverse, in long requestId, [optional] in unsigned long long processId)
- void getNextMessageInList(in long listId, in long requestId, [optional] in unsigned long long processId)
- void clearMessageList(in long listId);
- void markMessageRead(in long messageId, in boolean value, in long requestId, [optional] in unsigned long long processId);
nsISmsRequestManager : nsISupports
Constants
- unsigned short SUCCESS_NO_ERROR
- unsigned short NO_SIGNAL_ERROR
- unsigned short NOT_FOUND_ERROR
- unsigned short UNKNOWN_ERROR
- unsigned short INTERNAL_ERROR
Methods
- long createRequest(in nsIDOMMozSmsManager aManager, out nsIDOMMozSmsRequest aRequest)
Create a new request object, return the request ID
- long addRequest(in nsIDOMMozSmsRequest aRequest)
Track an already existing request object, return the request ID
- void notifySmsSent(in long aRequestId, in nsIDOMMozSmsMessage aMessage)
- void notifySmsSendFailed(in long aRequestId, in long aError)
- void notifyGotSms(in long aRequestId, in nsIDOMMozSmsMessage aMessage)
- void notifyGetSmsFailed(in long aRequestId, in long aError)
- void notifySmsDeleted(in long aRequestId, in bool aDeleted)
- void notifySmsDeleteFailed(in long aRequestId, in long aError
- void notifyNoMessageInList(in long aRequestId)
- void notifyCreateMessageList(in long aRequestId, in long aListId, in nsIDOMMozSmsMessage aMessage)
- void notifyGotNextMessage(in long aRequestId, in nsIDOMMozSmsMessage aMessage)
- void notifyReadMessageListFailed(in long aRequestId, in long aError)
- void notifyMarkedMessageRead(in long aRequestId, in bool aRead)
- void notifyMarkMessageReadFailed(in long aRequestId, in long aError)
nsISmsService : nsISupports
Methods
- boolean hasSupport()
- unsigned short getNumberOfMessagesForText(in DOMString text)
- void send(in DOMString number, in DOMString message, in long requestId, [optional] in unsigned long long processId)
- nsIDOMMozSmsMessage createSmsMessage(in long id, in DOMString delivery, in DOMString sender, in DOMString receiver, in DOMString body, in jsval timestamp, in bool read)
Tests
Marionette/JS
Test Type 1
- Test 1
- Test 2
Test Type 2
- Test 1
- Test 2
mochitest-plain
Test Type 1
- Test 1
- Test 2
Test Type 2
- Test 1
- Test 2
Test App Design
Describe application functionality here
This page is based on the WebAPI Test Plan Template