Bug 1481834 - Fix running robocop tests on debug builds. r=gbrown
authorTudor-Gabriel Vîjială <tvijiala@mozilla.com>
Tue, 21 Aug 2018 20:02:13 +0000
changeset 432679 0d1ee61d3377
parent 432678 08181a2a8cad
child 432680 9dcb4b6cb510
push id34483
push userapavel@mozilla.com
push dateWed, 22 Aug 2018 03:34:42 +0000
treeherdermozilla-central@bdf392eff10e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgbrown
bugs1481834
milestone63.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 1481834 - Fix running robocop tests on debug builds. r=gbrown Fix running robocop tests on debug builds. This patch fixes multidex issues when running robocop on debug builds. Differential Revision: https://phabricator.services.mozilla.com/D3422
mobile/android/app/build.gradle
mobile/android/config/proguard/debug-robocop-keeps.cfg
mobile/android/tests/browser/robocop/src/org/mozilla/gecko/FennecInstrumentationTestRunner.java
--- a/mobile/android/app/build.gradle
+++ b/mobile/android/app/build.gradle
@@ -75,16 +75,17 @@ android {
         release configureMinifyClosure
         if (mozconfig.substs.MOZILLA_OFFICIAL) {
             debug configureMinifyClosure
         }
 
         def isDebuggable = (!mozconfig.substs.MOZILLA_OFFICIAL) || (mozconfig.substs.NIGHTLY_BUILD && mozconfig.substs.MOZ_DEBUG)
         debug {
             debuggable isDebuggable 
+            multiDexKeepProguard file("${topsrcdir}/mobile/android/config/proguard/debug-robocop-keeps.cfg")
         }
         release {
             debuggable isDebuggable
         }
     }
 
     // The "audience" flavour dimension distinguishes between _local_ builds (intended for
     // development) and _official_ builds (intended for testing in automation and to ship in one of
new file mode 100644
--- /dev/null
+++ b/mobile/android/config/proguard/debug-robocop-keeps.cfg
@@ -0,0 +1,2 @@
+-keep class org.mozilla.gecko.** { *; }
+-keep class com.robotium.solo.** { *; }
--- a/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/FennecInstrumentationTestRunner.java
+++ b/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/FennecInstrumentationTestRunner.java
@@ -3,30 +3,32 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko;
 
 import android.app.KeyguardManager;
 import android.content.Context;
 import android.os.Bundle;
 import android.os.PowerManager;
+import android.support.multidex.MultiDex;
 import android.test.InstrumentationTestRunner;
 import android.util.Log;
 
 import static android.os.PowerManager.ACQUIRE_CAUSES_WAKEUP;
 import static android.os.PowerManager.FULL_WAKE_LOCK;
 import static android.os.PowerManager.ON_AFTER_RELEASE;
 
 public class FennecInstrumentationTestRunner extends InstrumentationTestRunner {
     private static Bundle sArguments;
     private PowerManager.WakeLock wakeLock;
     private KeyguardManager.KeyguardLock keyguardLock;
 
     @Override
     public void onCreate(Bundle arguments) {
+        MultiDex.install(getTargetContext());
         sArguments = arguments;
         if (sArguments == null) {
             Log.e("Robocop", "FennecInstrumentationTestRunner.onCreate got null bundle");
         }
         super.onCreate(arguments);
     }
 
     // unfortunately we have to make this static because test classes that don't extend