1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-18 20:11:20 +00:00

Merge pull request #330 from jimboatarm/break_setup

Splits ApkWorkload setup() into short methods.
This commit is contained in:
setrofim 2017-01-13 15:39:11 +00:00 committed by GitHub
commit fbb9908298

View File

@ -204,7 +204,12 @@ class ApkWorkload(Workload):
def setup(self, context): # pylint: disable=too-many-branches
Workload.setup(self, context)
self.setup_workload_apk(context)
self.launch_application()
self.kill_background()
self.device.clear_logcat()
def setup_workload_apk(self, context):
# Get target version
target_version = self.device.get_installed_package_version(self.package)
if target_version:
@ -268,10 +273,12 @@ class ApkWorkload(Workload):
self.apk_version = self.device.get_installed_package_version(self.package)
context.add_classifiers(apk_version=self.apk_version)
def launch_application(self):
if self.launch_main:
self.launch_package() # launch default activity without intent data
def kill_background(self):
self.device.execute('am kill-all') # kill all *background* activities
self.device.clear_logcat()
def force_install_apk(self, context, host_version):
if host_version is None: