Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see
JavaScript HTML Java CSS Python Shell Other
branch: master
Failed to load latest commit information.
apps Bug 1153522 - merge pull request #29556 from jrburke:bug1153522-email…
bin Enable passing --buildapp to marionette runner
build Bug 1155508 - Fix remaining dialer jshint issues
customization Bug 1052227 - Move inapp pay test to packaged to avoid mochitest fail…
dev_apps Bug 970728 - Intermittent test_bug344861.html - test_container.css fix
locales Bug 1143248 - Add Tagalog (tl) locale to FxOS builds
shared Merge pull request #29519 from EragonJ/bug-1145751
test_media Bug 1108008 - Fix the destination path for the dialer and calendar re…
tests Merge pull request #29551 from npark-mozilla/1155299
tools Bug 1011478 - Disable also in DEBUG…
tv_apps Bug 1152173 - [Stingray][Home] Implement folder list
.editorconfig Bug 1155979 - Ensure Makefile can be indent with tabs
.gitignore Bug 1148791 - [Build] Cache the result of downloading modules.tar r=r…
.jsdocrc Bug 1015013 - JSDoc 3 parse error getter/setter with the same name in…
.jshintignore Bug 1087811 - [email] update minification step to work with newer ES6…
.jshintrc Bug 987282 - JSHint allow getter without setter globally r=julienw Bug 1022728 - Prevent building gaia when running ./ gecko Bug 1055914 - Fix/update three links in contributing guide R=julien
Gruntfile.js Revert "Bug 1151765 - use gulp to build jsdocs, r=ricky" for test bus…
LICENSE Bug 929926 - LICENCE is mis-spelled
Makefile Bug 1154901 - mozilla-download never thinks /b2g is up-to-date Revert "Bug 1151765 - use gulp to build jsdocs, r=ricky" for test bus…
autolander.json Bug 1146484 - Follow-up, increase autolander build chunks Revert "Revert "Bug 1059051 - Convert Keyboard-Symbols.woff to Keyboa…
gaia_node_modules.revision Bug 1150523 - marionette-client@1.7.3 r=gaye
package.json Bug 1150523 - marionette-client@1.7.3 r=gaye
taskgraph.json Bug 1147013 - Move to r=kgrandon


Gaia is Mozilla's Phone UX for the Boot to Gecko (B2G) project.

Boot to Gecko aims to create a complete, standalone operating system for the open web.

You can read more about B2G here:

follow us on twitter: @Boot2Gecko

join the Gaia mailing list:

and talk to us on IRC:

#gaia on

Hacking Gaia

The Gaia/Hacking page on MDN has all the information that you need to start working on Gaia, including building and running Gaia on a compatible device or desktop computer.

Autolander (bot)

Autolander is a bot which integrations github and bugzilla workflows.

Features available:

  • Automatic pull request to bugzilla attachment linking.
  • Automatic landing, on green integration run, with a R+ from a suggested reviewer and checkin-needed keyword.
  • Comments in the bug with the landed commit, and marks the bug as fixed.
  • Validates pull request title and commit message formats.
  • Currently only runs a subset of the gaia CI tests which are stable on taskcluster. Ensure you have a green gaia-try run before adding checkin-needed.
  • See more at: The Autolander guide on MDN


Unit Tests

Unit tests for an app go in apps/<APP>/test/unit/.

To run all the unit tests with B2G Desktop:

  1. Run DEBUG=1 make
  2. Run make test-agent-server &
  3. Run B2G Desktop and open the Test Agent app
  4. Run make test-agent-test

    or make test-agent-test APP=<APP> to run unit tests for a specific app

More importantly, you can use test-agent-server to watch the files on the filesystem and execute relevant tests when they change:

  1. Run DEBUG=1 make
  2. Run make test-agent-server &
  3. Run B2G Desktop and open the Test Agent app
  4. Edit files and when you save them, glance at the console with test-agent-server running

Note: If you add new files, you will need to restart test-agent-server.

As a convenience, you can also use the gaia-test script to launch the test-agent-server and open the Test Agent app in firefox:

  1. Add firefox to your $PATH or set $FIREFOX to your preferred firefox/aurora/nightly binary.
  2. Run ./bin/gaia-test to run the test-agent-server and launch firefox.
  3. Run make test-agent-test or modify files as described above.

