|
|
Line 4: |
Line 4: |
| Robocop uses Robotium to inject events into the Java front-end of Firefox for Android and to monitor and verify Firefox events and UI views. | | Robocop uses Robotium to inject events into the Java front-end of Firefox for Android and to monitor and verify Firefox events and UI views. |
|
| |
|
| Related source code is maintained on mozilla-central:
| | The source code for the Robocop harness, and the test source code, is maintained on mozilla-central in <tt>mobile/android/tests/browser/robocop</tt>. |
| * test source code in mobile/android/base/tests
| |
| * Robocop source in build/mobile/robocop
| |
|
| |
|
| Robocop-based UI functionality tests are run with the mochitest test harness and appear on Treeherder under the symbols rc1 and rc2. | | Robocop-based UI functionality tests are run with the mochitest test harness and appear on Treeherder under the symbols rc1 and rc2. |
Line 13: |
Line 11: |
|
| |
|
| == Setup == | | == Setup == |
| ==== Step one: Build Fennec ====
| | === Step one: Build Fennec === |
| * Follow the instructions at https://wiki.mozilla.org/Mobile/Fennec/Android#Building_Fennec to build, package, and install Fennec on your device.
| |
|
| |
|
| ==== Step two: Build Firefox (Necessary for XPCShell) ====
| | Follow the instructions at https://wiki.mozilla.org/Mobile/Fennec/Android#Building_Fennec to build, package, and install Fennec on your device. |
| Follow [https://developer.mozilla.org/En/Simple_Firefox_build these instructions] to build Firefox for desktop, just so that you can build xpcshell. | |
|
| |
|
| (mcomella, 2/4/14: Unable to do the following via OS X or Arch Linux - various dynamic libraries are unable to be found)
| | === Step two: Install MOZ_HOST_BIN === |
|
| |
|
| As an alternative, you can download a "tests" zip from a current build for your platform from [ftp://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-central/ here], such as ftp://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-central/firefox-23.0a1.en-US.linux-i686.tests.zip -- unzip and find xpcshell.
| | Follow the instructions at https://wiki.mozilla.org/Mobile/Fennec/Android/Testing#Host_Builds_.28MOZ_HOST_BIN.29. |
|
| |
|
| == Running tests == | | == Running tests == |
Line 35: |
Line 31: |
| ==== Running all the tests ==== | | ==== Running all the tests ==== |
| From the root directory: | | From the root directory: |
| <pre>
| | |
| ./mach build build/mobile/robocop
| | mach build mobile/android/tests/browser/robocop |
| ./mach robocop</pre>
| | mach robocop |
|
| |
|
| Some notes for running tests: | | Some notes for running tests: |
Line 52: |
Line 48: |
|
| |
|
| == Updating your test directory == | | == Updating your test directory == |
| It is not always necessary to rebuild Fennec to use new tests. If you are updating the build with your own test, ensure that your test has been added to the manifest in /PATH/TO/FENNEC/SOURCE/mobile/android/base/tests/robocop.ini . | | |
| | It is not always necessary to rebuild Fennec to use new tests. If you are updating the build with your own test, ensure that your test has been added to the manifest in <tt>mobile/android/tests/browser/robocop/robocop.ini</tt>. |
|
| |
|
| Otherwise, you can retrieve tests from the repository by executing: | | Otherwise, you can retrieve tests from the repository by executing: |
| <pre>
| | |
| hg pull | | hg pull |
| hg update</pre> | | hg update |
|
| |
|
| Now you can build the robocop part of Fennec by executing: | | Now you can build the robocop part of Fennec by executing: |
| <pre>
| | |
| cd objdir
| | mach build mobile/android/tests/browser/robocop |
| make -C build/mobile/robocop/
| |
| make package </pre>
| |
|
| |
|
| == Frequently found errors == | | == Frequently found errors == |
| If you do not see your specific error below, it can sometimes help to uninstall and reinstall. To do this (and run the tests): | | If you do not see your specific error below, it can sometimes help to uninstall and reinstall. To do this (and run the tests): |
|
| |
|
| <pre>adb uninstall org.mozilla.roboexample.test
| | adb uninstall org.mozilla.roboexample.test |
| make -C $OBJDIR mochitest-robocop</pre>
| | mach build mobile/android/tests/browser/robocop |
| | | mach robocop testLoad |
| ===OOM Error===
| |
| This is an error found after use of Robocop frequently, but once it has happened, Fennec itself continues to crash. To fix it, simply uninstall and reinstall. This does not occur of frequent use of Robocop, as I have run 30 iterations of just robocop without it throwing this error.
| |
| | |
| ===InvocationTargetException Error===
| |
| This is an issue arising when using a Tegra.It looks like the following:<br>
| |
| <pre>W/System.err( 2610): java.lang.reflect.InvocationTargetException
| |
| W/System.err( 2610): at org.mozilla.gecko.GeckoAppShell.unregisterGeckoEventListener(GeckoAppShell.java:1565)
| |
| ...
| |
| </pre>
| |
| | |
| ===Build Error===
| |
| This is resolved by doing a clean build.
| |
| <pre>
| |
| make[7]: Entering directory `/media/sdan/birch/objdir-native-droid/mobile/android/base/locales'
| |
| make[7]: Leaving directory `/media/sdan/birch/objdir-native-droid/mobile/android/base/locales'
| |
| res/values/strings.xml:1: error: Error parsing XML: no element found
| |
| res/layout/awesomebar_search.xml:9: error: Error: No resource found that matches the given name (at 'hint' with value '@string/awesomebar_default_text').
| |
| res/layout-v11/awesomebar_search.xml:9: error: Error: No resource found that matches the given name (at 'hint' with value '@string/awesomebar_default_text').
| |
| res/layout/browser_toolbar.xml:7: error: Error: No resource found that matches the given name (at 'hint' with value '@string/awesomebar_default_text').
| |
| res/layout/crash_reporter.xml:6: error: Error: No resource found that matches the given name (at 'text' with value '@string/crash_message').
| |
| res/layout/crash_reporter.xml:14: error: Error: No resource found that matches the given name (at 'text' with value '@string/crash_help_message').
| |
| res/layout/crash_reporter.xml:21: error: Error: No resource found that matches the given name (at 'text' with value '@string/crash_send_report_message').
| |
| ...
| |
| </pre>
| |
|
| |
|
| ===Infrequent Runtime Errors=== | | ===Infrequent Runtime Errors=== |