Bug 1249491 - Move getTestProfile to BaseRobocopTest. r=sebastian
authorMichael Comella <michael.l.comella@gmail.com>
Mon, 14 Mar 2016 16:44:30 -0700
changeset 290798 08685d4867990cf629a57baaeeb24f66575cd296
parent 290797 14c2f0dda69563fabc9a19c6aa1d076ae59592be
child 290799 1e683499ef1155866eb34b57d01b0e8c0e337fa3
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssebastian
bugs1249491
milestone48.0a1
Bug 1249491 - Move getTestProfile to BaseRobocopTest. r=sebastian MozReview-Commit-ID: 17IM5fo78no
mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/BaseRobocopTest.java
mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/BaseTest.java
--- a/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/BaseRobocopTest.java
+++ b/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/BaseRobocopTest.java
@@ -21,16 +21,17 @@ import org.mozilla.gecko.BrowserApp;
 import org.mozilla.gecko.Driver;
 import org.mozilla.gecko.FennecInstrumentationTestRunner;
 import org.mozilla.gecko.FennecMochitestAssert;
 import org.mozilla.gecko.FennecNativeActions;
 import org.mozilla.gecko.FennecNativeDriver;
 import org.mozilla.gecko.FennecTalosAssert;
 import org.mozilla.gecko.GeckoAppShell;
 import org.mozilla.gecko.GeckoEvent;
+import org.mozilla.gecko.GeckoProfile;
 import org.mozilla.gecko.updater.UpdateServiceHelper;
 
 import java.net.HttpURLConnection;
 import java.net.URL;
 import java.util.Map;
 
 @SuppressWarnings("unchecked")
 public abstract class BaseRobocopTest extends ActivityInstrumentationTestCase2<Activity> {
@@ -272,9 +273,17 @@ public abstract class BaseRobocopTest ex
     /**
      * Ensure that the screen on the test device is powered on during tests.
      */
     public void throwIfScreenNotOn() {
         final PowerManager pm = (PowerManager) getActivity().getSystemService(Context.POWER_SERVICE);
         mAsserter.ok(pm.isScreenOn(),
             "Robocop tests need the test device screen to be powered on.", "");
     }
+
+    protected GeckoProfile getTestProfile() {
+        if (mProfile.startsWith("/")) {
+            return GeckoProfile.get(getActivity(), "default", mProfile);
+        }
+
+        return GeckoProfile.get(getActivity(), mProfile);
+    }
 }
--- a/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/BaseTest.java
+++ b/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/BaseTest.java
@@ -100,24 +100,16 @@ abstract class BaseTest extends BaseRobo
         mDevice = new Device();
         mDatabaseHelper = new DatabaseHelper(getActivity(), mAsserter);
 
         // Ensure Robocop tests have access to network, and are run with Display powered on.
         throwIfHttpGetFails();
         throwIfScreenNotOn();
     }
 
-    protected GeckoProfile getTestProfile() {
-        if (mProfile.startsWith("/")) {
-            return GeckoProfile.get(getActivity(), "default", mProfile);
-        }
-
-        return GeckoProfile.get(getActivity(), mProfile);
-    }
-
     protected void initializeProfile() {
         final GeckoProfile profile = getTestProfile();
 
         // In Robocop tests, we typically don't get initialized correctly, because
         // GeckoProfile doesn't create the profile directory.
         profile.enqueueInitialization(profile.getDir());
     }