Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4442)

Unified Diff: build/android/pylib/instrumentation/instrumentation_test_instance.py

Issue 1094903008: Revert of [Android] Add an out-of-app instrumentation driver APK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 0633f1466dfd79a6c1906b7db7de4f313f354e6d..ccc0e728602042a8d5c8efeeef4889b20bfe6304 100644
--- a/build/android/pylib/instrumentation/instrumentation_test_instance.py
+++ b/build/android/pylib/instrumentation/instrumentation_test_instance.py
@@ -30,17 +30,6 @@
_DEFAULT_ANNOTATIONS = [
'Smoke', 'SmallTest', 'MediumTest', 'LargeTest',
'EnormousTest', 'IntegrationTest']
-_EXTRA_ENABLE_HTTP_SERVER = (
- 'org.chromium.chrome.test.ChromeInstrumentationTestRunner.'
- + 'EnableTestHttpServer')
-_EXTRA_DRIVER_TEST_LIST = (
- 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TestList')
-_EXTRA_DRIVER_TEST_LIST_FILE = (
- 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TestListFile')
-_EXTRA_DRIVER_TARGET_PACKAGE = (
- 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TargetPackage')
-_EXTRA_DRIVER_TARGET_CLASS = (
- 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TargetClass')
_NATIVE_CRASH_RE = re.compile('native crash', re.IGNORECASE)
_PICKLE_FORMAT_VERSION = 10
@@ -141,35 +130,29 @@
self._apk_under_test = None
self._package_info = None
- self._suite = None
self._test_apk = None
self._test_jar = None
self._test_package = None
self._test_runner = None
self._test_support_apk = None
- self._initializeApkAttributes(args, error_func)
+ self.__initializeApkAttributes(args, error_func)
self._data_deps = None
self._isolate_abs_path = None
self._isolate_delegate = None
self._isolated_abs_path = None
self._test_data = None
- self._initializeDataDependencyAttributes(args, isolate_delegate)
+ self.__initializeDataDependencyAttributes(args, isolate_delegate)
self._annotations = None
self._excluded_annotations = None
self._test_filter = None
- self._initializeTestFilterAttributes(args)
+ self.__initializeTestFilterAttributes(args)
self._flags = None
- self._initializeFlagAttributes(args)
-
- self._driver_apk = None
- self._driver_package = None
- self._driver_name = None
- self._initializeDriverAttributes()
-
- def _initializeApkAttributes(self, args, error_func):
+ self.__initializeFlagAttributes(args)
+
+ def __initializeApkAttributes(self, args, error_func):
if args.apk_under_test.endswith('.apk'):
self._apk_under_test = args.apk_under_test
else:
@@ -181,20 +164,20 @@
error_func('Unable to find APK under test: %s' % self._apk_under_test)
if args.test_apk.endswith('.apk'):
- self._suite = os.path.splitext(os.path.basename(args.test_apk))[0]
+ test_apk_root = os.path.splitext(os.path.basename(args.test_apk))[0]
self._test_apk = args.test_apk
else:
- self._suite = args.test_apk
+ test_apk_root = args.test_apk
self._test_apk = os.path.join(
constants.GetOutDirectory(), constants.SDK_BUILD_APKS_DIR,
'%s.apk' % args.test_apk)
self._test_jar = os.path.join(
constants.GetOutDirectory(), constants.SDK_BUILD_TEST_JAVALIB_DIR,
- '%s.jar' % self._suite)
+ '%s.jar' % test_apk_root)
self._test_support_apk = os.path.join(
constants.GetOutDirectory(), constants.SDK_BUILD_TEST_JAVALIB_DIR,
- '%sSupport.apk' % self._suite)
+ '%sSupport.apk' % test_apk_root)
if not os.path.exists(self._test_apk):
error_func('Unable to find test APK: %s' % self._test_apk)
@@ -211,7 +194,7 @@
if not self._package_info:
logging.warning('Unable to find package info for %s', self._test_package)
- def _initializeDataDependencyAttributes(self, args, isolate_delegate):
+ def __initializeDataDependencyAttributes(self, args, isolate_delegate):
self._data_deps = []
if args.isolate_file_path:
self._isolate_abs_path = os.path.abspath(args.isolate_file_path)
@@ -232,7 +215,7 @@
if not self._isolate_delegate and not self._test_data:
logging.warning('No data dependencies will be pushed.')
- def _initializeTestFilterAttributes(self, args):
+ def __initializeTestFilterAttributes(self, args):
self._test_filter = args.test_filter
def annotation_dict_element(a):
@@ -257,7 +240,7 @@
else:
self._excluded_annotations = {}
- def _initializeFlagAttributes(self, args):
+ def __initializeFlagAttributes(self, args):
self._flags = ['--disable-fre', '--enable-test-intents']
# TODO(jbudorick): Transition "--device-flags" to "--device-flags-file"
if hasattr(args, 'device_flags') and args.device_flags:
@@ -269,17 +252,9 @@
stripped_lines = (l.strip() for l in device_flags_file)
self._flags.extend([flag for flag in stripped_lines if flag])
- def _initializeDriverAttributes(self):
- self._driver_apk = os.path.join(
- constants.GetOutDirectory(), constants.SDK_BUILD_APKS_DIR,
- 'OnDeviceInstrumentationDriver.apk')
- if os.path.exists(self._driver_apk):
- self._driver_package = apk_helper.GetPackageName(
- self._driver_apk)
- self._driver_name = apk_helper.GetInstrumentationName(
- self._driver_apk)
- else:
- self._driver_apk = None
+ @property
+ def suite(self):
+ return 'instrumentation'
@property
def apk_under_test(self):
@@ -290,24 +265,8 @@
return self._flags
@property
- def driver_apk(self):
- return self._driver_apk
-
- @property
- def driver_package(self):
- return self._driver_package
-
- @property
- def driver_name(self):
- return self._driver_name
-
- @property
def package_info(self):
return self._package_info
-
- @property
- def suite(self):
- return self._suite
@property
def test_apk(self):
@@ -487,28 +446,6 @@
return inflated_tests
@staticmethod
- def GetHttpServerEnvironmentVars():
- return {
- _EXTRA_ENABLE_HTTP_SERVER: None,
- }
-
- def GetDriverEnvironmentVars(
- self, test_list=None, test_list_file_path=None):
- env = {
- _EXTRA_DRIVER_TARGET_PACKAGE: self.test_package,
- _EXTRA_DRIVER_TARGET_CLASS: self.test_runner,
- }
-
- if test_list:
- env[_EXTRA_DRIVER_TEST_LIST] = ','.join(test_list)
-
- if test_list_file_path:
- env[_EXTRA_DRIVER_TEST_LIST_FILE] = (
- os.path.basename(test_list_file_path))
-
- return env
-
- @staticmethod
def ParseAmInstrumentRawOutput(raw_output):
return ParseAmInstrumentRawOutput(raw_output)

Powered by Google App Engine
This is Rietveld 408576698