QA/Automation/Projects/WebAPI: Difference between revisions

m
(Created page with "==Overview== "(WebAPI place holder)... is a free, open project that enables web browsers with Real-Time Communications (RTC) capabilities via simple Javascript APIs. The Web...")
 
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Overview==
==Overview==
"(WebAPI place holder)... is a free, open project that enables web browsers with Real-Time Communications (RTC) capabilities via simple Javascript APIs. The WebRTC components have been optimized to best serve this purpose."
As an essential part of Boot2Gecko (Mozilla Firefox OS), the WebAPIs provide access to the device OS, thus allowing html applications to use mobile phone features. For example, a B2G html application can send SMS messages via javascript using the WebSMS WebAPI.


To ensure that the code quality of WebRTC in Firefox is in an overall good shape, automated tests have to be written. Those tests will be executed by the [https://developer.mozilla.org/Mochitest Mochitest] framework on a per check-in basis.
In order to ensure the functionality of the WebAPIs, an extensive WebAPI test suite must be developed. Both the Mochitest and Marionette automation frameworks will be used in the development and execution of the WebAPI tests, which ultimately will be executed on the B2G device emulator on a per-check-in basis.


{| style="width: 90%; margin: 0 0 1em 1em" |
{| style="width: 90%; margin: 0 0 1em 1em" |
Line 9: Line 9:
  |- valign="top"
  |- valign="top"
  | '''Name:'''
  | '''Name:'''
  | WebRTC tests
  | WebAPI tests
  |- valign="top"
  |- valign="top"
  | '''Leads:'''
  | '''Leads:'''
  | [mailto:hskupin@mozilla.com Henrik Skupin], [mailto:dhunt@mozilla.com Dave Hunt], [mailto:rwood@mozilla.com Rob Wood]
  | [mailto:rwood@mozilla.com Rob Wood], [mailto:hskupin@mozilla.com Henrik Skupin], [mailto:dhunt@mozilla.com Dave Hunt]
  |- valign="top"
  |- valign="top"
  | '''Contributors:'''
  | '''Contributors:'''
Line 18: Line 18:
  |- valign="top"
  |- valign="top"
  | '''Repository:'''  
  | '''Repository:'''  
  | http://hg.mozilla.org/projects/alder/file/default/dom/media/tests/
  | http://mxr.mozilla.org/mozilla-central/source/dom/
  |- valign="top"
  |- valign="top"
  | '''Tracking Bug:'''
  | '''API specs:'''
  | {{bug|749522}}
  | https://wiki.mozilla.org/WebAPI#APIs
  |- valign="top"
  |- valign="top"
  | '''Etherpad:'''
  | '''Etherpad:'''
  | http://etherpad.mozilla.com:9000/automation-webrtc
  | https://etherpad.mozilla.org/automation-webapi
|}
|}


==Sub Projects==
==Sub Projects==
{| class="fullwidth-table" |
{| class="fullwidth-table" |
  | style="background:#EFEFEF; width: 25%" | Sub Project
  | style="background:#EFEFEF; width: 10%" | Priority
  | style="background:#EFEFEF; width: 15%" | Status
| style="background:#EFEFEF; width: 20%" | Feature
  | style="background:#EFEFEF; width: 40%" | Description
| style="background:#EFEFEF; width: 10%" | Status
  | style="background:#EFEFEF; width: 15%" | Owner
  | style="background:#EFEFEF; width: 45%" | QA testplan
  |- valign="top"
  |- valign="top"
  | [[Auto-tools/Automation_Development/Projects/WebRTC/Smoketests|Smoketests]]  
| P1
  | [[WebAPI/WebTelephony|WebTelephony]]
  | Active
  | Active
  | Suite of Smoketests for initial launch of WebRTC
  | Rob Wood
| [[B2G/QA/WebAPI_Test_Plan/WebTelephony]]
|- valign="top"
| P1
| [[WebAPI/WebSMS|WebSMS]]
| Active
| Rob Wood
| [[B2G/QA/WebAPI_Test_Plan/WebSMS]]
|- valign="top"
| P1
| [[WebAPI/ScreenOrientation|Screen Orientation]]
| Active
| Henrik Skupin
| [[B2G/QA/WebAPI_Test_Plan/Screen_Orientation]]
|- valign="top"
| P1
| [http://dvcs.w3.org/hg/dap/raw-file/tip/battery/Overview.html Battery Status]
| No started
| TBD
| [[B2G/QA/WebAPI_Test_Plan/Battery_Status]]
|}
|}
==Tasks==
For each of the WebAPIs that are testable on the B2G device emulator:
* Review the implementation details
* Review existing tests
* Identify new test cases to be developed, in order to ensure full API test coverage
* When reviewing existing mochitests, determine if additional test coverage can be achieved by adding marionette tests that access emulator features
* Develop new tests using the appropriate automation framework:
** Default to using mochitest; unless:
** If direct access to the B2G device emulator 'hardware' commands is required, use the marionette framework.


==Details==
==Details==
The code of WebRTC is in an early state and therefore not part of the main development tree of Firefox called mozilla-central yet. To test the feature and to contribute to the test creation process you will have to build your own version of Firefox from the [http://hg.mozilla.org/projects/alder|alder project branch]. In the following you can find all the information you need to get started.
For more information about the B2G WebAPI, building B2G, running the tests, etc. please see the links mentioned below.
 
=== Specifications and Architecture ===
General Firefox OS announcement: http://www.mozilla.org/en-US/firefoxos/
 
Firefox OS on MDN: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS
 
B2G Wiki: https://wiki.mozilla.org/B2G
 
B2G architecture overview:
https://wiki.mozilla.org/B2G/Architecture
 
Details and specifications for the WebAPIs planned for B2G V1:
https://wiki.mozilla.org/Webapi
 
=== Building B2G ===
Building and installing B2G:
https://developer.mozilla.org/en-US/docs/Mozilla/Boot_to_Gecko/Building_and_installing_Boot_to_Gecko
 
=== Running the WebAPI Tests ===
Using the B2G device emulator:
https://developer.mozilla.org/en-US/docs/Mozilla/Boot_to_Gecko/Using_the_B2G_emulators


===Build Firefox===
Mochitest overview:
1. To build your own version of Firefox, setup the build system by following the steps outlined on the '[https://developer.mozilla.org/en-US/docs/Simple_Firefox_build|Simple Firefox build]' page on MDN.
https://developer.mozilla.org/en-US/docs/Mochitest


2. Setup [https://developer.mozilla.org/en-US/docs/Mozilla_Source_Code_(Mercurial) Mercurial] and clone the <em>alder</em> branch - <strong>NOT mozilla-central</strong>:
B2G Mochitest:
https://developer.mozilla.org/en-US/docs/Mozilla/Boot_to_Gecko/B2G_Mochitests


    $ cd %workspace%
Marionette overview:
    $ hg clone http://hg.mozilla.org/projects/alder/
https://developer.mozilla.org/en-US/docs/Marionette
    $ cd alder


3. Create a ./mozconfig file in the root folder of the local checkout and fill in the content depending on your platform:
B2G Marionette:
https://developer.mozilla.org/en-US/docs/Mozilla/Boot_to_Gecko/Setting_Up_Marionette_for_B2G


Linux:
Running B2G Marionette tests:
    ac_add_options --enable-debug
https://developer.mozilla.org/en-US/docs/Marionette/Running_Tests
    ac_add_options --enable-trace-malloc
    ac_add_options --enable-signmar
    ENABLE_MARIONETTE=1
   
    # Avoid dependency on libstdc++ 4.5
    ac_add_options --enable-stdcxx-compat
   
    # Needed to enable breakpad in application.ini
    export MOZILLA_OFFICIAL=1
   
    # Enable parallel compiling
    mk_add_options MOZ_MAKE_FLAGS="-j4"
   
    #Use ccache - TODO make sure this is where your ccache got installed
    ac_add_options --with-ccache=/usr/bin/ccache
   
    # Treat warnings as errors in directories with FAIL_ON_WARNINGS.
    ac_add_options --enable-warnings-as-errors


Mac:
==== Marionette Command Line ====
    ac_add_options --enable-debug
You may want to create a shell script to quickly launch your WebAPI Marionette test right from your workspace folder.  Create a new shell script and copy/paste the line of code below, and put the script in your path. Then with the emulator already running, you can use the script to easily execute your WebAPI test.
    ac_add_options --enable-trace-malloc
    ac_add_options --enable-accessibility
    ac_add_options --enable-signmar
    ENABLE_MARIONETTE=1
   
    # Enable parallel compiling - TODO: make sure your mac has enough cores
    # to handle this!
    mk_add_options MOZ_MAKE_FLAGS="-j12"
   
    # Needed to enable breakpad in application.ini
    export MOZILLA_OFFICIAL=1
   
    ac_add_options --with-macbundlename-prefix=Firefox
   
    # Package js shell.
    export MOZ_PACKAGE_JSSHELL=1


Windows:
python $B2G_HOME/gecko/testing/marionette/client/marionette/runtests.py --emulator arm --address localhost:2828 --homedir $B2G_HOME $1
    ac_add_options --enable-debug
    ac_add_options --enable-trace-malloc
    ac_add_options --enable-signmar
    ENABLE_MARIONETTE=1
   
    # Needed to enable breakpad in application.ini
    export MOZILLA_OFFICIAL=1
   
    if test -n "${_PYMAKE}"; then
      mk_add_options MOZ_MAKE_FLAGS=-j4
    else
      mk_add_options MOZ_MAKE_FLAGS=-j1
    fi
   
    # TODO: you may need to find out what these extra mozconfigs from
    # <src>/build/win32 are doing and add those directly to this file and
    # remove this if statement. I have to do that sometimes on windows.
    if test "$PROCESSOR_ARCHITECTURE" = "AMD64" -o "$PROCESSOR_ARCHITEW6432" = "AMD64"; then
      . $topsrcdir/build/win32/mozconfig.vs2010-win64
    else
      . $topsrcdir/build/win32/mozconfig.vs2010
    fi
   
    # Package js shell.
    export MOZ_PACKAGE_JSSHELL=1


4. Build Firefox
=== Emulator (Android Console) Commands ===
    $ make -f client.mk
Emulator commands:
http://developer.android.com/tools/devices/emulator.html


===Run Tests===
General emulator info:
There are no automated tests available yet which can be run by the Mochitest framework. But you can run the tests manually. Just start Firefox and open <em>%workspace%/alder/dom/media/tests</em>.
http://developer.android.com/tools/help/emulator.html
canmove, Confirmed users, Bureaucrats and Sysops emeriti
4,714

edits