Mobile/Fennec/Android/Testing: Difference between revisions

Jump to navigation Jump to search
Line 12: Line 12:


They will all run against a connected Android device using your Firefox for Android build. Don't have a device? These commands will offer to start an emulator.
They will all run against a connected Android device using your Firefox for Android build. Don't have a device? These commands will offer to start an emulator.
=== Test Environment ===
When testing Firefox for Android, the test environment usually consists of:
- a "host" computer, running Linux or OSX
- an Android device, such as a phone, tablet, or emulator
- a Firefox for Android build, including an apk
- "host utilities" -- xpcshell, ssltunnel, and like binaries built for the host
- a "device manager" to communicate with the Android device
- a TCP/IP network connection between host and device
A test harness (typically written in python) runs on the host computer. The harness uses the device manager to communicate with the Android device (by default, the adb device manager is used, which uses the adb command from the Android SDK). "Browser" tests like robocop, mochitest, and reftest run in the browser, so Firefox for Android must be installed on the device before starting the test. To serve remote content to browser tests, the harness runs xpcshell and other utilities on the host while the tests are running. Tests may load content from the host, so a network connection between host and device is essential.
Running tests with mach simplifies environment concerns significantly:
- If a single phone or tablet is connected to your computer and visible with "adb devices", that device will be used automatically. If an emulator is running and visible with "adb devices", that device will be used automatically. If no device is visible to "adb devices", mach will offer to start an emulator.
- If Firefox for Android is not installed on the device, mach will offer to install Firefox.
- If the MOZ_HOST_BIN environment variable points to a directory containing xpcshell, that directory will be used for host utilities; otherwise, mach will offer to download and setup host utilities for you.


== Robocop ==
== Robocop ==
Confirmed users
1,759

edits

Navigation menu