Bug 1263390 - TestRunner: Always use non-library configuration. r?mcomella draft
authorSebastian Kaspari <s.kaspari@gmail.com>
Tue, 19 Apr 2016 20:37:09 +0200
changeset 357236 83ad8f344d3e2a8445700d7ad94568da9f302661
parent 357235 03b235c5669de9404330d8f6b9f3c8f199f97ff8
child 357237 990abdef5627ac75833ba3bb956b3536ea7eca84
push id16738
push users.kaspari@gmail.com
push dateThu, 28 Apr 2016 09:41:50 +0000
reviewersmcomella
bugs1263390
milestone49.0a1
Bug 1263390 - TestRunner: Always use non-library configuration. r?mcomella MozReview-Commit-ID: 2ONcv2T0iSC
mobile/android/tests/background/junit4/src/org/mozilla/gecko/background/testhelpers/TestRunner.java
--- a/mobile/android/tests/background/junit4/src/org/mozilla/gecko/background/testhelpers/TestRunner.java
+++ b/mobile/android/tests/background/junit4/src/org/mozilla/gecko/background/testhelpers/TestRunner.java
@@ -62,48 +62,35 @@ public class TestRunner extends Robolect
         }
 
         buildFolder = FileFsFile.from(getBuildDir(config)).join("intermediates");
 
         final String type = getType(config);
         final String flavor = getFlavor(config);
         final String packageName = getPackageName(config);
 
-        final FsFile res;
-        final FsFile assets;
-        final FsFile manifest;
+        final FsFile assets = buildFolder.join("assets", flavor, type);;
+        final FsFile manifest = buildFolder.join("manifests", "full", flavor, type, "AndroidManifest.xml");
 
-        if (areResourcesFromLibrary()) {
-            FsFile bundlesFolder = buildFolder.join("bundles", flavor, type);
-            res = bundlesFolder.join("res");
-            assets = bundlesFolder.join("assets");
-            manifest = bundlesFolder.join("AndroidManifest.xml");
+        final FsFile res;
+        if (buildFolder.join("res", "merged").exists()) {
+            res = buildFolder.join("res", "merged", flavor, type);
+        } else if(buildFolder.join("res").exists()) {
+            res = buildFolder.join("res", flavor, type);
         } else {
-            if (buildFolder.join("res", "merged").exists()) {
-                res = buildFolder.join("res", "merged", flavor, type);
-            } else if(buildFolder.join("res").exists()) {
-                res = buildFolder.join("res", flavor, type);
-            } else {
-                throw new IllegalStateException("No resource folder found");
-            }
-            assets = buildFolder.join("assets", flavor, type);
-            manifest = buildFolder.join("manifests", "full", flavor, type, "AndroidManifest.xml");
+            throw new IllegalStateException("No resource folder found");
         }
 
         Logger.debug("Robolectric assets directory: " + assets.getPath());
         Logger.debug("   Robolectric res directory: " + res.getPath());
         Logger.debug("   Robolectric manifest path: " + manifest.getPath());
         Logger.debug("    Robolectric package name: " + packageName);
         return new AndroidManifest(manifest, res, assets, packageName);
     }
 
-    private boolean areResourcesFromLibrary() {
-        return buildFolder.join("bundles").exists();
-    }
-
     private static String getType(Config config) {
         try {
             return ReflectionHelpers.getStaticField(config.constants(), "BUILD_TYPE");
         } catch (Throwable e) {
             return null;
         }
     }