Index: build/android/pylib/instrumentation/instrumentation_test_instance.py |
diff --git a/build/android/pylib/instrumentation/instrumentation_test_instance.py b/build/android/pylib/instrumentation/instrumentation_test_instance.py |
index 3faaf39db0f031d61ce5ac4f3ce132cbd8b55d73..613b778d1fab4acd5bf281ca67a2e7fa04b71c8f 100644 |
--- a/build/android/pylib/instrumentation/instrumentation_test_instance.py |
+++ b/build/android/pylib/instrumentation/instrumentation_test_instance.py |
@@ -195,13 +195,13 @@ class InstrumentationTestInstance(test_instance.TestInstance): |
self._additional_apks = [] |
self._apk_under_test = None |
- self._apk_under_test_permissions = None |
+ self._apk_under_test_incremental_install_script = None |
self._package_info = None |
self._suite = None |
self._test_apk = None |
+ self._test_apk_incremental_install_script = None |
self._test_jar = None |
self._test_package = None |
- self._test_permissions = None |
self._test_runner = None |
self._test_support_apk = None |
self._initializeApkAttributes(args, error_func) |
@@ -230,44 +230,49 @@ class InstrumentationTestInstance(test_instance.TestInstance): |
self._initializeTestControlAttributes(args) |
def _initializeApkAttributes(self, args, error_func): |
- if args.apk_under_test.endswith('.apk'): |
- self._apk_under_test = args.apk_under_test |
- else: |
- self._apk_under_test = os.path.join( |
+ apk_under_test_path = args.apk_under_test |
+ if not args.apk_under_test.endswith('.apk'): |
+ apk_under_test_path = os.path.join( |
constants.GetOutDirectory(), constants.SDK_BUILD_APKS_DIR, |
'%s.apk' % args.apk_under_test) |
- if not os.path.exists(self._apk_under_test): |
- error_func('Unable to find APK under test: %s' % self._apk_under_test) |
+ if not os.path.exists(apk_under_test_path): |
+ error_func('Unable to find APK under test: %s' % apk_under_test_path) |
- apk = apk_helper.ApkHelper(self._apk_under_test) |
- self._apk_under_test_permissions = apk.GetPermissions() |
+ self._apk_under_test = apk_helper.ToHelper(apk_under_test_path) |
if args.test_apk.endswith('.apk'): |
self._suite = os.path.splitext(os.path.basename(args.test_apk))[0] |
- self._test_apk = args.test_apk |
+ self._test_apk = apk_helper.ToHelper(args.test_apk) |
else: |
self._suite = args.test_apk |
- self._test_apk = os.path.join( |
+ self._test_apk = apk_helper.ToHelper(os.path.join( |
constants.GetOutDirectory(), constants.SDK_BUILD_APKS_DIR, |
- '%s.apk' % args.test_apk) |
+ '%s.apk' % args.test_apk)) |
+ |
+ self._apk_under_test_incremental_install_script = ( |
+ args.apk_under_test_incremental_install_script) |
+ self._test_apk_incremental_install_script = ( |
+ args.test_apk_incremental_install_script) |
+ |
+ if self._test_apk_incremental_install_script: |
+ assert self._suite.endswith('_incremental') |
+ self._suite = self._suite[:-len('_incremental')] |
self._test_jar = os.path.join( |
constants.GetOutDirectory(), constants.SDK_BUILD_TEST_JAVALIB_DIR, |
'%s.jar' % self._suite) |
- self._test_support_apk = os.path.join( |
+ self._test_support_apk = apk_helper.ToHelper(os.path.join( |
constants.GetOutDirectory(), constants.SDK_BUILD_TEST_JAVALIB_DIR, |
- '%sSupport.apk' % self._suite) |
+ '%sSupport.apk' % self._suite)) |
- if not os.path.exists(self._test_apk): |
- error_func('Unable to find test APK: %s' % self._test_apk) |
+ if not os.path.exists(self._test_apk.path): |
+ error_func('Unable to find test APK: %s' % self._test_apk.path) |
if not os.path.exists(self._test_jar): |
error_func('Unable to find test JAR: %s' % self._test_jar) |
- apk = apk_helper.ApkHelper(self.test_apk) |
- self._test_package = apk.GetPackageName() |
- self._test_permissions = apk.GetPermissions() |
- self._test_runner = apk.GetInstrumentationName() |
+ self._test_package = self._test_apk.GetPackageName() |
+ self._test_runner = self._test_apk.GetInstrumentationName() |
self._package_info = None |
for package_info in constants.PACKAGE_INFO.itervalues(): |
@@ -279,7 +284,8 @@ class InstrumentationTestInstance(test_instance.TestInstance): |
for apk in args.additional_apks: |
if not os.path.exists(apk): |
error_func('Unable to find additional APK: %s' % apk) |
- self._additional_apks = args.additional_apks |
+ self._additional_apks = ( |
+ [apk_helper.ToHelper(x) for x in args.additional_apks]) |
def _initializeDataDependencyAttributes(self, args, isolate_delegate): |
self._data_deps = [] |
@@ -372,8 +378,8 @@ class InstrumentationTestInstance(test_instance.TestInstance): |
return self._apk_under_test |
@property |
- def apk_under_test_permissions(self): |
- return self._apk_under_test_permissions |
+ def apk_under_test_incremental_install_script(self): |
+ return self._apk_under_test_incremental_install_script |
@property |
def flags(self): |
@@ -404,6 +410,10 @@ class InstrumentationTestInstance(test_instance.TestInstance): |
return self._test_apk |
@property |
+ def test_apk_incremental_install_script(self): |
+ return self._test_apk_incremental_install_script |
+ |
+ @property |
def test_jar(self): |
return self._test_jar |
@@ -416,10 +426,6 @@ class InstrumentationTestInstance(test_instance.TestInstance): |
return self._test_package |
@property |
- def test_permissions(self): |
- return self._test_permissions |
- |
- @property |
def test_runner(self): |
return self._test_runner |