/** * Regression test to verify that updating a forward-locked app will install the update onto the * device's forward-locked location * * <p>Assumes adb is running as root in device under test. */ public void testInstallAndUpdateNoLocForwardLockedApp() throws Exception { Log.i(LOG_TAG, "Test updating a forward-locked app with no installLocation pref set"); try { // install the app mPMHostUtils.installFwdLockedAppAndVerifyExists( getTestAppFilePath(NO_LOC_VERSION_V1_APK), NO_LOC_VERSION_PKG, false); // now replace the app with an update marked for internalOnly... mPMHostUtils.installFwdLockedAppAndVerifyExists( getTestAppFilePath(NO_LOC_VERSION_V2_APK), NO_LOC_VERSION_PKG, true); } // cleanup test app finally { mPMHostUtils.uninstallApp(NO_LOC_VERSION_PKG); } }
/** * Regression test to verify that installing and updating a forward-locked app will install the * update onto the device's forward-locked location * * <p>Assumes adb is running as root in device under test. */ public void testInstallAndUpdateExternalLocForwardLockedApp() throws Exception { Log.i(LOG_TAG, "Test updating a forward-locked app marked preferExternal"); try { // first try to install the forward-locked app externally mPMHostUtils.installFwdLockedAppAndVerifyExists( getTestAppFilePath(EXTERNAL_LOC_VERSION_V1_APK), EXTERNAL_LOC_VERSION_PKG, false); // now replace the app with an update marked for internalOnly and as forward locked mPMHostUtils.installFwdLockedAppAndVerifyExists( getTestAppFilePath(EXTERNAL_LOC_VERSION_V2_APK), EXTERNAL_LOC_VERSION_PKG, true); } // cleanup test app finally { mPMHostUtils.uninstallApp(EXTERNAL_LOC_VERSION_PKG); } }
/** * Regression test to verify that an app with no installLocation set and is forward-locked * installed will get installed to the correct location. * * <p>Assumes adb is running as root in device under test. */ public void testInstallFwdLockedAppNone() throws Exception { Log.i(LOG_TAG, "Test an app with no installLoc set gets installed to app-private"); try { mPMHostUtils.installFwdLockedAppAndVerifyExists( getTestAppFilePath(NO_LOC_APK), NO_LOC_PKG, false); } // cleanup test app finally { mPMHostUtils.uninstallApp(NO_LOC_PKG); } }
/** * Regression test to verify that an app with its installLocation set to external that is * forward-locked will get installed to the correct location. * * <p>Assumes adb is running as root in device under test. */ public void testInstallFwdLockedAppExternal() throws Exception { Log.i(LOG_TAG, "Test an app with installLoc set to Internal gets installed to app-private"); try { mPMHostUtils.installFwdLockedAppAndVerifyExists( getTestAppFilePath(EXTERNAL_LOC_APK), EXTERNAL_LOC_PKG, false); } // cleanup test app finally { mPMHostUtils.uninstallApp(EXTERNAL_LOC_PKG); } }