Personal tools

B2G/QA/WebAPI Test Plan/Vibration

From MozillaWiki

Jump to: navigation, search

Contents

B2G Screen Orientation API Test Plan

Summary

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

Scope

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.

Strategy

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

API

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

Methods

  • void vibrate(in jsval aPattern);

Tests

Marionette/JS

Basic Positive Tests

mochitest-plain

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