diff --git a/build/mobile/robocop/Makefile.in b/build/mobile/robocop/Makefile.in index cbd3eebc9dd7..44ef161fa9bc 100644 --- a/build/mobile/robocop/Makefile.in +++ b/build/mobile/robocop/Makefile.in @@ -80,10 +80,9 @@ GARBAGE += \ $(java-tests-dep) \ $(_JAVA_HARNESS) \ classes.dex \ - robocop.apk \ robocop.ap_ \ - robocop-unsigned-unaligned.apk \ - robocop-unaligned.apk \ + robocop-debug-signed.apk \ + robocop-debug-signed-unaligned.apk \ $(robocop-deps) \ $(NULL) @@ -100,7 +99,7 @@ include $(topsrcdir)/config/android-common.mk GENERATED_DIRS_tools = classes $(dir-tests) -tools:: $(robocop-deps) robocop.apk +libs:: robocop-debug-signed.apk classes.dex: robocop.ap_ classes.dex: $(robocop-deps) @@ -109,10 +108,15 @@ classes.dex: $(java-tests-dep) $(JAVAC) $(JAVAC_FLAGS) -d classes $(JAVAFILES) $(_JAVA_HARNESS) $(java-tests-dep) $(DX) --dex --output=$@ classes $(ROBOTIUM_PATH) $(ANDROID_COMPT_LIB) -robocop.apk: $(robocop-deps) robocop.ap_ classes.dex robocop.ap_: AndroidManifest.xml $(TESTPATH)/assets/* $(AAPT) package -f -M $< -I $(ANDROID_SDK)/android.jar -I . -S res -A $(TESTPATH)/assets -F $@ -J ./ +robocop-debug-signed-unaligned.apk: robocop.ap_ classes.dex + $(APKBUILDER) $@ -v $(APKBUILDER_FLAGS) -z robocop.ap_ -f classes.dex + +robocop-debug-signed.apk: robocop-debug-signed-unaligned.apk + $(ZIPALIGN) -f -v 4 $^ $@ + # PP_java-tests not fully usable here # Intermediate step toward a library rule. $(dir-tests)/%.java: $(TESTPATH)/%.java.in $(call mkdir_deps,$(dir-tests)) diff --git a/build/mobile/robocop/README b/build/mobile/robocop/README index dec5bb265780..3de479685a10 100644 --- a/build/mobile/robocop/README +++ b/build/mobile/robocop/README @@ -7,3 +7,6 @@ http://code.google.com/p/robotium/ We are including robotium-solo-3.6.jar as a binary and are not modifying it in any way from the original download found at: http://code.google.com/p/robotium/ + +Firefox for Android developers should read the documentation in +mobile/android/base/tests/README.rst. diff --git a/mobile/android/base/tests/README.rst b/mobile/android/base/tests/README.rst new file mode 100644 index 000000000000..db4fbf6177d2 --- /dev/null +++ b/mobile/android/base/tests/README.rst @@ -0,0 +1,43 @@ +Robocop Mochitest +================= + +*Robocop Mochitest* tests run on Native Android builds marked with an +'rc' in TBPL. These are Java based tests which run from the mochitest +harness and generate similar log files. These are designed for +testing the native UI of Android devices by sending events to the +front end. + +See the documentation at +https://wiki.mozilla.org/Auto-tools/Projects/Robocop/WritingTests for +details. + +Development cycle +----------------- + +To deploy the robocop APK to your device and start the robocop test +suite, use:: + + make -C $OBJDIR mochitest-robocop + +The Java files in ``mobile/android/base/tests`` are dependencies of the +robocop APK built by ``build/mobile/robocop``. If you modify Java files +in ``mobile/android/base/tests``, you need to rebuild the robocop APK +with:: + + mach build/mobile/robocop + +Changes to ``.html``, ``.css``, ``.sjs``, and ``.js`` files in +``mobile/android/base/tests`` do not require rebuilding the robocop +APK -- these changes are always 'live', since they are served by the +mochitest HTTP server and downloaded each test run by your device. + +``mach package`` does build and sign a robocop APK, but ``make +mochitest-robocop`` does not use it. (This signed APK is used to test +signed releases on the buildbots). + +As always, changes to ``mobile/android/base``, ``mobile/android/chrome``, +``mobile/android/modules``, etc., require:: + + mach mobile/android/base && mach package && mach install + +as usual. diff --git a/testing/testsuite-targets.mk b/testing/testsuite-targets.mk index 1062b6aefd61..8b2e6fb184a8 100644 --- a/testing/testsuite-targets.mk +++ b/testing/testsuite-targets.mk @@ -63,12 +63,12 @@ RUN_MOCHITEST_REMOTE = \ --testing-modules-dir=$(call core_abspath,_tests/modules) \ $(SYMBOLS_PATH) $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS) -RUN_MOCHITEST_ROBOTIUM = \ +RUN_MOCHITEST_ROBOCOP = \ rm -f ./$@.log && \ $(PYTHON) _tests/testing/mochitest/runtestsremote.py \ - --robocop-apk=$(DIST)/robocop.apk \ - --robocop-ids=$(DIST)/fennec_ids.txt \ + --robocop-apk=$(DEPTH)/build/mobile/robocop/robocop-debug-signed.apk \ --robocop-ini=$(DEPTH)/build/mobile/robocop/robocop.ini \ + --robocop-ids=$(DIST)/fennec_ids.txt \ --console-level=INFO --log-file=./$@.log --file-level=INFO $(DM_FLAGS) --dm_trans=$(DM_TRANS) \ --app=$(TEST_PACKAGE_NAME) --deviceIP=${TEST_DEVICE} --xre-path=${MOZ_HOST_BIN} \ $(SYMBOLS_PATH) $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS) @@ -97,14 +97,17 @@ mochitest-remote: $(RUN_MOCHITEST_REMOTE); \ fi -mochitest-robotium: DM_TRANS?=adb -mochitest-robotium: +mochitest-robotium: mochitest-robocop + @echo "mochitest-robotium is deprecated -- please use mochitest-robocop" + +mochitest-robocop: DM_TRANS?=adb +mochitest-robocop: @if [ ! -f ${MOZ_HOST_BIN}/xpcshell ]; then \ echo "please prepare your host with the environment variable MOZ_HOST_BIN"; \ elif [ "${TEST_DEVICE}" = "" -a "$(DM_TRANS)" != "adb" ]; then \ echo "please prepare your host with the environment variable TEST_DEVICE"; \ else \ - $(RUN_MOCHITEST_ROBOTIUM); \ + $(RUN_MOCHITEST_ROBOCOP); \ fi ifdef MOZ_B2G diff --git a/toolkit/mozapps/installer/packager.mk b/toolkit/mozapps/installer/packager.mk index 58a1579bd6a6..78060e75b260 100644 --- a/toolkit/mozapps/installer/packager.mk +++ b/toolkit/mozapps/installer/packager.mk @@ -328,9 +328,9 @@ UPLOAD_EXTRA_FILES += robocop.apk UPLOAD_EXTRA_FILES += fennec_ids.txt ROBOCOP_PATH = $(call core_abspath,$(_ABS_DIST)/../build/mobile/robocop) INNER_ROBOCOP_PACKAGE= \ - $(APKBUILDER) $(_ABS_DIST)/robocop-raw.apk -v $(APKBUILDER_FLAGS) -z $(ROBOCOP_PATH)/robocop.ap_ -f $(ROBOCOP_PATH)/classes.dex && \ - $(JARSIGNER) $(_ABS_DIST)/robocop-raw.apk && \ - $(ZIPALIGN) -f -v 4 $(_ABS_DIST)/robocop-raw.apk $(_ABS_DIST)/robocop.apk + cp $(ROBOCOP_PATH)/robocop-debug-signed-unaligned.apk $(_ABS_DIST)/robocop-unaligned.apk && \ + $(JARSIGNER) $(_ABS_DIST)/robocop-unaligned.apk && \ + $(ZIPALIGN) -f -v 4 $(_ABS_DIST)/robocop-unaligned.apk $(_ABS_DIST)/robocop.apk endif else INNER_ROBOCOP_PACKAGE=echo 'Testing is disabled - No Robocop for you'