Index: build/android/pylib/gtest/gtest_test_instance.py |
diff --git a/build/android/pylib/gtest/gtest_test_instance.py b/build/android/pylib/gtest/gtest_test_instance.py |
index ed1190fc469e38093f0280fc2b20e1e73a91b365..3285e0b698529a91b09817e9f9448a00cac94d87 100644 |
--- a/build/android/pylib/gtest/gtest_test_instance.py |
+++ b/build/android/pylib/gtest/gtest_test_instance.py |
@@ -12,6 +12,7 @@ import tempfile |
from pylib import constants |
from pylib.base import base_test_result |
from pylib.base import test_instance |
+from pylib.utils import apk_helper |
sys.path.append(os.path.join( |
constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib', 'common')) |
@@ -24,6 +25,29 @@ BROWSER_TEST_SUITES = [ |
] |
+_DEFAULT_ISOLATE_FILE_PATHS = { |
+ 'base_unittests': 'base/base_unittests.isolate', |
+ 'blink_heap_unittests': |
+ 'third_party/WebKit/Source/platform/heap/BlinkHeapUnitTests.isolate', |
+ 'breakpad_unittests': 'breakpad/breakpad_unittests.isolate', |
+ 'cc_perftests': 'cc/cc_perftests.isolate', |
+ 'components_browsertests': 'components/components_browsertests.isolate', |
+ 'components_unittests': 'components/components_unittests.isolate', |
+ 'content_browsertests': 'content/content_browsertests.isolate', |
+ 'content_unittests': 'content/content_unittests.isolate', |
+ 'media_perftests': 'media/media_perftests.isolate', |
+ 'media_unittests': 'media/media_unittests.isolate', |
+ 'midi_unittests': 'media/midi/midi_unittests.isolate', |
+ 'net_unittests': 'net/net_unittests.isolate', |
+ 'sql_unittests': 'sql/sql_unittests.isolate', |
+ 'sync_unit_tests': 'sync/sync_unit_tests.isolate', |
+ 'ui_base_unittests': 'ui/base/ui_base_tests.isolate', |
+ 'unit_tests': 'chrome/unit_tests.isolate', |
+ 'webkit_unit_tests': |
+ 'third_party/WebKit/Source/web/WebKitUnitTests.isolate', |
+} |
+ |
+ |
# Used for filtering large data deps at a finer grain than what's allowed in |
# isolate files since pushing deps to devices is expensive. |
# Wildcards are allowed. |
@@ -47,6 +71,13 @@ _DEPS_EXCLUSION_LIST = [ |
] |
+_EXTRA_NATIVE_TEST_ACTIVITY = ( |
+ 'org.chromium.native_test.NativeTestInstrumentationTestRunner.' |
+ 'NativeTestActivity') |
+_EXTRA_SHARD_SIZE_LIMIT =( |
+ 'org.chromium.native_test.NativeTestInstrumentationTestRunner.' |
+ 'ShardSizeLimit') |
+ |
# TODO(jbudorick): Remove these once we're no longer parsing stdout to generate |
# results. |
_RE_TEST_STATUS = re.compile( |
@@ -106,6 +137,20 @@ class GtestTestInstance(test_instance.TestInstance): |
self._suite) |
if not os.path.exists(self._apk_path): |
self._apk_path = None |
+ self._activity = None |
+ self._package = None |
+ self._runner = None |
+ else: |
+ helper = apk_helper.ApkHelper(self._apk_path) |
+ self._activity = helper.GetActivityName() |
+ self._package = helper.GetPackageName() |
+ self._runner = helper.GetInstrumentationName() |
+ self._extras = { |
+ _EXTRA_NATIVE_TEST_ACTIVITY: self._activity, |
+ } |
+ if self._suite in BROWSER_TEST_SUITES: |
+ self._extras[_EXTRA_SHARD_SIZE_LIMIT] = 1 |
+ |
if not os.path.exists(self._exe_path): |
self._exe_path = None |
if not self._apk_path and not self._exe_path: |
@@ -119,6 +164,13 @@ class GtestTestInstance(test_instance.TestInstance): |
self._gtest_filter = ':'.join(l.strip() for l in f) |
else: |
self._gtest_filter = None |
+ |
+ if not args.isolate_file_path: |
+ default_isolate_file_path = _DEFAULT_ISOLATE_FILE_PATHS.get(self._suite) |
+ if default_isolate_file_path: |
+ args.isolate_file_path = os.path.join( |
+ constants.DIR_SOURCE_ROOT, default_isolate_file_path) |
+ |
if args.isolate_file_path: |
self._isolate_abs_path = os.path.abspath(args.isolate_file_path) |
self._isolate_delegate = isolate_delegate |
@@ -240,6 +292,10 @@ class GtestTestInstance(test_instance.TestInstance): |
self._isolate_delegate.Clear() |
@property |
+ def activity(self): |
+ return self._activity |
+ |
+ @property |
def apk(self): |
return self._apk_path |
@@ -256,6 +312,18 @@ class GtestTestInstance(test_instance.TestInstance): |
return self._exe_path |
@property |
+ def extras(self): |
+ return self._extras |
+ |
+ @property |
+ def package(self): |
+ return self._package |
+ |
+ @property |
+ def runner(self): |
+ return self._runner |
+ |
+ @property |
def suite(self): |
return self._suite |