1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-09-06 13:22:32 +01:00

Update Gmail workload to attached images to sample email

Adds 5 image files to the email before sending.
This commit is contained in:
James Hartley
2016-04-28 21:35:12 +01:00
parent b0d0a19bf0
commit 73a54103e1
3 changed files with 54 additions and 1 deletions

View File

@@ -42,6 +42,20 @@ class Gmail(AndroidUiAutoBenchmark):
super(Gmail, self).__init__(device, **kwargs)
self.uiauto_params['recipient'] = self.recipient
def setup(self, context):
super(Gmail, self).setup(context)
self.camera_dir = self.device.path.join(self.device.external_storage_directory,
'DCIM/Camera/')
for file in os.listdir(self.dependencies_directory):
if file.endswith(".jpg"):
self.device.push_file(os.path.join(self.dependencies_directory, file),
os.path.join(self.camera_dir, file), timeout=300)
# Force a re-index of the mediaserver cache to pick up new files
self.device.execute('am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///sdcard')
def validate(self):
super(Gmail, self).validate()
self.output_file = os.path.join(self.device.working_directory, self.instrumentation_log)