mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-31 10:11:17 +00:00
Merge pull request #330 from jimboatarm/break_setup
Splits ApkWorkload setup() into short methods.
This commit is contained in:
commit
fbb9908298
@ -204,7 +204,12 @@ class ApkWorkload(Workload):
|
|||||||
|
|
||||||
def setup(self, context): # pylint: disable=too-many-branches
|
def setup(self, context): # pylint: disable=too-many-branches
|
||||||
Workload.setup(self, context)
|
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
|
# Get target version
|
||||||
target_version = self.device.get_installed_package_version(self.package)
|
target_version = self.device.get_installed_package_version(self.package)
|
||||||
if target_version:
|
if target_version:
|
||||||
@ -268,10 +273,12 @@ class ApkWorkload(Workload):
|
|||||||
self.apk_version = self.device.get_installed_package_version(self.package)
|
self.apk_version = self.device.get_installed_package_version(self.package)
|
||||||
context.add_classifiers(apk_version=self.apk_version)
|
context.add_classifiers(apk_version=self.apk_version)
|
||||||
|
|
||||||
|
def launch_application(self):
|
||||||
if self.launch_main:
|
if self.launch_main:
|
||||||
self.launch_package() # launch default activity without intent data
|
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.execute('am kill-all') # kill all *background* activities
|
||||||
self.device.clear_logcat()
|
|
||||||
|
|
||||||
def force_install_apk(self, context, host_version):
|
def force_install_apk(self, context, host_version):
|
||||||
if host_version is None:
|
if host_version is None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user