B2G/QA/WebAPI Test Plan/Vibration

From MozillaWiki
< B2G‎ | QA‎ | WebAPI Test Plan
Jump to: navigation, search

B2G Screen Orientation API Test Plan


Lead Martijn Wargers (irc: mw22)
Contributors TBD
API Description Makes the device vibrate when this api is called
API Developer Justin Lebar
API Project Page Vibration
API Tracking Bugs bug 679966
API Status Delivered and ready for test


This test plan covers functional testing of the Vibration API as delivered for Boot2Gecko. It does not attempt to cover performance, security, or other kinds of testing at this time.


Since there is no automated way to test if the device is actually vibrating when the API is called, we need manual tests for that. Some basic sanity tests can be added to Mochitest for other platforms, and a test app should be created to verify the API on-device.

  • Some other areas that could be tested:
    • inside (hidden and multiple) iframes
    • while in the background/background tab
    • on a deleted window/iframe
    • when screen turned off
    • Full screen
    • related prefs: dom.vibrator.enabled , dom.vibrator.max_vibrate_ms , dom.vibrator.max_vibrate_list_len


Vibration API is defined as part of the nsIDOMNavigator interface. It includes the vibrate() method to let the device vibrate or let it stop vibrating.

nsIDOMNavigator (subset)

devmo article

Vibration API Specification


  • void vibrate(in jsval aPattern);



Basic Positive Tests


Sanity Tests

Basic Negative Tests

  • See Sanity Tests

Test App Design

Basic test application can be found here.

This page is based on the WebAPI Test Plan Template