Bug 1159390 - Set sharedUserId in robocop.apk. r=gbrown
authorNick Alexander <nalexander@mozilla.com>
Tue, 28 Apr 2015 11:29:18 -0700
changeset 273069 556e96942c272122d11573c180f8db4fc4bb6dfc
parent 273068 757ec9880c5bd139fe29a376a75b3bba389bec3a
child 273070 80cb5f706116b7b7abf72cc64ff73bf0b49409db
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgbrown
bugs1159390
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1159390 - Set sharedUserId in robocop.apk. r=gbrown
build/mobile/robocop/AndroidManifest.xml.in
build/mobile/robocop/Makefile.in
mobile/android/mach_commands.py
--- a/build/mobile/robocop/AndroidManifest.xml.in
+++ b/build/mobile/robocop/AndroidManifest.xml.in
@@ -1,12 +1,15 @@
 #filter substitution
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="org.mozilla.roboexample.test"
+#ifdef MOZ_ANDROID_SHARED_ID
+    android:sharedUserId="@MOZ_ANDROID_SHARED_ID@"
+#endif
     android:versionCode="1"
     android:versionName="1.0" >
 
     <uses-sdk android:minSdkVersion="8" />
 
     <instrumentation
         android:name="org.mozilla.gecko.FennecInstrumentationTestRunner"
         android:targetPackage="@ANDROID_PACKAGE_NAME@" />
--- a/build/mobile/robocop/Makefile.in
+++ b/build/mobile/robocop/Makefile.in
@@ -34,24 +34,29 @@ ANDROID_ASSETS_DIR := $(TESTPATH)/assets
   $(NULL)
 
 java-harness := $(addprefix $(srcdir)/,$(_JAVA_HARNESS))
 java-tests   := \
   $(wildcard $(TESTPATH)/*.java) \
   $(wildcard $(TESTPATH)/components/*.java) \
   $(wildcard $(TESTPATH)/helpers/*.java)
 
-PP_TARGETS        += manifest
-manifest          := $(srcdir)/AndroidManifest.xml.in
-manifest_TARGET   := AndroidManifest.xml
+PP_TARGETS += manifest
+manifest := $(srcdir)/AndroidManifest.xml.in
+manifest_TARGET := export
+manifest_FLAGS += \
+  -DMOZ_ANDROID_SHARED_ID='$(ANDROID_PACKAGE_NAME).sharedID' \
+  -DMOZ_ANDROID_SHARED_ACCOUNT_TYPE='$(ANDROID_PACKAGE_NAME)_sync' \
+  $(NULL)
+
 ANDROID_MANIFEST_FILE := $(CURDIR)/AndroidManifest.xml
 
 # Install robocop configs and helper
 INSTALL_TARGETS += robocop
-robocop_TARGET  := libs
+robocop_TARGET  := export
 robocop_DEST    := $(CURDIR)
 robocop_FILES   := \
   $(TESTPATH)/robocop.ini \
   $(TESTPATH)/robocop_autophone.ini \
   $(NULL)
 robocop-deps := $(notdir $(robocop_FILES))
 
 ROBOCOP_FILES := \
@@ -63,17 +68,18 @@ ROBOCOP_FILES := \
   $(wildcard $(TESTPATH)/*.xml) \
   $(wildcard $(TESTPATH)/*.ogg) \
   $(wildcard $(TESTPATH)/*.mp4) \
   $(wildcard $(TESTPATH)/*.webm) \
   $(wildcard $(TESTPATH)/*.swf) \
   $(wildcard $(TESTPATH)/reader_mode_pages) \
   $(NULL)
 
-ROBOCOP_DEST = $(DEPTH)/_tests/testing/mochitest/tests/robocop/
+ROBOCOP_DEST := $(DEPTH)/_tests/testing/mochitest/tests/robocop/
+ROBOCOP_TARGET := export
 INSTALL_TARGETS += ROBOCOP
 
 GARBAGE += \
   AndroidManifest.xml \
   $(robocop-deps) \
   $(testconstants-dep) \
   $(NULL)
 
--- a/mobile/android/mach_commands.py
+++ b/mobile/android/mach_commands.py
@@ -49,16 +49,17 @@ class MachCommands(MachCommandBase):
         if code:
             return code
 
         return self.run_process(['./gradlew'] + args,
             pass_thru=True, # Allow user to run gradle interactively.
             ensure_exit_code=False, # Don't throw on non-zero exit code.
             cwd=mozpath.join(self.topobjdir, 'mobile', 'android', 'gradle'))
 
+
     @Command('gradle-install', category='devenv',
         description='Install gradle environment.',
         conditions=[conditions.is_android])
     def gradle_install(self, quiet=False):
         import mozpack.manifests
         m = mozpack.manifests.InstallManifest()
 
         def srcdir(dst, src):
@@ -110,16 +111,17 @@ class MachCommands(MachCommandBase):
         srcdir('omnijar/src/main/java/locales', 'mobile/android/locales')
         srcdir('omnijar/src/main/java/chrome', 'mobile/android/chrome')
         srcdir('omnijar/src/main/java/components', 'mobile/android/components')
         srcdir('omnijar/src/main/java/modules', 'mobile/android/modules')
         srcdir('omnijar/src/main/java/themes', 'mobile/android/themes')
 
         srcdir('app/build.gradle', 'mobile/android/gradle/app/build.gradle')
         objdir('app/src/main/AndroidManifest.xml', 'mobile/android/base/AndroidManifest.xml')
+        objdir('app/src/androidTest/AndroidManifest.xml', 'build/mobile/robocop/AndroidManifest.xml')
         srcdir('app/src/androidTest/res', 'build/mobile/robocop/res')
         srcdir('app/src/androidTest/assets', 'mobile/android/base/tests/assets')
         objdir('app/src/debug/assets', 'dist/fennec/assets')
         objdir('app/src/debug/jniLibs', 'dist/fennec/lib')
         # Test code.
         srcdir('app/src/robocop_harness/org/mozilla/gecko', 'build/mobile/robocop')
         srcdir('app/src/robocop/org/mozilla/gecko/tests', 'mobile/android/base/tests')
         srcdir('app/src/background/org/mozilla/gecko', 'mobile/android/tests/background/junit3/src')