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

Adds Warm start time measurement

1- Launch enabled from WA for first app launch

2- Warm start requires stopping the first launched app, added in Applaunch class

3- markers moved in google photos and adobereader for launch call.

4- Backup popup watcher added in gmail

5- Tested for all workloads on s7
This commit is contained in:
jummp01 2016-11-23 16:48:44 +00:00
parent b323d98e51
commit 1092ef07fd
15 changed files with 76 additions and 17 deletions

View File

@ -630,9 +630,6 @@ class AndroidUxPerfWorkload(AndroidUiAutoBenchmark):
super(AndroidUxPerfWorkload, self).__init__(device, **kwargs)
# Turn class attribute into instance attribute
self.deployable_assets = list(self.deployable_assets)
# Turn off app launch from wa if markers are enabled for uxperf
if self.markers_enabled:
self.launch_main = False
def validate(self):
super(AndroidUxPerfWorkload, self).validate()

View File

@ -144,6 +144,9 @@ public class BaseUiAutomation extends UiAutomatorTestCase {
//Launches the application.
public void launch_main() throws Exception{
Process launch_p;
Process stop_app;
stop_app = Runtime.getRuntime().exec(String.format("am force-stop %s",
packageName));
logger.start();
if(activityName.equals("None")) {
launch_p = Runtime.getRuntime().exec(String.format("am start -W %s",
@ -157,16 +160,24 @@ public class BaseUiAutomation extends UiAutomatorTestCase {
}
launch_validate(launch_p);
stop_app.destroy();
launch_p.destroy();
}
//Launches the Skype application
public void launch_main(String actionName, String dataURI) throws Exception{
Process launch_p;
Process stop_app;
sleep(2);
stop_app = Runtime.getRuntime().exec(String.format("am force-stop %s",
packageName));
logger.start();
stop_app.waitFor();
launch_p = Runtime.getRuntime().exec(String.format("am start -W -a %s -d %s",
actionName, dataURI));
launch_p.waitFor();
launch_validate(launch_p);
stop_app.destroy();
launch_p.destroy();
}
}

View File

@ -62,11 +62,11 @@ public class UiAutomation extends UxPerfUiAutomation {
UiObject userBeginObject =
new UiObject(new UiSelector().textContains("RECENT")
.className("android.widget.TextView"));
setScreenOrientation(ScreenOrientation.NATURAL);
dismissWelcomeView();
if(applaunch_enabled) {
applaunch.launch_main();//launch the application
}
setScreenOrientation(ScreenOrientation.NATURAL);
dismissWelcomeView();
if(applaunch_enabled) {
applaunch.launch_end(userBeginObject,5);//mark the end of launch
}

View File

@ -23,6 +23,7 @@ import com.android.uiautomator.core.UiObject;
import com.android.uiautomator.core.UiObjectNotFoundException;
import com.android.uiautomator.core.UiSelector;
import com.android.uiautomator.core.UiScrollable;
import com.android.uiautomator.core.UiWatcher;
import com.arm.wlauto.uiauto.UxPerfUiAutomation;
@ -59,15 +60,20 @@ public class UiAutomation extends UxPerfUiAutomation {
UiObject userBeginObject =
new UiObject(new UiSelector().textContains("Photos")
.className("android.widget.TextView"));
if(applaunch_enabled) {
applaunch.launch_main();//launch the application
}
//Watcher that takes care of backup popup during warm start
UiWatcher backupPopUpWatcher = createBackupPopUpWatcher();
registerWatcher("backupPopUpWatcher", backupPopUpWatcher);
runWatchers();
setScreenOrientation(ScreenOrientation.NATURAL);
dismissWelcomeView();
closePromotionPopUp();
if(applaunch_enabled) {
applaunch.launch_main();//launch the application
}
if(applaunch_enabled) {
applaunch.launch_end(userBeginObject,5);//mark the end of launch
}
@ -453,4 +459,26 @@ public class UiAutomation extends UxPerfUiAutomation {
break;
}
}
// Creates a watcher for when a pop up dialog appears with a signin/close button.
private UiWatcher createBackupPopUpWatcher() throws Exception {
UiWatcher backupPopUpWatcher = new UiWatcher() {
@Override
public boolean checkForCondition() {
UiObject closeButton =
new UiObject(new UiSelector().resourceId(packageID + "promo_close_button"));
if (closeButton.exists()) {
try {
closeButton.click();
} catch (UiObjectNotFoundException e) {
e.printStackTrace();
}
return closeButton.waitUntilGone(TimeUnit.SECONDS.toMillis(10));
}
return false;
}
};
return backupPopUpWatcher;
}
}

View File

@ -71,9 +71,6 @@ public class UiAutomation extends UxPerfUiAutomation {
//Widget on the screen that marks the application ready for user interaction
UiObject userBeginObject =
new UiObject(new UiSelector().resourceId(packageID + "menu_search"));
if(applaunch_enabled) {
applaunch.launch_main();//launch the application
}
setScreenOrientation(ScreenOrientation.NATURAL);
@ -82,6 +79,9 @@ public class UiAutomation extends UxPerfUiAutomation {
dismissSendBooksAsGiftsDialog();
dismissSync();
if(applaunch_enabled) {
applaunch.launch_main();//launch the application
}
if(applaunch_enabled) {
applaunch.launch_end(userBeginObject,5);//mark the end of launch
}

View File

@ -66,9 +66,6 @@ public class UiAutomation extends UxPerfUiAutomation {
//Widget on the screen that marks the application ready for user interaction
UiObject userBeginObject =
new UiObject(new UiSelector().resourceId(packageID + "menu_search"));
if(applaunch_enabled) {
applaunch.launch_main(actionName,dataURI);//launch the application
}
setScreenOrientation(ScreenOrientation.NATURAL);
@ -80,6 +77,9 @@ public class UiAutomation extends UxPerfUiAutomation {
// Run tests
handleLoginScreen(loginName, loginPass);
dismissUpdatePopupIfPresent();
if(applaunch_enabled) {
applaunch.launch_main(actionName,dataURI);//launch the application
}
if(applaunch_enabled) {
applaunch.launch_end(userBeginObject,5);//mark the end of launch
}
@ -184,6 +184,29 @@ public class UiAutomation extends UxPerfUiAutomation {
return infoPopUpWatcher;
}
// Creates a watcher for when a pop up dialog appears with a continue button.
private UiWatcher createUpdatePopUpWatcher() throws Exception {
UiWatcher updatePopUpWatcher = new UiWatcher() {
@Override
public boolean checkForCondition() {
UiObject continueButton =
new UiObject(new UiSelector().resourceId(packageID + "button2"));
if (continueButton.exists()) {
try {
continueButton.click();
} catch (UiObjectNotFoundException e) {
e.printStackTrace();
}
return continueButton.waitUntilGone(TimeUnit.SECONDS.toMillis(10));
}
return false;
}
};
return updatePopUpWatcher;
}
private void voiceCallTest(int duration) throws Exception {
String testTag = "call_voice";
ActionLogger logger = new ActionLogger(testTag, parameters);

View File

@ -65,13 +65,13 @@ public class UiAutomation extends UxPerfUiAutomation {
UiObject userBeginObject =
new UiObject(new UiSelector().textContains("Home")
.className("android.widget.TextView"));
if(applaunch_enabled) {
applaunch.launch_main();//launch the application
}
setScreenOrientation(ScreenOrientation.NATURAL);
clearFirstRunDialogues();
disableAutoplay();
if(applaunch_enabled) {
applaunch.launch_main();//launch the application
}
if(applaunch_enabled) {
applaunch.launch_end(userBeginObject,5);//mark the end of launch
}