For more details on writing tests, see:

Integration Tests

Gaia uses marionette-js-runner to run the tests with a custom builder for gaia. Tests should live with the rest of your apps code (in apps/my_app/test/marionette) and test files should end in _test.js.

All integration tests run under a node environment. You need node >= 0.10 for this to work predictably.

Shared code for tests lives under shared/test/integration.

Running integration tests

NOTE: unless your tests end in _test.js they will not be automatically picked up by make test-integration.

make test-integration

Invoking a test file

make test-integration TEST_FILES=<test>

For example, we could run the day_view_test.js test in calendar app with the below command.

make test-integration TEST_FILES=apps/calendar/test/marionette/day_view_test.js

If you would like to run more than one test, we could do the below command.

make test-integration TEST_FILES="apps/calendar/test/marionette/day_view_test.js apps/calendar/test/marionette/today_test.js"

Invoking tests for a specific app

make test-integration APP=<APP>

For example, we could run all tests for the calendar app with make test-integration APP=calendar.

Skipping a test file

make test-integration SKIP_TEST_FILES=<test>

For example, we could skip the day_view_test.js test in calendar app with the below command.

make test-integration SKIP_TEST_FILES=apps/calendar/test/marionette/day_view_test.js

If you would like to skip more than one test, we could do the below command.

make test-integration SKIP_TEST_FILES="apps/calendar/test/marionette/day_view_test.js apps/calendar/test/marionette/today_test.js"

Notice that we could not use the TEST_FILES and SKIP_TEST_FILES parameters at the same time.

Running tests while working

If you wish to run many tests in background you might not want to be disturbed by the b2g-desktop window popping everytime, or the sound. One solution for the first issue is to use Xvfb:

xvfb-run make test-integration

If you are using PulseAudio and want to keep the tests quied, then just force an invalid server:

PULSE_SERVER=":" make test-integration

You can of course combine both:

PULSE_SERVER=":" xvfb-run make test-integration

Running tests without building profile

if you would like to run tests without building profile, use make test-integration-test:

PROFILE_FOLDER=profile-test make # generate profile directory in first time
make test-integration-test

Debugging Tests

To view log out from a test

make test-integration VERBOSE=1

Running tests in OOP mode

To run tests in OOP mode

make test-integration OOP=1

Where to find documentation


  • For performance reasons we don't run make profile for each test run this means you need to manually remove the profile-test folder when you make changes to your apps.

  • If you don't have a b2g folder one will be downloaded for you. This can be problematic if you're offline. You can symlink a b2g-desktop directory to b2g/ in gaia to avoid the download.

  • If you have some weird node errors, try removing node_modules since things may be stale.

  • To get debug information from the b2g desktop client, run this: DEBUG=b2g-desktop TEST_FILES=name/of/test.js ./bin/gaia-marionette

  • To get debug information from b2g desktop and all of the marionette plugins, run this: DEBUG=* TEST_FILES=name/of/test.js ./bin/gaia-marionette

UI Tests


See Gaia functional tests README

Build System Tests

Build system has its own unit test and integration test. Both are running on Node.js

Build System Unit Tests

To run unit test locally, using following command:

$ make build-test-unit

Build System Integration Tests

To run integration test locally, using following command:

$ make build-test-integration

Invoking specific test files

Both the build unit or integration test can invoke specific test files by TEST_FILES

make build-test-unit TEST_FILES=<test file path>
make build-test-integration TEST_FILES=<test file path>

For example, we could run the keyboard_test.js build integration test in keyboard app with the below command.

make build-test-integration TEST_FILES=apps/keyboard/test/build/integration/keyboard_test.js

If you would like to run more than one test, we could do the below command.

make build-test-integration TEST_FILES="apps/keyboard/test/build/integration/keyboard_test.js apps/keyboard/test/build/integration/keyboard_layout_test.js"

Generate jsdoc

To generate API reference locally, you have to install grunt with following command:

$ npm -g grunt-cli

then run make docs command to generate docs. The generated API docs will be located in docs folder.

You could generate single app doc with this:

$ grunt jsdoc:system
Something went wrong with that request. Please try again.