1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-10-29 22:24:51 +00:00

Add Multiapp workload

A new workload for testing context switching between applications.
Uses googlephotos as the producer workload and gmail and skype as
the consumer workloads.
This commit is contained in:
John Richardson
2016-05-17 13:37:04 +01:00
parent 0f7aff48cc
commit 2532f36a62
17 changed files with 590 additions and 25 deletions

View File

@@ -62,8 +62,6 @@ class Skype(AndroidUiAutoBenchmark):
'''),
Parameter('login_pass', kind=str, mandatory=True,
description='Password associated with the account to log into the device'),
Parameter('contact_skypeid', kind=str, mandatory=True,
description='This is the Skype ID of the contact to call from the device'),
Parameter('contact_name', kind=str, mandatory=True,
description='This is the contact display name as it appears in the people list'),
Parameter('duration', kind=int, default=60,
@@ -89,7 +87,6 @@ class Skype(AndroidUiAutoBenchmark):
self.uiauto_params['output_dir'] = self.device.working_directory
self.uiauto_params['my_id'] = self.login_name
self.uiauto_params['my_pwd'] = self.login_pass
self.uiauto_params['skypeid'] = self.contact_skypeid
self.uiauto_params['name'] = self.contact_name.replace(' ', '_')
self.uiauto_params['duration'] = self.duration
self.uiauto_params['action'] = self.action

View File

@@ -54,7 +54,6 @@ public class UiAutomation extends UxPerfUiAutomation {
Bundle parameters = getParams();
String loginName = parameters.getString("my_id");
String loginPass = parameters.getString("my_pwd");
String contactSkypeId = parameters.getString("skypeid");
String contactName = parameters.getString("name").replace("_", " ");
int callDuration = Integer.parseInt(parameters.getString("duration"));
String callType = parameters.getString("action");
@@ -67,7 +66,7 @@ public class UiAutomation extends UxPerfUiAutomation {
// Run tests
handleLoginScreen(loginName, loginPass);
confirmAccess();
selectContact(contactName, contactSkypeId);
selectContact(contactName);
if ("video".equalsIgnoreCase(callType)) {
videoCallTest(callDuration);
} else if ("voice".equalsIgnoreCase(callType)) {
@@ -80,7 +79,7 @@ public class UiAutomation extends UxPerfUiAutomation {
writeResultsToFile(results, resultsFile);
}
private void handleLoginScreen(String username, String password) throws Exception {
public void handleLoginScreen(String username, String password) throws Exception {
String useridResoureId = PACKAGE_ID + "sign_in_userid";
String nextButtonResourceId = PACKAGE_ID + "sign_in_next_btn";
UiObject useridField = new UiObject(new UiSelector().resourceId(useridResoureId));
@@ -96,7 +95,7 @@ public class UiAutomation extends UxPerfUiAutomation {
signinButton.clickAndWaitForNewWindow();
}
private void selectContact(String name, String id) throws Exception {
public void selectContact(String name) throws Exception {
Timer timer = new Timer();
timer.start();
UiObject peopleTab;
@@ -123,6 +122,22 @@ public class UiAutomation extends UxPerfUiAutomation {
results.put("select_contact", timer);
}
public void searchForContact(String name) throws Exception {
UiObject search = getUiObjectByText("Search", "android.widget.EditText");
search.setText(name);
UiObject peopleItem =
new UiObject(new UiSelector().resourceId("com.skype.raider:id/list")
.childSelector(new UiSelector()
.index(0)
.clickable(true)));
peopleItem.click();
UiObject confirm =
getUiObjectByResourceId("com.skype.raider:id/fab", "android.widget.ImageView");
confirm.click();
}
private void voiceCallTest(int duration) throws Exception {
String testTag = "voice_call";
Timer timer = new Timer();