B2G/QA/WebAPI Test Plan/Camera

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

B2G Camera API Test Plan


Lead David Clarke (irc: onecyrenus)
API Description Camera API, used to get pictures, and put a preview screen on the page
API Developer Mike Habicher
API Project Page Camera API
API Tracking Bugs bug 740997
API Status Delivered and ready for test


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


The ability to be able to test the camera api will cover three areas.

  1. 3rd Party App
  2. Browser
  3. Camera App


Camera API is relatively simple, and is defined as part of the nsIDOMCameraManager idl.


The attributes that I would like to iterate on, or be able to test are the following.


   readonly attribute jsval        previewSizes;
   readonly attribute jsval        pictureSizes;
   readonly attribute jsval        fileFormats;
   readonly attribute jsval        whiteBalanceModes;
   readonly attribute jsval        sceneModes;
   readonly attribute jsval        effects;
   readonly attribute jsval        flashModes;
   readonly attribute jsval        focusModes;
   readonly attribute long         maxFocusAreas;
   readonly attribute double       minExposureCompensation;
   readonly attribute double       maxExposureCompensation;
   readonly attribute double       stepExposureCompensation;
   readonly attribute long         maxMeteringAreas;
   readonly attribute jsval        zoomRatios;
   readonly attribute jsval        videoSizes;


  • void autoFocus(in nsICameraAutoFocusCallback onSuccess, [optional] in nsICameraErrorCallback onError);
  • void takePicture(in jsval aOptions, in nsICameraTakePictureCallback onSuccess, [optional] in nsICameraErrorCallback onError);
  • void startRecording(in jsval aOptions, in nsICameraStartRecordingCallback onSuccess, [optional] in nsICameraErrorCallback onError);
  • void stopRecording();
  • void getPreviewStream(in jsval aOptions, in nsICameraPreviewStreamCallback onSuccess, [optional] in nsICameraErrorCallback onError);

Basic Positive Tests

  • Take Photo *
  • Preview Screen *
  • Different preview screen sizes*
  • Rockers which change the whiteBalanceModes, minExposure, maxExposure*
  • Change file formats*
  • Zoom Ratios *


  • Currently there are no mochitests of any level of depth.

Sanity Tests

Basic Negative Tests

  • Invalid Lat / Longitude
  • Autofocus supported when not
  • Incorrect file format
  • Incorrect rotation

Test App Design

This page is based on the WebAPI Test Plan Template