Index: build/android/pylib/gtest/test_package_apk.py |
diff --git a/build/android/pylib/gtest/test_package_apk.py b/build/android/pylib/gtest/test_package_apk.py |
index 16ef21c6e449030cb8aca8cc2cf2cca115a7ec0d..36d72a3e0460e6ffc2af965bdaafeb3586d31fc7 100644 |
--- a/build/android/pylib/gtest/test_package_apk.py |
+++ b/build/android/pylib/gtest/test_package_apk.py |
@@ -70,11 +70,17 @@ class TestPackageApk(TestPackage): |
args += ['shell', 'cat', self._GetFifo()] |
return pexpect.spawn('adb', args, timeout=timeout, logfile=logfile) |
- def _StartActivity(self, device, force_stop=True): |
+ def _StartActivity(self, device, tests_run_in_subthread=False, |
+ force_stop=True): |
+ if tests_run_in_subthread: |
+ extras = {'RunInSubThread':''} |
jbudorick
2015/06/19 15:15:19
nit: space after :
aberent
2015/06/19 17:59:40
Done.
|
+ else: |
+ extras = [] |
device.StartActivity( |
intent.Intent(package=self._package_info.package, |
activity=self._package_info.activity, |
- action='android.intent.action.MAIN'), |
+ action='android.intent.action.MAIN', |
+ extras=extras), |
# No wait since the runner waits for FIFO creation anyway. |
blocking=False, |
force_stop=force_stop) |
@@ -127,14 +133,14 @@ class TestPackageApk(TestPackage): |
return gtest_test_instance.ParseGTestListTests(content) |
#override |
- def SpawnTestProcess(self, device): |
+ def SpawnTestProcess(self, device, tests_run_in_subthread=False): |
try: |
self.tool.SetupEnvironment() |
self._ClearFifo(device) |
# Doesn't need to stop an Activity because ClearApplicationState() is |
# always called before this call and so it is already stopped at this |
# point. |
- self._StartActivity(device, force_stop=False) |
+ self._StartActivity(device, tests_run_in_subthread, force_stop=False ) |
finally: |
self.tool.CleanUpEnvironment() |
logfile = android_commands.NewLineNormalizer(sys.stdout) |