We've mentioned several times now that we will be requiring tests for
all patches from now on. For a lot of "boring" parts of the code, we
can write unit tests with xpcshell tests or Mochitests. However, some
device capabilities are hard to test that way. Good news is,
Marionette + the emulator allow us to test some of our device APIs in
the context of the full Gonk stack. Folks have been asking for an
overview of what's possible and what isn't, so here it is:
Things supported by the emulator out of the box (see
http://developer.android.com/guide/developing/devices/emulator.html):
* battery (however, chargingTime and dischargingTime not supported)
* rudimentary RIL features such as calls, sms, network registration
state (unclear SIM card features, data calls, etc.)
* geolocation
Not supported. Might be possible by enhancing emulator capabilities
and/or using fake daemons:
* Wifi
* Bluetooth
* sensors (e.g. proximity, accelerometer, etc.)
Fundamentally impossible to automate (needs manual test framework):
* audio: microphone, speakerphone, mute, volume, etc.
* vibration
* camera (host machine's webcam is passed through, so not 100%
impossible, just very hard, especially in a CI environment)
I'm probably missing some APIs here. Please feel free to amend this list.
For infos on how to write emulator tests, please refer to the
Marionette section on MDN. Specifically:
* Marionette JS tests, especially runEmulatorCmd:
https://developer.mozilla.org/en/Marionette/Marionette_JavaScript_Tests#runEmulatorCmd%28%29
* We're in the process of rewriting the mixed Python/JS tests to pure
JS:
https://bugzilla.mozilla.org/show_bug.cgi?id=756607
Or drop me a line.